aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-03 20:49:10 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-03 20:49:10 +0000
commit994debde3c3d78011509a53fc68dd6ae27a6024e (patch)
tree86746dca3b3596169039acacee6b52a3c5266d8d /channels
parent2cba58cde9075cb1103123bf396e4897ef23139a (diff)
Prevent DAHDI channels from overriding the callerid, once it's been set by the user.
(closes issue #16661) Reported by: jstapleton Patches: 20100414__issue16661.diff.txt uploaded by tilghman (license 14) 20100415__issue16661__1.6.2.diff.txt uploaded by tilghman (license 14) Tested by: jstapleton git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@280811 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 1e4713c6d..a4e549a6f 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -5250,7 +5250,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
return &p->subs[index].f;
}
- if (p->subs[index].needcallerid) {
+ if (p->subs[index].needcallerid && !ast->cid.cid_tns) {
ast_set_callerid(ast, S_OR(p->lastcid_num, NULL),
S_OR(p->lastcid_name, NULL),
S_OR(p->lastcid_num, NULL)
@@ -9815,12 +9815,12 @@ static void *pri_dchannel(void *vpri)
if (chanpos < 0) {
ast_log(LOG_WARNING, "Facility Name requested on channel %d/%d not in use on span %d\n",
PRI_SPAN(e->facname.channel), PRI_CHANNEL(e->facname.channel), pri->span);
- } else {
+ } else if (pri->pvts[chanpos]->use_callerid) {
/* Re-use *69 field for PRI */
ast_mutex_lock(&pri->pvts[chanpos]->lock);
ast_copy_string(pri->pvts[chanpos]->lastcid_num, e->facname.callingnum, sizeof(pri->pvts[chanpos]->lastcid_num));
ast_copy_string(pri->pvts[chanpos]->lastcid_name, e->facname.callingname, sizeof(pri->pvts[chanpos]->lastcid_name));
- pri->pvts[chanpos]->subs[SUB_REAL].needcallerid =1;
+ pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
dahdi_enable_ec(pri->pvts[chanpos]);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
}