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

Thomas Guebels asteriskteam at digium.com
Mon Feb 19 04:33:55 CST 2018


Thomas Guebels has uploaded this change for review. ( https://gerrit.asterisk.org/8262


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/62/8262/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 263dbff..76f5b09 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1011,6 +1011,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/8262
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5dbc69ad63cacbb067922850fbb113d479bd729c
Gerrit-Change-Number: 8262
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Guebels <tgu at escaux.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180219/536eb6e3/attachment.html>


More information about the asterisk-code-review mailing list