[svn-commits] oej: branch 1.4 r65841 - /branches/1.4/channels/chan_gtalk.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu May 24 07:48:55 MST 2007


Author: oej
Date: Thu May 24 09:48:55 2007
New Revision: 65841

URL: http://svn.digium.com/view/asterisk?view=rev&rev=65841
Log:
Issue #8536 - Caller ID not set in CDR for jingle

Modified:
    branches/1.4/channels/chan_gtalk.c

Modified: branches/1.4/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_gtalk.c?view=diff&rev=65841&r1=65840&r2=65841
==============================================================================
--- branches/1.4/channels/chan_gtalk.c (original)
+++ branches/1.4/channels/chan_gtalk.c Thu May 24 09:48:55 2007
@@ -894,6 +894,7 @@
 	int fmt;
 	int what;
 	const char *n2;
+	char *data = NULL, *cid = NULL;
 
 	if (title)
 		n2 = title;
@@ -954,9 +955,21 @@
 	ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
 	/* Don't use ast_set_callerid() here because it will
 	 * generate a needless NewCallerID event */
-	tmp->cid.cid_num = ast_strdup(i->cid_num);
-	tmp->cid.cid_ani = ast_strdup(i->cid_num);
-	tmp->cid.cid_name = ast_strdup(i->cid_name);
+	if (!strcasecmp(client->name, "guest")) {
+		if (strchr(i->them, '/')) {
+			char *aux;
+			data = ast_strdupa((char *)i->them);
+			aux = data;
+			cid = strsep(&aux, "/");
+		} else
+			cid = i->them;
+	} else {
+		cid = client->user;
+	}
+	cid = strsep(&cid, "@");
+	tmp->cid.cid_num = ast_strdup(cid);
+	tmp->cid.cid_ani = ast_strdup(cid);
+	tmp->cid.cid_name = ast_strdup(i->them);
 	if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
 		tmp->cid.cid_dnid = ast_strdup(i->exten);
 	tmp->priority = 1;



More information about the svn-commits mailing list