[Asterisk-code-review] res/res pjsip sdp rtp: put rtcp-mux in answer only if offered (asterisk[15])

Torrey Searle asteriskteam at digium.com
Thu Aug 16 02:00:55 CDT 2018


Torrey Searle has uploaded this change for review. ( https://gerrit.asterisk.org/9890


Change subject: res/res_pjsip_sdp_rtp:  put rtcp-mux in answer only if offered
......................................................................

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
---
M res/res_pjsip_sdp_rtp.c
M res/res_pjsip_session.c
2 files changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/9890/1

diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 4e759ac..279715d 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1796,8 +1796,8 @@
 	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);
 	}
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 81e7a55..d52009e 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -446,6 +446,7 @@
 
 		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;

-- 
To view, visit https://gerrit.asterisk.org/9890
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: I58e9b9f40a139afc0da5de41906cc608fb62adc7
Gerrit-Change-Number: 9890
Gerrit-PatchSet: 1
Gerrit-Owner: Torrey Searle <tsearle at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180816/dd29cc68/attachment.html>


More information about the asterisk-code-review mailing list