From: David Yat Sin Date: Thu, 26 Apr 2012 20:13:26 +0000 (-0400) Subject: Merge branch 'releases.3.4' into releases.3.5 X-Git-Tag: v1.2.3^2~71^2^2~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5226489c3971b84c2ba0d1b5aa3e0ad581dcd229;p=thirdparty%2Ffreeswitch.git Merge branch 'releases.3.4' into releases.3.5 Conflicts: libs/freetdm/mod_freetdm/mod_freetdm.c libs/freetdm/src/ftdm_state.c libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_out.c libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c --- 5226489c3971b84c2ba0d1b5aa3e0ad581dcd229 diff --cc libs/freetdm/mod_freetdm/mod_freetdm.c index 1c39703182,6a32098b44..b6a6f49ca1 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@@ -1474,8 -1414,9 +1474,8 @@@ static switch_call_cause_t channel_outg 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); @@@ -2043,6 -1988,7 +2042,7 @@@ ftdm_status_t ftdm_channel_from_event(f 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); diff --cc libs/freetdm/src/ftdm_state.c index bd670d0062,c6d45c3c3c..e5aba9d408 --- a/libs/freetdm/src/ftdm_state.c +++ b/libs/freetdm/src/ftdm_state.c @@@ -48,17 -48,16 +48,17 @@@ FT_DECLARE(ftdm_status_t) _ftdm_channel 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", diff --cc libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c index f48d25ce3c,d0d6c32867..4e0a20d5f3 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_handle.c @@@ -2472,6 -2511,7 +2510,8 @@@ ftdm_status_t handle_cgb_req(uint32_t s /* 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); @@@ -2589,8 -2629,8 +2629,7 @@@ ftdm_status_t handle_cgu_req(uint32_t s 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); } diff --cc libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c index 724fee25b9,ee726911af..f64356dd1f --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c @@@ -508,6 -510,14 +510,14 @@@ static int ftmod_ss7_parse_sng_gen(ftdm ftmod_ss7_set_glare_resolution (parm->val); SS7_DEBUG("Found glare resolution configuration = %d %s\n", g_ftdm_sngss7_data.cfg.glareResolution, parm->val ); } + else if (!strcasecmp(parm->var, "force-inr")) { - if (!strcasecmp(parm->val, "true")) { ++ 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; @@@ -2004,7 -2014,7 +2014,6 @@@ static int ftmod_ss7_parse_cc_span(ftdm 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")) { /**********************************************************************/