[asterisk-commits] file: branch file/chan_jingle2 r365453 - in /team/file/chan_jingle2: include/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun May 6 09:32:26 CDT 2012


Author: file
Date: Sun May  6 09:32:22 2012
New Revision: 365453

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=365453
Log:
Add Jingle namespaces, increase network buffer size, and differentiate between Google Jingle capable resources and Jingle capable resources.

Modified:
    team/file/chan_jingle2/include/asterisk/jabber.h
    team/file/chan_jingle2/include/asterisk/jingle.h
    team/file/chan_jingle2/res/res_jabber.c

Modified: team/file/chan_jingle2/include/asterisk/jabber.h
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/include/asterisk/jabber.h?view=diff&rev=365453&r1=365452&r2=365453
==============================================================================
--- team/file/chan_jingle2/include/asterisk/jabber.h (original)
+++ team/file/chan_jingle2/include/asterisk/jabber.h Sun May  6 09:32:22 2012
@@ -52,7 +52,7 @@
 
 #endif /* HAVE_OPENSSL */
 /* file is read by blocks with this size */
-#define NET_IO_BUF_SIZE 4096
+#define NET_IO_BUF_SIZE 8192
 /* Return value for timeout connection expiration */
 #define IKS_NET_EXPIRED 12
 
@@ -104,6 +104,7 @@
 struct aji_version {
 	char version[50];
 	int jingle;
+        int google;
 	struct aji_capabilities *parent;
 	struct aji_version *next;
 };

Modified: team/file/chan_jingle2/include/asterisk/jingle.h
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/include/asterisk/jingle.h?view=diff&rev=365453&r1=365452&r2=365453
==============================================================================
--- team/file/chan_jingle2/include/asterisk/jingle.h (original)
+++ team/file/chan_jingle2/include/asterisk/jingle.h Sun May  6 09:32:22 2012
@@ -37,10 +37,10 @@
 #define JINGLE_NODE "jingle"
 #define GOOGLE_NODE "session"
 
-#define JINGLE_NS "urn:xmpp:tmp:jingle"
-#define JINGLE_AUDIO_RTP_NS "urn:xmpp:tmp:jingle:apps:audio-rtp"
-#define JINGLE_VIDEO_RTP_NS "urn:xmpp:tmp:jingle:apps:video"
-#define JINGLE_ICE_UDP_NS "urn:xmpp:tmp:jingle:transports:ice-udp"
+#define JINGLE_NS "urn:xmpp:jingle:1"
+#define JINGLE_AUDIO_RTP_NS "urn:xmpp:jingle:apps:rtp:1"
+#define JINGLE_VIDEO_RTP_NS "urn:xmpp:jingle:apps:rtp:1"
+#define JINGLE_ICE_UDP_NS "http://www.google.com/transport/p2p"
 #define JINGLE_DTMF_NS "urn:xmpp:tmp:jingle:dtmf"
 
 #define GOOGLE_NS "http://www.google.com/session"

Modified: team/file/chan_jingle2/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/team/file/chan_jingle2/res/res_jabber.c?view=diff&rev=365453&r1=365452&r2=365453
==============================================================================
--- team/file/chan_jingle2/res/res_jabber.c (original)
+++ team/file/chan_jingle2/res/res_jabber.c Sun May  6 09:32:22 2012
@@ -510,6 +510,7 @@
 					return NULL;
 				}
 				res->jingle = 0;
+				res->google = 0;
 				res->parent = list;
 				ast_copy_string(res->version, version, sizeof(res->version));
 				res->next = list->versions;
@@ -535,6 +536,7 @@
 		ast_copy_string(list->node, node, sizeof(list->node));
 		ast_copy_string(res->version, version, sizeof(res->version));
 		res->jingle = 0;
+		res->google = 0;
 		res->parent = list;
 		res->next = NULL;
 		list->versions = res;
@@ -2055,18 +2057,20 @@
 			ASTOBJ_UNREF(client, ast_aji_client_destroy);
 			return IKS_FILTER_EAT;
 		}
-		if (iks_find_with_attrib(pak->query, "feature", "var", "http://www.google.com/xmpp/protocol/voice/v1")) {
+		if (iks_find_with_attrib(pak->query, "feature", "var", "urn:xmpp:jingle:1")) {
 			resource->cap->jingle = 1;
-		} else {
-			resource->cap->jingle = 0;
 		}
 	} else if (pak->subtype == IKS_TYPE_GET) {
-		iks *iq, *disco, *ident, *google, *query;
+		iks *iq, *disco, *ident, *google, *jingle, *ice, *rtp, *audio, *query;
 		iq = iks_new("iq");
 		query = iks_new("query");
 		ident = iks_new("identity");
 		disco = iks_new("feature");
 		google = iks_new("feature");
+		jingle = iks_new("feature");
+		ice = iks_new("feature");
+		rtp = iks_new("feature");
+		audio = iks_new("feature");
 		if (iq && ident && disco && google) {
 			iks_insert_attrib(iq, "from", client->jid->full);
 			iks_insert_attrib(iq, "to", pak->from->full);
@@ -2078,10 +2082,18 @@
 			iks_insert_attrib(ident, "name", "asterisk");
 			iks_insert_attrib(disco, "var", "http://jabber.org/protocol/disco#info");
 			iks_insert_attrib(google, "var", "http://www.google.com/xmpp/protocol/voice/v1");
+			iks_insert_attrib(jingle, "var", "urn:xmpp:jingle:1");
+			iks_insert_attrib(ice, "var", "urn:xmpp:jingle:transports:ice-udp:1");
+			iks_insert_attrib(rtp, "var", "urn:xmpp:jingle:apps:rtp:1");
+			iks_insert_attrib(audio, "var", "urn:xmpp:jingle:apps:rtp:audio");
 			iks_insert_node(iq, query);
 			iks_insert_node(query, ident);
 			iks_insert_node(query, google);
 			iks_insert_node(query, disco);
+			iks_insert_node(query, jingle);
+			iks_insert_node(query, ice);
+			iks_insert_node(query, rtp);
+			iks_insert_node(query, audio);
 			ast_aji_send(client, iq);
 		} else {
 			ast_log(LOG_ERROR, "Out of Memory.\n");
@@ -2128,9 +2140,7 @@
 			return IKS_FILTER_EAT;
 		}
 		if (iks_find_with_attrib(pak->query, "feature", "var", "http://www.google.com/xmpp/protocol/voice/v1")) {
-			resource->cap->jingle = 1;
-		} else {
-			resource->cap->jingle = 0;
+			resource->cap->google = 1;
 		}
 	} else if (pak->subtype == IKS_TYPE_GET && !(node = iks_find_attrib(pak->query, "node"))) {
 		iks *iq, *query, *identity, *disco, *reg, *commands, *gateway, *version, *vcard, *search;
@@ -2499,7 +2509,7 @@
 	if (status != 6 && found && !found->cap) {
 		found->cap = aji_find_version(node, ver, pak);
 		if (gtalk_yuck(pak->x)) { /* gtalk should do discover */
-			found->cap->jingle = 1;
+			found->cap->google = 1;
 		}
 		if (found->cap->jingle) {
 			ast_debug(1, "Special case for google till they support discover.\n");
@@ -4227,6 +4237,7 @@
 					ast_cli(a->fd, "\t\t\tnode: %s\n", resource->cap->parent->node);
 					ast_cli(a->fd, "\t\t\tversion: %s\n", resource->cap->version);
 					ast_cli(a->fd, "\t\t\tJingle capable: %s\n", resource->cap->jingle ? "yes" : "no");
+					ast_cli(a->fd, "\t\t\tGoogle capable: %s\n", resource->cap->google ? "yes" : "no");
 				}
 				ast_cli(a->fd, "\t\tStatus: %d\n", resource->status);
 				ast_cli(a->fd, "\t\tPriority: %d\n", resource->priority);




More information about the asterisk-commits mailing list