From a1b0db826a2bbbd185fe69c755f55c1c401a5562 Mon Sep 17 00:00:00 2001 From: Torrey Searle Date: Thu, 9 Aug 2018 09:34:17 +0200 Subject: [PATCH] res/res_pjsip_sdp_rtp: put rtcp-mux in answer only if offered If in the initial sdp the caller doesn't include the line a=rtcp-mux Then asterisk shoud not include rtcp-mux in the response regardless of rtcp-mux being enabled on the endpoint ASTERISK-28007 #close Change-Id: I58e9b9f40a139afc0da5de41906cc608fb62adc7 --- res/res_pjsip_sdp_rtp.c | 4 ++-- res/res_pjsip_session.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 43b89a988c..7c7040e35b 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -1376,8 +1376,8 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as attr->name = STR_SENDRECV; media->attr[media->attr_count++] = attr; - /* If we've got rtcp-mux enabled, just unconditionally offer it in all SDPs */ - if (session->endpoint->rtcp_mux) { + /* If we've got rtcp-mux enabled, add it unless we received an offer without it */ + if (session->endpoint->rtcp_mux && session_media->remote_rtcp_mux) { attr = pjmedia_sdp_attr_create(pool, "rtcp-mux", NULL); pjmedia_sdp_attr_add(&media->attr_count, media->attr, attr); } diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index 8eaeb31a7b..ed637cdd52 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -1342,6 +1342,7 @@ static int add_session_media(void *obj, void *arg, int flags) } session_media->encryption = session->endpoint->media.rtp.encryption; session_media->remote_ice = session->endpoint->media.rtp.ice_support; + session_media->remote_rtcp_mux = session->endpoint->rtcp_mux; session_media->keepalive_sched_id = -1; session_media->timeout_sched_id = -1; /* Safe use of strcpy */