aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-17 01:32:47 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-17 01:32:47 +0000
commit666590ec05874fe23839e8e76045c822e9ba08f6 (patch)
tree3d478cd746cc2cc6be6cef0558f2de13a52a7c5a
parentb3486c65037ed3f33f52a2b1a14b802f6b2dd438 (diff)
Fix stale caller id data from being reported in AMI NewChannel event
The problem here is that chan_dahdi is designed in such a way to set certain values in the dahdi_pvt only once. One of those such values is the configured caller id data in chan_dahdi.conf. For PRI, the configured caller id data could be overwritten during a call. Instead of saving the data and restoring, it was decided that for all non-analog channels it was simply best to not set the configured caller id in the first place and also clear it at the end of the call. (closes issue #15883) Reported by: jsmith git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@224330 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_dahdi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index ff6756af5..e4d38b93f 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -2822,6 +2822,8 @@ static int dahdi_hangup(struct ast_channel *ast)
if (p->sig == SIG_PRI) {
x = 1;
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
+ p->cid_num[0] = '\0';
+ p->cid_name[0] = '\0';
}
x = 0;
@@ -8004,9 +8006,14 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
ast_copy_string(tmp->mohinterpret, conf->chan.mohinterpret, sizeof(tmp->mohinterpret));
ast_copy_string(tmp->mohsuggest, conf->chan.mohsuggest, sizeof(tmp->mohsuggest));
ast_copy_string(tmp->context, conf->chan.context, sizeof(tmp->context));
- ast_copy_string(tmp->cid_num, conf->chan.cid_num, sizeof(tmp->cid_num));
tmp->cid_ton = 0;
- ast_copy_string(tmp->cid_name, conf->chan.cid_name, sizeof(tmp->cid_name));
+ if (chan_sig != SIG_PRI) {
+ ast_copy_string(tmp->cid_num, conf->chan.cid_num, sizeof(tmp->cid_num));
+ ast_copy_string(tmp->cid_name, conf->chan.cid_name, sizeof(tmp->cid_name));
+ } else {
+ tmp->cid_num[0] = '\0';
+ tmp->cid_name[0] = '\0';
+ }
ast_copy_string(tmp->mailbox, conf->chan.mailbox, sizeof(tmp->mailbox));
tmp->msgstate = -1;
tmp->group = conf->chan.group;