idx = dahdi_get_index(ast, p, 1);
- if ((p->sig == SIG_PRI) || (p->sig == SIG_SS7) || (p->sig == SIG_BRI) || (p->sig == SIG_BRI_PTMP)) {
+ switch (p->sig) {
+ case SIG_PRI:
+ case SIG_BRI:
+ case SIG_BRI_PTMP:
+ case SIG_SS7:
x = 1;
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
+ /* Fall through */
+ case SIG_MFCR2:
p->cid_num[0] = '\0';
p->cid_name[0] = '\0';
+ break;
+ default:
+ break;
}
x = 0;
}
#endif
#ifdef HAVE_OPENR2
- p->cid_num[0] = '\0';
- p->cid_name[0] = '\0';
if (p->mfcr2 && p->mfcr2call && openr2_chan_get_direction(p->r2chan) != OR2_DIR_STOPPED) {
ast_log(LOG_DEBUG, "disconnecting MFC/R2 call on chan %d\n", p->channel);
/* If it's an incoming call, check the mfcr2_forced_release setting */
ast_copy_string(tmp->context, conf->chan.context, sizeof(tmp->context));
ast_copy_string(tmp->parkinglot, conf->chan.parkinglot, sizeof(tmp->parkinglot));
tmp->cid_ton = 0;
- if ((tmp->sig != SIG_PRI) || (tmp->sig != SIG_SS7) || (tmp->sig != SIG_BRI) || (tmp->sig != SIG_BRI_PTMP) || (tmp->sig != SIG_MFCR2)) {
- 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 {
+ switch (tmp->sig) {
+ case SIG_PRI:
+ case SIG_BRI:
+ case SIG_BRI_PTMP:
+ case SIG_SS7:
+ case SIG_MFCR2:
tmp->cid_num[0] = '\0';
tmp->cid_name[0] = '\0';
+ break;
+ default:
+ 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));
+ break;
}
ast_copy_string(tmp->mailbox, conf->chan.mailbox, sizeof(tmp->mailbox));
if (channel != CHAN_PSEUDO && !ast_strlen_zero(tmp->mailbox)) {