freetdm: ISDN - fixed channel restart command not specifying channel ID

This commit is contained in:
David Yat Sin 2011-03-25 14:49:14 -04:00
parent 85602f9b8c
commit 9f449b338f
3 changed files with 15 additions and 10 deletions

View File

@ -662,7 +662,7 @@ void sngisdn_process_rel_ind (sngisdn_event_data_t *sngisdn_event)
}
break;
case FTDM_CHANNEL_STATE_RESET:
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Processing SETUP but channel in RESET state, ignoring\n");
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Processing RELEASE but channel in RESET state, ignoring\n");
break;
default:
ftdm_log_chan(ftdmchan, FTDM_LOG_CRIT, "Received RELEASE in an invalid state (%s)\n",

View File

@ -60,7 +60,7 @@ void sngisdn_snd_setup(ftdm_channel_t *ftdmchan)
}
ftdm_log_chan(sngisdn_info->ftdmchan, FTDM_LOG_INFO, "Outgoing call: Called No:[%s] Calling No:[%s]\n", ftdmchan->caller_data.dnis.digits, ftdmchan->caller_data.cid_num.digits);
set_chan_id_ie(ftdmchan, &conEvnt.chanId);
set_chan_id_ie(ftdmchan, &conEvnt.chanId);
set_bear_cap_ie(ftdmchan, &conEvnt.bearCap[0]);
set_called_num(ftdmchan, &conEvnt.cdPtyNmb);
set_calling_num(ftdmchan, &conEvnt.cgPtyNmb);
@ -125,8 +125,11 @@ void sngisdn_snd_con_complete(ftdm_channel_t *ftdmchan)
}
memset(&cnStEvnt, 0, sizeof(cnStEvnt));
set_chan_id_ie(ftdmchan, &cnStEvnt.chanId);
/* Indicate channel ID only in first response */
if (!ftdm_test_flag(sngisdn_info, FLAG_SENT_CHAN_ID)) {
set_chan_id_ie(ftdmchan, &cnStEvnt.chanId);
}
ftdm_log_chan(ftdmchan, FTDM_LOG_INFO, "Sending CONNECT COMPL (suId:%d suInstId:%u spInstId:%u dchan:%d ces:%d)\n", signal_data->cc_id, sngisdn_info->suInstId, sngisdn_info->spInstId, signal_data->dchan_id, sngisdn_info->ces);
@ -152,7 +155,10 @@ void sngisdn_snd_proceed(ftdm_channel_t *ftdmchan, ftdm_sngisdn_progind_t prog_i
memset(&cnStEvnt, 0, sizeof(cnStEvnt));
set_chan_id_ie(ftdmchan, &cnStEvnt.chanId);
/* Indicate channel ID only in first response */
if (!ftdm_test_flag(sngisdn_info, FLAG_SENT_CHAN_ID)) {
set_chan_id_ie(ftdmchan, &cnStEvnt.chanId);
}
set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind);
set_facility_ie(ftdmchan, &cnStEvnt.facilityStr);
@ -238,7 +244,10 @@ void sngisdn_snd_connect(ftdm_channel_t *ftdmchan)
memset(&cnStEvnt, 0, sizeof(cnStEvnt));
set_chan_id_ie(ftdmchan, &cnStEvnt.chanId);
/* Indicate channel ID only in first response */
if (!ftdm_test_flag(sngisdn_info, FLAG_SENT_CHAN_ID)) {
set_chan_id_ie(ftdmchan, &cnStEvnt.chanId);
}
set_prog_ind_ie(ftdmchan, &cnStEvnt.progInd, prog_ind);
set_facility_ie(ftdmchan, &cnStEvnt.facilityStr);

View File

@ -830,10 +830,6 @@ ftdm_status_t set_chan_id_ie(ftdm_channel_t *ftdmchan, ChanId *chanId)
return FTDM_SUCCESS;
}
if (ftdm_test_flag(sngisdn_info, FLAG_SENT_CHAN_ID)) {
/* Indicate channel ID only in first response */
return FTDM_SUCCESS;
}
ftdm_set_flag(sngisdn_info, FLAG_SENT_CHAN_ID);
chanId->eh.pres = PRSNT_NODEF;