[asterisk-commits] file: branch 11 r374850 - in /branches/11: channels/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 11 11:02:33 CDT 2012


Author: file
Date: Thu Oct 11 11:02:31 2012
New Revision: 374850

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=374850
Log:
Fix an issue where outgoing calls would fail to establish audio due to ICE negotiation failures.

This change removes the requirement for ufrag and pwd in the transport stanza and also
makes us the controlling agent.

Modified:
    branches/11/channels/chan_motif.c
    branches/11/res/res_rtp_asterisk.c

Modified: branches/11/channels/chan_motif.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_motif.c?view=diff&rev=374850&r1=374849&r2=374850
==============================================================================
--- branches/11/channels/chan_motif.c (original)
+++ branches/11/channels/chan_motif.c Thu Oct 11 11:02:31 2012
@@ -1729,6 +1729,7 @@
 	struct jingle_session *session;
 	struct ast_channel *chan;
 	enum jingle_transport transport = JINGLE_TRANSPORT_NONE;
+	struct ast_rtp_engine_ice *ice;
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(name);
 			     AST_APP_ARG(target);
@@ -1832,6 +1833,15 @@
 		jingle_enable_video(session);
 	}
 
+	/* As this is outgoing set ourselves as controlling */
+	if (session->rtp && (ice = ast_rtp_instance_get_ice(session->rtp))) {
+		ice->ice_lite(session->rtp);
+	}
+
+	if (session->vrtp && (ice = ast_rtp_instance_get_ice(session->vrtp))) {
+		ice->ice_lite(session->vrtp);
+	}
+
 	/* We purposely don't decrement the session here as there is a reference on the channel */
 	ao2_link(endpoint->state->sessions, session);
 
@@ -1939,13 +1949,9 @@
 		return -1;
 	}
 
-	if (ast_strlen_zero(ufrag) || ast_strlen_zero(pwd)) {
-		jingle_queue_hangup_with_cause(session, AST_CAUSE_PROTOCOL_ERROR);
-		ast_log(LOG_ERROR, "Invalid ICE-UDP transport information received on session '%s', ufrag or pwd not present\n", session->sid);
-		return -1;
-	}
-
-	ice->set_authentication(rtp, ufrag, pwd);
+	if (!ast_strlen_zero(ufrag) && !ast_strlen_zero(pwd)) {
+		ice->set_authentication(rtp, ufrag, pwd);
+	}
 
 	for (candidate = iks_child(transport); candidate; candidate = iks_next(candidate)) {
 		char *component = iks_find_attrib(candidate, "component"), *foundation = iks_find_attrib(candidate, "foundation");

Modified: branches/11/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/res/res_rtp_asterisk.c?view=diff&rev=374850&r1=374849&r2=374850
==============================================================================
--- branches/11/res/res_rtp_asterisk.c (original)
+++ branches/11/res/res_rtp_asterisk.c Thu Oct 11 11:02:31 2012
@@ -535,6 +535,8 @@
 	}
 
 	ao2_iterator_destroy(&i);
+
+	ast_log(LOG_NOTICE, "ufrag = %s password = %s\n", rtp->remote_ufrag, rtp->remote_passwd);
 
 	if (pj_ice_sess_create_check_list(rtp->ice, &ufrag, &passwd, ao2_container_count(rtp->remote_candidates), &candidates[0]) == PJ_SUCCESS) {
 		pj_ice_sess_start_check(rtp->ice);
@@ -4432,7 +4434,7 @@
 {
 	pj_lock_t *lock;
 
-	pj_log_set_level(0);
+//	pj_log_set_level(0);
 
 	if (pj_init() != PJ_SUCCESS) {
 		return AST_MODULE_LOAD_DECLINE;




More information about the asterisk-commits mailing list