summaryrefslogtreecommitdiff
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2010-08-09 20:46:50 +0000
committerJeff Peeler <jpeeler@digium.com>2010-08-09 20:46:50 +0000
commit416b05e9daf0a81a6d22b4458b2a9ff2f55d5886 (patch)
treec926be76bc4063a005b843027a1cd8c3b6a1f44c /channels/chan_local.c
parentf02c4ff5277a011246d35b7e13db06529bd12f64 (diff)
Merged revisions 281429 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r281429 | jpeeler | 2010-08-09 15:43:54 -0500 (Mon, 09 Aug 2010) | 27 lines Merged revisions 281391 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r281391 | jpeeler | 2010-08-09 15:07:29 -0500 (Mon, 09 Aug 2010) | 20 lines Merged revisions 281390 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r281390 | jpeeler | 2010-08-09 15:04:30 -0500 (Mon, 09 Aug 2010) | 13 lines Prevent loss of Caller ID information set on local channel after masquerade. Caller ID set on the channel before a masquerade occurs when using a local channel would cause the information to be lost. The problem was that the information was set on a channel destined to be hung up. The somewhat confusing fix is to detect if any Caller ID has been set on the channel and if so preswap the Caller ID data so that basically the masquerade puts the data back. (closes issue #17138) Reported by: kobaz Review: https://reviewboard.asterisk.org/r/847/ ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@281431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index d1f66f8dd..720423c25 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -409,6 +409,23 @@ static void check_bridge(struct local_pvt *p)
p->chan->audiohooks = p->owner->audiohooks;
p->owner->audiohooks = audiohooks_swapper;
}
+
+ /* If any Caller ID was set, preserve it after masquerade like above. We must check
+ * to see if Caller ID was set because otherwise we'll mistakingly copy info not
+ * set from the dialplan and will overwrite the real channel Caller ID. The reason
+ * for this whole preswapping action is because the Caller ID is set on the channel
+ * thread (which is the to be masqueraded away local channel) before both local
+ * channels are optimized away.
+ */
+ if (p->owner->caller.id.name.valid || p->owner->caller.id.number.valid ||
+ p->owner->caller.id.subaddress.valid) {
+
+ struct ast_party_caller tmp;
+ tmp = p->owner->caller;
+ p->owner->caller = p->chan->_bridge->caller;
+ p->chan->_bridge->caller = tmp;
+ }
+
ast_app_group_update(p->chan, p->owner);
ast_channel_masquerade(p->owner, p->chan->_bridge);
ast_set_flag(p, LOCAL_ALREADY_MASQED);