]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res/res_pjsip_sdp_rtp: put rtcp-mux in answer only if offered
authorTorrey Searle <torrey@voxbone.com>
Thu, 9 Aug 2018 07:34:17 +0000 (09:34 +0200)
committerTorrey Searle <torrey@voxbone.com>
Thu, 16 Aug 2018 06:57:46 +0000 (08:57 +0200)
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
res/res_pjsip_session.c

index 4e759acb11ad53ddf633c3a07b0d1a28ce5e644f..279715d24a1ff3af27e0d1410f1c4fac3ad90438 100644 (file)
@@ -1796,8 +1796,8 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
        attr->name = !session_media->locally_held ? STR_SENDRECV : STR_SENDONLY;
        media->attr[media->attr_count++] = attr;
 
-       /* If we've got rtcp-mux enabled, just unconditionally offer it in all SDPs */
-       if (session->endpoint->media.rtcp_mux) {
+       /* If we've got rtcp-mux enabled, add it unless we received an offer without it */
+       if (session->endpoint->media.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);
        }
index 81e7a55f9f5c8ceccc52070fbe18796b22b7f72c..d52009ea61c553413d37b0f5a91ce9b19d2b46ea 100644 (file)
@@ -446,6 +446,7 @@ struct ast_sip_session_media *ast_sip_session_media_state_add(struct ast_sip_ses
 
                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->media.rtcp_mux;
                session_media->keepalive_sched_id = -1;
                session_media->timeout_sched_id = -1;
                session_media->type = type;