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

Joshua Colp asteriskteam at digium.com
Sun Jul 16 12:26:37 CDT 2017


Joshua Colp has uploaded this change for review. ( https://gerrit.asterisk.org/6028


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/6028/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 9d3969f..a2e63ec 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -2650,8 +2650,14 @@
 
 #ifdef HAVE_PJPROJECT
 	if (transport_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();
 
@@ -2661,8 +2667,7 @@
 		if (instance == transport) {
 			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);
 		if (instance == transport) {
 			ao2_lock(instance);

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6200f611ede709602ee9b89501720c29545ed68b
Gerrit-Change-Number: 6028
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170716/9522912c/attachment.html>


More information about the asterisk-code-review mailing list