[asterisk-commits] phsultan: trunk r85777 - /trunk/channels/chan_jingle.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 16 04:47:23 CDT 2007


Author: phsultan
Date: Tue Oct 16 04:47:22 2007
New Revision: 85777

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85777
Log:
Make an audio path under the following call configuration :
SIP Phone 1 --- [chan_sip]Asterisk 1[chan_jingle] --- [chan_jingle]Asterisk 2[chan_sip] --- SIP Phone 2

Modifications :
- set bridge type to partial ;
- process media candidates from the remote peer properly.

Now we have Jingle audio, at least between two Asterisk Jingle
clients.

Modified:
    trunk/channels/chan_jingle.c

Modified: trunk/channels/chan_jingle.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_jingle.c?view=diff&rev=85777&r1=85776&r2=85777
==============================================================================
--- trunk/channels/chan_jingle.c (original)
+++ trunk/channels/chan_jingle.c Tue Oct 16 04:47:22 2007
@@ -416,7 +416,7 @@
 	ast_mutex_lock(&p->lock);
 	if (p->rtp) {
 		*rtp = p->rtp;
-		res = AST_RTP_TRY_NATIVE;
+		res = AST_RTP_TRY_PARTIAL;
 	}
 	ast_mutex_unlock(&p->lock);
 
@@ -1071,31 +1071,38 @@
 
 	traversenodes = pak->query;
 	while(traversenodes) {
-		if(!strcasecmp(iks_name(traversenodes), "session")) {
+		if(!strcasecmp(iks_name(traversenodes), "jingle")) {
 			traversenodes = iks_child(traversenodes);
 			continue;
 		}
+		if(!strcasecmp(iks_name(traversenodes), "content")) {
+			traversenodes = iks_child(traversenodes);
+			continue;
+		}
+		if(!strcasecmp(iks_name(traversenodes), "transport")) {
+			traversenodes = iks_child(traversenodes);
+			continue;
+		}
+
 		if(!strcasecmp(iks_name(traversenodes), "candidate")) {
 			newcandidate = ast_calloc(1, sizeof(*newcandidate));
 			if (!newcandidate)
 				return 0;
-			ast_copy_string(newcandidate->ip, iks_find_attrib(traversenodes, "address"),
-							sizeof(newcandidate->ip));
+			ast_copy_string(newcandidate->ip, iks_find_attrib(traversenodes, "ip"), sizeof(newcandidate->ip));
 			newcandidate->port = atoi(iks_find_attrib(traversenodes, "port"));
-			ast_copy_string(newcandidate->password, iks_find_attrib(traversenodes, "password"),
-							sizeof(newcandidate->password));
+			ast_copy_string(newcandidate->password, iks_find_attrib(traversenodes, "pwd"), sizeof(newcandidate->password));
 			if (!strcasecmp(iks_find_attrib(traversenodes, "protocol"), "udp"))
 				newcandidate->protocol = AJI_PROTOCOL_UDP;
-			if (!strcasecmp(iks_find_attrib(traversenodes, "protocol"), "ssltcp"))
+			else if (!strcasecmp(iks_find_attrib(traversenodes, "protocol"), "ssltcp"))
 				newcandidate->protocol = AJI_PROTOCOL_SSLTCP;
-		
+			
 			if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "host"))
 				newcandidate->type = AJI_CONNECT_HOST;
-			if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "prflx"))
+			else if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "prflx"))
 				newcandidate->type = AJI_CONNECT_PRFLX;
-			if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "relay"))
+			else if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "relay"))
 				newcandidate->type = AJI_CONNECT_RELAY;
-			if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "srflx"))
+			else if (!strcasecmp(iks_find_attrib(traversenodes, "type"), "srflx"))
 				newcandidate->type = AJI_CONNECT_SRFLX;
 
 			newcandidate->network = atoi(iks_find_attrib(traversenodes, "network"));




More information about the asterisk-commits mailing list