aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authorbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-09 18:50:13 +0000
committerbbryant <bbryant@f38db490-d61c-443f-a65b-d21fe96a405b>2010-09-09 18:50:13 +0000
commit12ad49e444d6108b7312a46b389090d51b670a7f (patch)
treefe20338149990fed28e3936bbbd7162e69d1f938 /channels/chan_local.c
parentf8d0dcac122feafe9ebd0aba502263f829c77667 (diff)
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
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c20
1 files changed, 20 insertions, 0 deletions
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);