diff options
author | David Vossel <dvossel@digium.com> | 2010-10-05 22:01:52 +0000 |
---|---|---|
committer | David Vossel <dvossel@digium.com> | 2010-10-05 22:01:52 +0000 |
commit | 268ae2e8d5e3920dd398569f4411c37f490b6183 (patch) | |
tree | c69b98b3a5cfa0cdafa1e292f46fa254ba02f619 /res/res_jabber.c | |
parent | 096d16f3bb2e866a04ae46ab1b0cd26f449af12b (diff) |
Merged revisions 290479 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r290479 | dvossel | 2010-10-05 17:00:43 -0500 (Tue, 05 Oct 2010) | 6 lines
Fixes chan_gtalk to work with gmail client
This patch was written by Philippe Sultan (phsultan). Thanks
for keeping this up to date!
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r-- | res/res_jabber.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c index ccf9d3d30..6b737e70b 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -569,8 +569,16 @@ static struct aji_resource *aji_find_resource(struct aji_buddy *buddy, char *nam static int gtalk_yuck(iks *node) { if (iks_find_with_attrib(node, "c", "node", "http://www.google.com/xmpp/client/caps")) { + ast_debug(1, "Found resource with Googletalk voice capabilities\n"); + return 1; + } 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; } @@ -1577,6 +1585,23 @@ static int aji_act_hook(void *data, int type, iks *node) pak = iks_packet(node); + /* work around iksemel's impossibility to recognize node names + * containing a semicolon. Set the namespace of the corresponding + * node accordingly. */ + if (iks_has_children(node) && strchr(iks_name(iks_child(node)), ':')) { + char *node_ns = NULL; + char attr[AJI_MAX_ATTRLEN]; + char *node_name = iks_name(iks_child(node)); + char *aux = strchr(node_name, ':') + 1; + snprintf(attr, strlen("xmlns:") + (strlen(node_name) - strlen(aux)), "xmlns:%s", node_name); + node_ns = iks_find_attrib(iks_child(node), attr); + if (node_ns) { + pak->ns = node_ns; + pak->query = iks_child(node); + } + } + + if (!client->component) { /*client */ switch (type) { case IKS_NODE_START: @@ -2405,7 +2430,7 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak) if (gtalk_yuck(pak->x)) { /* gtalk should do discover */ found->cap->jingle = 1; } - if (found->cap->jingle && option_debug > 4) { + if (found->cap->jingle) { ast_debug(1, "Special case for google till they support discover.\n"); } else { iks *iq, *query; |