aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-03 21:40:29 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-03 21:40:29 +0000
commitf2bd16e4643ad88ca9e271bd25dd3eccaf9c2245 (patch)
tree044c020104a8fba2736c2f5a7f94803da187d094 /funcs
parentf1abbe7bb1a3afa599b878cf1d9e30831085c952 (diff)
Merged revisions 160760 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r160760 | murf | 2008-12-03 14:09:15 -0700 (Wed, 03 Dec 2008) | 23 lines Merged revisions 160703 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r160703 | murf | 2008-12-03 13:41:42 -0700 (Wed, 03 Dec 2008) | 11 lines (closes issue #13597) Reported by: john8675309 Patches: patch.13597 uploaded by murf (license 17) Tested by: murf, john8675309 This patch causes the setcid func to update the CDR clid after setting the channel field. I also notice that in trunk, the num/number of 1.4 is left out; I decided to include the option to use either in trunk, so as not to have 1.4 upgraders not to have problems. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@160766 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_callerid.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c
index c56089ca2..c237cd20e 100644
--- a/funcs/func_callerid.c
+++ b/funcs/func_callerid.c
@@ -129,24 +129,36 @@ static int callerid_write(struct ast_channel *chan, const char *cmd, char *data,
char name[256];
char num[256];
- ast_callerid_split(value, name, sizeof(name), num, sizeof(num));
- ast_set_callerid(chan, num, name, num);
+ if (!ast_callerid_split(value, name, sizeof(name), num, sizeof(num))) {
+ ast_set_callerid(chan, num, name, num);
+ if (chan->cdr)
+ ast_cdr_setcid(chan->cdr, chan);
+ }
} else if (!strncasecmp("name", data, 4)) {
ast_set_callerid(chan, NULL, value, NULL);
- } else if (!strncasecmp("num", data, 3)) {
+ if (chan->cdr)
+ ast_cdr_setcid(chan->cdr, chan);
+ } else if (!strncasecmp("num", data, 3) ||
+ !strncasecmp("number", data, 6)) {
ast_set_callerid(chan, value, NULL, NULL);
+ if (chan->cdr)
+ ast_cdr_setcid(chan->cdr, chan);
} else if (!strncasecmp("ani", data, 3)) {
if (!strncasecmp(data + 3, "2", 1)) {
chan->cid.cid_ani2 = atoi(value);
} else {
ast_set_callerid(chan, NULL, NULL, value);
}
+ if (chan->cdr)
+ ast_cdr_setcid(chan->cdr, chan);
} else if (!strncasecmp("dnid", data, 4)) {
ast_channel_lock(chan);
if (chan->cid.cid_dnid) {
ast_free(chan->cid.cid_dnid);
}
chan->cid.cid_dnid = ast_strdup(value);
+ if (chan->cdr)
+ ast_cdr_setcid(chan->cdr, chan);
ast_channel_unlock(chan);
} else if (!strncasecmp("rdnis", data, 5)) {
ast_channel_lock(chan);
@@ -154,6 +166,8 @@ static int callerid_write(struct ast_channel *chan, const char *cmd, char *data,
ast_free(chan->cid.cid_rdnis);
}
chan->cid.cid_rdnis = ast_strdup(value);
+ if (chan->cdr)
+ ast_cdr_setcid(chan->cdr, chan);
ast_channel_unlock(chan);
} else if (!strncasecmp("pres", data, 4)) {
int i;