mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-03 12:25:35 +00:00
Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229 ABE-2161 * Ensure chan_local.c:local_call() will not leak cid.cid_dnid when copying. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -209,8 +209,8 @@ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data,
|
||||
}
|
||||
}
|
||||
} else if (!strncasecmp("rdnis", data, 5)) {
|
||||
if (chan->cid.cid_rdnis) {
|
||||
ast_copy_string(buf, chan->cid.cid_rdnis, len);
|
||||
if (chan->redirecting.from.number) {
|
||||
ast_copy_string(buf, chan->redirecting.from.number, len);
|
||||
}
|
||||
} else if (!strncasecmp("pres", data, 4)) {
|
||||
ast_copy_string(buf, ast_named_caller_presentation(chan->cid.cid_pres), len);
|
||||
@@ -311,10 +311,8 @@ static int callerid_write(struct ast_channel *chan, const char *cmd, char *data,
|
||||
ast_channel_unlock(chan);
|
||||
} else if (!strncasecmp("rdnis", data, 5)) {
|
||||
ast_channel_lock(chan);
|
||||
if (chan->cid.cid_rdnis) {
|
||||
ast_free(chan->cid.cid_rdnis);
|
||||
}
|
||||
chan->cid.cid_rdnis = ast_strdup(value);
|
||||
ast_free(chan->redirecting.from.number);
|
||||
chan->redirecting.from.number = ast_strdup(value);
|
||||
if (chan->cdr) {
|
||||
ast_cdr_setcid(chan->cdr, chan);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user