[asterisk-commits] phsultan: branch phsultan/gmail-voice-video r241501 - in /team/phsultan/gmail...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 20 04:29:13 CST 2010


Author: phsultan
Date: Wed Jan 20 04:29:12 2010
New Revision: 241501

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=241501
Log:
Fix video client detection and session handling.

Gmail video clients without camera must be detected as such, and session
xml attributes must be handled properly.

(issue #13971)
Reported by: adriavidal
Patches:
      chan_gtalk.c.1.6.1.gtalk-web.c.patch uploaded by jcovert (license 551)
      jabber.h.1.6.1.gtalk-web.h.patch uploaded by jcovert (license 551)
      res_jabber.c.1.6.1.gtalk-web.c.patch uploaded by jcovert (license 551)


Modified:
    team/phsultan/gmail-voice-video/channels/chan_gtalk.c
    team/phsultan/gmail-voice-video/res/res_jabber.c

Modified: team/phsultan/gmail-voice-video/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/phsultan/gmail-voice-video/channels/chan_gtalk.c?view=diff&rev=241501&r1=241500&r2=241501
==============================================================================
--- team/phsultan/gmail-voice-video/channels/chan_gtalk.c (original)
+++ team/phsultan/gmail-voice-video/channels/chan_gtalk.c Wed Jan 20 04:29:12 2010
@@ -609,12 +609,25 @@
 	iks *codec;
 	char s1[BUFSIZ], s2[BUFSIZ], s3[BUFSIZ];
 	int peernoncodeccapability;
+	char *ses, *seses[] = {"session", "ses:session", 0};
 
 	ast_log(LOG_DEBUG, "The client is %s\n", client->name);
 	/* Make sure our new call doesn't exist yet */
-	for (tmp = client->p; tmp; tmp = tmp->next) {
-		if (iks_find_with_attrib(pak->x, "session", "id", tmp->sid))
+	for (ses = seses[0] ; ses ; ses++) {
+		for (tmp = client->p; tmp; tmp = tmp->next) {
+			if (iks_find_with_attrib(pak->x, ses, "id", tmp->sid)) {
+				break;
+			}
+		}
+
+		if (tmp != 0) {
 			break;
+		}
+	}
+
+	if (tmp == 0) {
+		ast_log(LOG_WARNING, "Could not find session in iq\n");
+		return -1;
 	}
 
 	/* codec points to the first <payload-type/> tag */

Modified: team/phsultan/gmail-voice-video/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/team/phsultan/gmail-voice-video/res/res_jabber.c?view=diff&rev=241501&r1=241500&r2=241501
==============================================================================
--- team/phsultan/gmail-voice-video/res/res_jabber.c (original)
+++ team/phsultan/gmail-voice-video/res/res_jabber.c Wed Jan 20 04:29:12 2010
@@ -524,7 +524,11 @@
 	} else if (iks_find_with_attrib(node, "caps:c", "ext", "pmuc-v1 sms-v1 camera-v1 video-v1 voice-v1")) {
 		ast_debug(1, "Found resource with Gmail voice/video chat capabilities\n");
 		return 1;
-	}
+	} else if (iks_find_with_attrib(node, "caps:c", "ext", "pmuc-v1 sms-v1 video-v1 voice-v1")) {
+		ast_debug(1, "Found resource with Gmail voice/video chat capabilities (no camera)\n");
+		return 1;
+	}
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list