[Asterisk-code-review] res rtp asterisk: Fix ICE candidate nomination (asterisk[master])

Joshua Colp asteriskteam at digium.com
Mon Feb 19 07:38:03 CST 2018


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


Change subject: res_rtp_asterisk: Fix ICE candidate nomination
......................................................................

res_rtp_asterisk: Fix ICE candidate nomination

If the ICE role is not set right away, we might have a role conflict
that stays undetected and ICE finishing with successful tests and no
candidate nominated. This was introduced by ASTERISK-27088.

To avoid this, we set the role as soon as before but only if the ICE
state permits it: still checking and not yet nominating candidates or
completed.

ASTERISK-27646

Change-Id: I5dbc69ad63cacbb067922850fbb113d479bd729c
---
M res/res_rtp_asterisk.c
1 file changed, 9 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/8265/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 913fbad..d3273b4 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1036,6 +1036,15 @@
 	}
 
 	rtp->role = role;
+
+	if (!rtp->ice->real_ice->is_nominating && !rtp->ice->real_ice->is_complete) {
+		pj_thread_register_check();
+
+		pj_ice_sess_change_role(rtp->ice->real_ice, role == AST_RTP_ICE_ROLE_CONTROLLED ?
+			PJ_ICE_SESS_ROLE_CONTROLLED : PJ_ICE_SESS_ROLE_CONTROLLING);
+	} else {
+		ast_debug(3, "Not setting ICE role because state is %s\n", rtp->ice->real_ice->is_nominating ? "nominating" : "complete" );
+	}
 }
 
 /*! \pre instance is locked */

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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5dbc69ad63cacbb067922850fbb113d479bd729c
Gerrit-Change-Number: 8265
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Thomas Guebels <tgu at escaux.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180219/f591384e/attachment.html>


More information about the asterisk-code-review mailing list