[Asterisk-code-review] res rtp asterisk: Use RTP component for ICE if RTCP-MUX is i... (asterisk[14])

Jenkins2 asteriskteam at digium.com
Mon Jul 17 15:01:31 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/6027 )

Change subject: res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use.
......................................................................

res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use.

This change makes it so that if an RTCP packet is being sent
the RTP ICE component is used for sending if RTCP-MUX is in use.

ASTERISK-27133

Change-Id: I6200f611ede709602ee9b89501720c29545ed68b
---
M res/res_rtp_asterisk.c
1 file changed, 7 insertions(+), 2 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Matthew Fredrickson: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 2a2fbf7..ea47423 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -2587,8 +2587,14 @@
 
 #ifdef HAVE_PJPROJECT
 	if (rtp->ice) {
+		enum ast_rtp_ice_component_type component = rtcp ? AST_RTP_ICE_COMPONENT_RTCP : AST_RTP_ICE_COMPONENT_RTP;
 		pj_status_t status;
 		struct ice_wrap *ice;
+
+		/* If RTCP is sharing the same socket then use the same component */
+		if (rtcp && rtp->rtcp->s == rtp->s) {
+			component = AST_RTP_ICE_COMPONENT_RTP;
+		}
 
 		pj_thread_register_check();
 
@@ -2596,8 +2602,7 @@
 		ice = rtp->ice;
 		ao2_ref(ice, +1);
 		ao2_unlock(instance);
-		status = pj_ice_sess_send_data(ice->real_ice,
-			rtcp ? AST_RTP_ICE_COMPONENT_RTCP : AST_RTP_ICE_COMPONENT_RTP, temp, len);
+		status = pj_ice_sess_send_data(ice->real_ice, component, temp, len);
 		ao2_ref(ice, -1);
 		ao2_lock(instance);
 		if (status == PJ_SUCCESS) {

-- 
To view, visit https://gerrit.asterisk.org/6027
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-MessageType: merged
Gerrit-Change-Id: I6200f611ede709602ee9b89501720c29545ed68b
Gerrit-Change-Number: 6027
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170717/dd670bf3/attachment.html>


More information about the asterisk-code-review mailing list