[asterisk-commits] dvossel: branch dvossel/gtalk_fixup r290970 - /team/dvossel/gtalk_fixup/chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 8 14:38:54 CDT 2010


Author: dvossel
Date: Fri Oct  8 14:38:51 2010
New Revision: 290970

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=290970
Log:
We can make gv calls from asterisk

Modified:
    team/dvossel/gtalk_fixup/channels/chan_gtalk.c

Modified: team/dvossel/gtalk_fixup/channels/chan_gtalk.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/gtalk_fixup/channels/chan_gtalk.c?view=diff&rev=290970&r1=290969&r2=290970
==============================================================================
--- team/dvossel/gtalk_fixup/channels/chan_gtalk.c (original)
+++ team/dvossel/gtalk_fixup/channels/chan_gtalk.c Fri Oct  8 14:38:51 2010
@@ -97,6 +97,8 @@
 	AJI_CLIENT_UNKNOWN,
 	AJI_CLIENT_GTALK,		/*!< Remote client type is GoogleTalk */
 	AJI_CLIENT_GMAIL,		/*!< Remote client type is Gmail */
+	AJI_CLIENT_GOOGLE_VOICE,/*!< Remote client type is Google Voice*/
+
 };
 
 struct gtalk_pvt {
@@ -440,7 +442,9 @@
 	iks_insert_attrib(gtalk, "id", sid);
 	iks_insert_node(iq, gtalk);
 	iks_insert_node(gtalk, dcodecs);
-	iks_insert_node(gtalk, transport);
+	if (p->ctype != AJI_CLIENT_GOOGLE_VOICE) {
+		iks_insert_node(gtalk, transport);
+	}
 	iks_insert_node(dcodecs, payload_telephone);
 
 	ast_aji_send(client->connection, iq);
@@ -948,6 +952,7 @@
 	char idroster[200];
 	char *data, *exten = NULL;
 	struct ast_sockaddr bindaddr_tmp;
+	enum gtalk_client_type ctype = AJI_CLIENT_UNKNOWN;
 
 	ast_debug(1, "The client is %s for alloc\n", client->name);
 	if (!sid && !strchr(them, '/')) {	/* I started call! */
@@ -968,6 +973,12 @@
 		}
 		if (resources) {
 			snprintf(idroster, sizeof(idroster), "%s/%s", them, resources->resource);
+			if (strstr(resources->resource, "gmail")) {
+				ctype = AJI_CLIENT_GMAIL;
+			}
+		} else if (strstr(them, "@voice.google.com")) {
+			snprintf(idroster, sizeof(idroster), "%s/srvres", them);
+			ctype = AJI_CLIENT_GOOGLE_VOICE;
 		} else {
 			ast_log(LOG_ERROR, "no gtalk capable clients to talk to.\n");
 			return NULL;
@@ -977,7 +988,7 @@
 		return NULL;
 	}
 	/* set client type to unknown until we have more info */
-	tmp->ctype = AJI_CLIENT_UNKNOWN;
+	tmp->ctype = ctype;
 
 	memcpy(&tmp->prefs, &client->prefs, sizeof(struct ast_codec_pref));
 




More information about the asterisk-commits mailing list