From: Jeff Peeler Date: Sat, 17 Oct 2009 01:36:08 +0000 (+0000) Subject: Merged revisions 224330 via svnmerge from X-Git-Tag: 11.0.0-beta1~4022 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53a95d9c8483c3cd7b5ead9a459bce6e62bd5331;p=thirdparty%2Fasterisk.git Merged revisions 224330 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r224330 | jpeeler | 2009-10-16 20:32:47 -0500 (Fri, 16 Oct 2009) | 13 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@224331 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index f360899fdd..ee85f13dfa 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -5218,6 +5218,9 @@ static int dahdi_hangup(struct ast_channel *ast) revert_fax_buffers(p, ast); goto hangup_out; + } else { + p->cid_num[0] = '\0'; + p->cid_name[0] = '\0'; } ast_mutex_lock(&p->lock); @@ -11285,10 +11288,15 @@ 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)); ast_copy_string(tmp->parkinglot, conf->chan.parkinglot, sizeof(tmp->parkinglot)); tmp->cid_ton = 0; - ast_copy_string(tmp->cid_name, conf->chan.cid_name, sizeof(tmp->cid_name)); + if (analog_lib_handles(p->sig, p->radio, p->oprmode)) + 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)); if (channel != CHAN_PSEUDO && !ast_strlen_zero(tmp->mailbox)) { char *mailbox, *context; diff --git a/channels/sig_pri.c b/channels/sig_pri.c index 8f05e92c14..48a55f9925 100644 --- a/channels/sig_pri.c +++ b/channels/sig_pri.c @@ -2410,6 +2410,8 @@ int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast) p->progress = 0; p->alerting = 0; p->setup_ack = 0; + p->cid_num[0] = '\0'; + p->cid_name[0] = '\0'; p->exten[0] = '\0'; sig_pri_set_dialing(p, 0);