Merged revisions 224330 via svnmerge from
[asterisk/asterisk.git] / channels / chan_dahdi.c
index f360899..ee85f13 100644 (file)
@@ -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;