aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_gtalk.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 14:52:01 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-24 14:52:01 +0000
commitf632d1feb7a5e48febec55322bb0bda16106c224 (patch)
treeba8cc6eafc7c0f4bf9c89fdb79b0ce7862108e28 /channels/chan_gtalk.c
parent32977d176e0efa96c293ac257c062a995d4bb947 (diff)
Merged revisions 65841 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r65841 | oej | 2007-05-24 16:48:55 +0200 (Thu, 24 May 2007) | 2 lines Issue #8536 - Caller ID not set in CDR for jingle ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@65844 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_gtalk.c')
-rw-r--r--channels/chan_gtalk.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c
index 8c4a27bdb..58567a497 100644
--- a/channels/chan_gtalk.c
+++ b/channels/chan_gtalk.c
@@ -899,6 +899,7 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i,
int fmt;
int what;
const char *n2;
+ char *data = NULL, *cid = NULL;
if (title)
n2 = title;
@@ -964,9 +965,21 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i,
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;