diff options
author | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
---|---|---|
committer | bbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-09 18:51:52 +0000 |
commit | 722eb3c4c3cfa1c0cee915c949c5f95199ee24dd (patch) | |
tree | 25683963c5e51bdedd6211cd0ea92a85639505c3 /channels/chan_local.c | |
parent | 815b5b09da5e555add7bba3d8fca588e7611248a (diff) |
Merged revisions 285710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r285710 | bbryant | 2010-09-09 14:50:13 -0400 (Thu, 09 Sep 2010) | 8 lines
Fixes an issue with dialplan pattern matching where the specificity for pattern ranges and pattern special characters was inconsistent.
(closes issue #16903)
Reported by: Nick_Lewis
Patches:
pbx.c-specificity.patch uploaded by Nick Lewis (license 657)
Tested by: Nick_Lewis
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@285711 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r-- | channels/chan_local.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index d1f66f8dd..aebca441a 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -409,6 +409,38 @@ 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 || p->owner->caller.ani.name.valid + || p->owner->caller.ani.number.valid || p->owner->caller.ani.subaddress.valid) { + struct ast_party_caller tmp; + tmp = p->owner->caller; + p->owner->caller = p->chan->_bridge->caller; + p->chan->_bridge->caller = tmp; + } + if (p->owner->redirecting.from.name.valid || p->owner->redirecting.from.number.valid + || p->owner->redirecting.from.subaddress.valid || p->owner->redirecting.to.name.valid + || p->owner->redirecting.to.number.valid || p->owner->redirecting.to.subaddress.valid) { + struct ast_party_redirecting tmp; + tmp = p->owner->redirecting; + p->owner->redirecting = p->chan->_bridge->redirecting; + p->chan->_bridge->redirecting = tmp; + } + if (p->owner->dialed.number.str || p->owner->dialed.subaddress.valid) { + struct ast_party_dialed tmp; + tmp = p->owner->dialed; + p->owner->dialed = p->chan->_bridge->dialed; + p->chan->_bridge->dialed = tmp; + } + + ast_app_group_update(p->chan, p->owner); ast_channel_masquerade(p->owner, p->chan->_bridge); ast_set_flag(p, LOCAL_ALREADY_MASQED); |