(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.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Steve Murphy
2008-12-03 20:41:42 +00:00
parent e616d516e3
commit ba6d2c67ac

View File

@@ -121,26 +121,39 @@ static int callerid_write(struct ast_channel *chan, char *cmd, char *data,
char name[256];
char num[256];
if (!ast_callerid_split(value, name, sizeof(name), num, sizeof(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);
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)) {
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)
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);
if (chan->cid.cid_rdnis)
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 {
ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);