[asterisk-commits] dvossel: branch dvossel/gtalk_fixup r291358 - /team/dvossel/gtalk_fixup/chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 12 15:23:29 CDT 2010


Author: dvossel
Date: Tue Oct 12 15:23:27 2010
New Revision: 291358

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=291358
Log:
Fix asterisk to asterisk gtalk calls to have two way audio.

Modified:
    team/dvossel/gtalk_fixup/channels/chan_gtalk.c

Modified: team/dvossel/gtalk_fixup/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/gtalk_fixup/channels/chan_gtalk.c?view=diff&rev=291358&r1=291357&r2=291358
==============================================================================
--- team/dvossel/gtalk_fixup/channels/chan_gtalk.c (original)
+++ team/dvossel/gtalk_fixup/channels/chan_gtalk.c Tue Oct 12 15:23:27 2010
@@ -840,8 +840,8 @@
 	if (p->ctype == AJI_CLIENT_GMAIL) {
 		iks_insert_node(gtalk,candidate);
 	} else {
+		iks_insert_node(gtalk,candidate);
 		iks_insert_node(gtalk,transport);
-		iks_insert_node(gtalk,candidate);
 	}
 
 	for (; p; p = p->next) {
@@ -1028,6 +1028,7 @@
 	  return NULL;
 	}
 	ast_rtp_instance_set_prop(tmp->rtp, AST_RTP_PROPERTY_RTCP, 1);
+	ast_rtp_instance_set_prop(tmp->rtp, AST_RTP_PROPERTY_STUN, 1);
 	ast_rtp_instance_set_prop(tmp->rtp, AST_RTP_PROPERTY_DTMF, 1);
 	ast_rtp_instance_dtmf_mode_set(tmp->rtp, AST_RTP_DTMF_MODE_RFC2833);
 	ast_rtp_codecs_payloads_clear(ast_rtp_instance_get_codecs(tmp->rtp), tmp->rtp);
@@ -1091,19 +1092,18 @@
 		what = global_capability;
 
 	/* Set Frame packetization */
-	if (i->rtp)
+	if (i->rtp) {
 		ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(i->rtp), i->rtp, &i->prefs);
+	}
 
 	tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | (i->jointcapability & AST_FORMAT_VIDEO_MASK);
 	fmt = ast_best_codec(tmp->nativeformats);
 
 	if (i->rtp) {
-		ast_rtp_instance_set_prop(i->rtp, AST_RTP_PROPERTY_STUN, 1);
 		ast_channel_set_fd(tmp, 0, ast_rtp_instance_fd(i->rtp, 0));
 		ast_channel_set_fd(tmp, 1, ast_rtp_instance_fd(i->rtp, 1));
 	}
 	if (i->vrtp) {
-		ast_rtp_instance_set_prop(i->vrtp, AST_RTP_PROPERTY_STUN, 1);
 		ast_channel_set_fd(tmp, 2, ast_rtp_instance_fd(i->vrtp, 0));
 		ast_channel_set_fd(tmp, 3, ast_rtp_instance_fd(i->vrtp, 1));
 	}
@@ -1468,10 +1468,6 @@
 			traversenodes = iks_child(traversenodes);
 			continue;
 		}
-		if(!strcasecmp(iks_name(traversenodes), "transport")) {
-			traversenodes = iks_first_tag(traversenodes);
-			continue;
-		}
 		if(!strcasecmp(iks_name(traversenodes), "candidate") || !strcasecmp(iks_name(traversenodes), "ses:candidate")) {
 			newcandidate = ast_calloc(1, sizeof(*newcandidate));
 			if (!newcandidate)
@@ -1864,9 +1860,9 @@
 
 	ASTOBJ_WRLOCK(client);
 	p = gtalk_alloc(client, strchr(sender, '@') ? sender : client->connection->jid->full, strchr(to, '@') ? to : client->user, NULL);
-	if (p)
+	if (p) {
 		chan = gtalk_new(client, p, AST_STATE_DOWN, to, requestor ? requestor->linkedid : NULL);
-
+	}
 	ASTOBJ_UNLOCK(client);
 	return chan;
 }




More information about the asterisk-commits mailing list