sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-LOC-NADI");
if (sipvar) {
ftdm_usrmsg_add_var(&usrmsg, "ss7_loc_nadi", sipvar);
- }
+ }
-
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-DNIS-TON");
if (sipvar) {
caller_data.dnis.type = (uint8_t)atoi(sipvar);
if (!ftdm_strlen_zero(var_value)) {
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-OCN", "%s", var_value);
}
-
++
var_value = ftdm_sigmsg_get_var(sigmsg, "ss7_ocn_nadi");
if (!ftdm_strlen_zero(var_value)) {
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-OCN-NADI", "%s", var_value);
ftdm_time_t diff = 0;
ftdm_channel_state_t state = fchan->state;
-
#if 0
- /* I could not perform this sanity check without more disruptive changes. Ideally we should check here if the signaling module completing the state
- executed a state processor (called ftdm_channel_advance_states() which call fchan->span->state_processor(fchan)) for the state. That is just a
- sanity check, as in the past we had at least one bug where the signaling module set the state and then accidentally changed the state to a new one
- without calling ftdm_channel_advance_states(), meaning the state processor for the first state was not executed and that lead to unexpected behavior.
+ /* I could not perform this sanity check without more disruptive changes. Ideally we should check here if the signaling module completing the state
+ executed a state processor (called ftdm_channel_advance_states() which call fchan->span->state_processor(fchan)) for the state. That is just a
+ sanity check, as in the past we had at least one bug where the signaling module set the state and then accidentally changed the state to a new one
+ without calling ftdm_channel_advance_states(), meaning the state processor for the first state was not executed and that lead to unexpected behavior.
+
+ If we want to be able to perform this kind of sanity check it would be nice to add a new state status (FTDM_STATE_STATUS_PROCESSING), the function
+ ftdm_channel_advance_states() would set the state_status to PROCESSING and then the check below for STATUS_NEW would be valid. Currently is not
+ valid because the signaling module may be completing the state at the end of the state_processor callback and therefore the state will still be
+ in STATUS_NEW, and is perfectly valid ... */
+
- If we want to be able to perform this kind of sanity check it would be nice to add a new state status (FTDM_STATE_STATUS_PROCESSING), the function
- ftdm_channel_advance_states() would set the state_status to PROCESSING and then the check below for STATUS_NEW would be valid. Currently is not
- valid because the signaling module may be completing the state at the end of the state_processor callback and therefore the state will still be
- in STATUS_NEW, and is perfectly valid ... */
if (fchan->state_status == FTDM_STATE_STATUS_NEW) {
ftdm_log_chan_ex(fchan, file, func, line, FTDM_LOG_LEVEL_CRIT,
"Asking to complete state change from %s to %s in %llums, but the state is still unprocessed (this might be a bug!)\n",
/* bring the sig status down */
sngss7_set_sig_status(sngss7_info, FTDM_SIG_STATE_DOWN);
++
+ ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_SUSPENDED);
/* unlock the channel again before we exit */
ftdm_mutex_unlock(ftdmchan->mutex);
while( x < loop_range ) {
if (g_ftdm_sngss7_data.cfg.isupCkt[x].type != SNG_CKT_VOICE) {
loop_range++;
-- }
-- else {
++ } else {
if (extract_chan_data(x, &sngss7_info, &ftdmchan)) {
SS7_ERROR("Failed to extract channel data for circuit = %d!\n", x);
}
ftmod_ss7_set_glare_resolution (parm->val);
SS7_DEBUG("Found glare resolution configuration = %d %s\n", g_ftdm_sngss7_data.cfg.glareResolution, parm->val );
}
- if (!strcasecmp(parm->val, "true")) {
+ else if (!strcasecmp(parm->var, "force-inr")) {
++ if (ftdm_true(parm->val)) {
+ g_ftdm_sngss7_data.cfg.force_inr = 1;
+ } else {
+ g_ftdm_sngss7_data.cfg.force_inr = 0;
+ }
+ SS7_DEBUG("Found INR force configuration = %s\n", parm->val );
+ }
else {
SS7_ERROR("Found an invalid parameter \"%s\"!\n", parm->val);
return FTDM_FAIL;
flag_loc_nadi = 1;
sng_ccSpan.loc_nadi = atoi(parm->val);
SS7_DEBUG("Found default LOC_NADI parm->value = %d\n", sng_ccSpan.loc_nadi);
-
-
/**********************************************************************/
} else if (!strcasecmp(parm->var, "lpa_on_cot")) {
/**********************************************************************/