Skip to content

Instantly share code, notes, and snippets.

@monossido
Created February 2, 2012 20:04
Show Gist options
  • Save monossido/1725447 to your computer and use it in GitHub Desktop.
Save monossido/1725447 to your computer and use it in GitHub Desktop.
XMPP-to-SIP with Android Gtalk client (that creates mess with tags) - Outgoing calls
--- chan_gtalk1.8-mio-final.c 2012-02-03 11:31:42.754279386 +0100
+++ chan_gtalk1.8-mio-final2.c 2012-02-02 21:02:02.874390985 +0100
@@ -610,14 +610,22 @@ static int gtalk_is_answered(struct gtal
iks *codec;
char s1[BUFSIZ], s2[BUFSIZ], s3[BUFSIZ];
int peernoncodeccapability;
+ iks *tmp2;
ast_log(LOG_DEBUG, "The client is %s\n", client->name);
+ if (!strcasecmp(iks_name(pak->query), "jin:jingle") && (tmp2 = iks_next(pak->query)) && !strcasecmp(iks_name(tmp2), "ses:session")) {
+ ast_debug(1, "New method detected. Skipping jingle offer and using old gtalk method.\n");
+ pak->query = tmp2;
+ }else if (!strcasecmp(iks_name(pak->query), "jingle") && (tmp2 = iks_next(pak->query)) && !strcasecmp(iks_name(tmp2), "session")) {
+ ast_debug(1, "New method detected. Skipping jingle offer and using old gtalk method.\n");
+ pak->query = tmp2;
+ }
/* Make sure our new call does exist */
for (tmp = client->p; tmp; tmp = tmp->next) {
- if (iks_find_with_attrib(pak->x, "session", "id", tmp->sid)) {
+ if (iks_find_with_attrib(pak->x, "session", "id", tmp->sid) || iks_find_with_attrib(pak->query, "session", "id", tmp->sid)) {
break;
- } else if (iks_find_with_attrib(pak->x, "ses:session", "id", tmp->sid)) {
+ } else if (iks_find_with_attrib(pak->x, "ses:session", "id", tmp->sid) || iks_find_with_attrib(pak->query, "ses:session", "id", tmp->sid)) {
break;
}
}
@shadyelashi1984
Copy link

Hi Monossido, i have been struggling to find out how to deploy the code you specified above. I have the same problem on my Asterisk box but i have no idea how to deploy the fix you showed above. Can you please give more details?

As I understand, i need to change the chan_gtalk.so file but i am not able to edit it using the linux "vi" command. What should i do? Please help as i am not able to find any details about this.

thanks,

Shady

@yuvrajkc
Copy link

It still doesn't work.

Here is the error I get when I try to call from gtalk(Android) to a gmail account registered in asterisk.

[2013-03-15 08:35:51] NOTICE[29320]: chan_gtalk.c:2008 gtalk_parser: No attribute "type" found. Ignoring message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment