diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-24 14:48:55 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-24 14:48:55 +0000 |
commit | 05e1d7488419cf4b60befb81b4573ab3466996eb (patch) | |
tree | 6cb21443778ab457d59206dbb498c4f37292c0e0 /channels/chan_gtalk.c | |
parent | f606c6a7d0980589ea30b6d26af03dacd22b7c1c (diff) |
Issue #8536 - Caller ID not set in CDR for jingle
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@65841 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_gtalk.c')
-rw-r--r-- | channels/chan_gtalk.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c index b70ebd4b0..99db21d1d 100644 --- a/channels/chan_gtalk.c +++ b/channels/chan_gtalk.c @@ -894,6 +894,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; @@ -954,9 +955,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; |