From 12ad49e444d6108b7312a46b389090d51b670a7f Mon Sep 17 00:00:00 2001 From: bbryant Date: Thu, 9 Sep 2010 18:50:13 +0000 Subject: 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.6.2@285710 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_local.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'channels/chan_local.c') diff --git a/channels/chan_local.c b/channels/chan_local.c index a26b8f718..46451776f 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -384,6 +384,26 @@ 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->cid.cid_dnid || p->owner->cid.cid_num || + p->owner->cid.cid_name || p->owner->cid.cid_ani || + p->owner->cid.cid_rdnis || p->owner->cid.cid_pres || + p->owner->cid.cid_ani2 || p->owner->cid.cid_ton || + p->owner->cid.cid_tns) { + + struct ast_callerid tmpcid; + tmpcid = p->owner->cid; + p->owner->cid = p->chan->_bridge->cid; + p->chan->_bridge->cid = tmpcid; + } + ast_app_group_update(p->chan, p->owner); ast_channel_masquerade(p->owner, p->chan->_bridge); ast_set_flag(p, LOCAL_ALREADY_MASQED); -- cgit v1.2.3