diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c index 4125c84101..fc14d04c80 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c @@ -746,8 +746,8 @@ void ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan) ft_to_sngss7_rsca (ftdmchan); /* clear the reset flag */ - sngss7_clear_flag (sngss7_info, FLAG_RESET_RX); - } + clear_rx_rsc_flags(sngss7_info); + } /* if (sngss7_test_flag (sngss7_info, FLAG_RESET_RX)) */ /* check if there was a GRS that needs a GRA */ if ((sngss7_test_flag(sngss7_info, FLAG_GRP_RESET_RX)) && @@ -769,32 +769,24 @@ void ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan) } /* clear the grp reset flag */ - sngss7_clear_flag(sngss7_info, FLAG_GRP_RESET_RX); - sngss7_clear_flag(sngss7_info, FLAG_GRP_RESET_RX_DN); - sngss7_clear_flag(sngss7_info, FLAG_GRP_RESET_RX_CMPLT); - + clear_rx_grs_flags(sngss7_info); }/* if ( sngss7_test_flag ( sngss7_info, FLAG_GRP_RESET_RX ) ) */ /* check if we got the reset response */ if (sngss7_test_flag(sngss7_info, FLAG_RESET_TX_RSP)) { /* clear the reset flag */ - sngss7_clear_flag(sngss7_info, FLAG_RESET_TX_RSP); - sngss7_clear_flag(sngss7_info, FLAG_RESET_SENT); - sngss7_clear_flag(sngss7_info, FLAG_RESET_TX); - } + clear_tx_rsc_flags(sngss7_info); + } /* if (sngss7_test_flag(sngss7_info, FLAG_RESET_TX_RSP)) */ if (sngss7_test_flag(sngss7_info, FLAG_GRP_RESET_TX_RSP)) { /* clear the reset flag */ - sngss7_clear_flag(sngss7_info, FLAG_GRP_RESET_TX_RSP); - sngss7_clear_flag(sngss7_info, FLAG_GRP_RESET_TX); - sngss7_clear_flag(sngss7_info, FLAG_GRP_RESET_BASE); - sngss7_clear_flag(sngss7_info, FLAG_GRP_RESET_SENT); + clear_tx_grs_flags(sngss7_info); /* clean out the spans GRA structure */ sngss7_span_data_t *span = ftdmchan->span->mod_data; span->rx_gra.circuit = 0; span->rx_gra.range = 0; - } + } /* if (sngss7_test_flag(sngss7_info, FLAG_GRP_RESET_TX_RSP)) */ /* check if we came from reset (aka we just processed a reset) */ if ((ftdmchan->last_state == FTDM_CHANNEL_STATE_RESTART) || @@ -825,7 +817,6 @@ void ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan) } /* if (!ftdm_test_flag (ftdmchan, FTDM_CHANNEL_SIG_UP)) */ } /* if !blocked */ } else { - SS7_DEBUG_CHAN(ftdmchan,"Reset flags present (0x%X)\n", sngss7_info->flags); /* there is still another reset pending so go back to reset*/ @@ -1120,14 +1111,10 @@ void ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan) ftdm_span_send_signal (ftdmchan->span, &sigev); /* remove any reset flags */ - sngss7_clear_flag (sngss7_info, FLAG_GRP_RESET_TX_RSP); - sngss7_clear_flag (sngss7_info, FLAG_GRP_RESET_TX); - sngss7_clear_flag (sngss7_info, FLAG_RESET_TX_RSP); - sngss7_clear_flag (sngss7_info, FLAG_RESET_TX); - sngss7_clear_flag (sngss7_info, FLAG_RESET_SENT); - sngss7_clear_flag (sngss7_info, FLAG_GRP_RESET_RX); - sngss7_clear_flag (sngss7_info, FLAG_RESET_RX); - sngss7_clear_flag (sngss7_info, FLAG_GRP_RESET_BASE); + clear_rx_grs_flags(sngss7_info); + clear_tx_grs_flags(sngss7_info); + clear_rx_rsc_flags(sngss7_info); + clear_tx_rsc_flags(sngss7_info); /* bring the channel down */ goto suspend_goto_last; diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h index ae2412381c..d44815df0f 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h @@ -430,8 +430,10 @@ extern int cmbLinkSetId; /******************************************************************************/ /* PROTOTYPES *****************************************************************/ +/* in ftmod_sangoma_ss7_main.c */ void ftdm_sangoma_ss7_process_state_change (ftdm_channel_t *ftdmchan); +/* in ftmod_sangoma_ss7_logger.c */ void handle_sng_log(uint8_t level, char *fmt,...); void handle_sng_mtp1_alarm(Pst *pst, L1Mngmt *sta); void handle_sng_mtp2_alarm(Pst *pst, SdMngmt *sta); @@ -439,6 +441,7 @@ void handle_sng_mtp3_alarm(Pst *pst, SnMngmt *sta); void handle_sng_isup_alarm(Pst *pst, SiMngmt *sta); void handle_sng_cc_alarm(Pst *pst, CcMngmt *sta); +/* in ftmod_sangoma_ss7_cfg.c */ int ft_to_sngss7_cfg_all(void); int ftmod_ss7_mtp1_gen_config(void); int ftmod_ss7_mtp2_gen_config(void); @@ -457,6 +460,9 @@ int ftmod_ss7_isup_ckt_config(int id); int ftmod_ss7_isup_isap_config(int id); int ftmod_ss7_cc_isap_config(int id); +/* in ftmod_sangoma_ss7_cntrl.c */ +int ft_to_sngss7_activate_all(void); + int ftmod_ss7_inhibit_mtplink(uint32_t id); int ftmod_ss7_uninhibit_mtplink(uint32_t id); int ftmod_ss7_activate_mtplink(uint32_t id); @@ -468,11 +474,12 @@ int ftmod_ss7_deactivate2_mtplinkSet(uint32_t id); int ftmod_ss7_lpo_mtplink(uint32_t id); int ftmod_ss7_lpr_mtplink(uint32_t id); +/* in ftmod_sangoma_ss7_sta.c */ int ftmod_ss7_mtplink_sta(uint32_t id, SnMngmt *cfm); int ftmod_ss7_mtplinkSet_sta(uint32_t id, SnMngmt *cfm); -int ft_to_sngss7_activate_all(void); +/* in ftmod_sangoma_ss7_out.c */ void ft_to_sngss7_iam(ftdm_channel_t *ftdmchan); void ft_to_sngss7_acm(ftdm_channel_t *ftdmchan); void ft_to_sngss7_anm(ftdm_channel_t *ftdmchan); @@ -492,6 +499,7 @@ void ft_to_sngss7_cgua(ftdm_channel_t * ftdmchan); void ft_to_sngss7_cgb(ftdm_channel_t * ftdmchan); void ft_to_sngss7_cgu(ftdm_channel_t * ftdmchan); +/* in ftmod_sangoma_ss7_in.c */ void sngss7_sta_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t globalFlg, uint8_t evntType, SiStaEvnt *siStaEvnt); void sngss7_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt); void sngss7_con_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt); @@ -504,6 +512,7 @@ void sngss7_fac_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint void sngss7_sta_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t globalFlg, uint8_t evntType, SiStaEvnt *siStaEvnt); void sngss7_umsg_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit); +/* in ftmod_sangoma_ss7_handle.c */ ftdm_status_t handle_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt); ftdm_status_t handle_con_sta(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiCnStEvnt *siCnStEvnt, uint8_t evntType); ftdm_status_t handle_con_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt); @@ -534,6 +543,13 @@ ftdm_status_t handle_local_blk(uint32_t suInstId, uint32_t spInstId, uint32_t ci ftdm_status_t handle_local_ubl(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t globalFlg, uint8_t evntType, SiStaEvnt *siStaEvnt); ftdm_status_t handle_ucic(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t globalFlg, uint8_t evntType, SiStaEvnt *siStaEvnt); +/* in ftmod_sangoma_ss7_xml.c */ +int ftmod_ss7_parse_xml(ftdm_conf_parameter_t *ftdm_parameters, ftdm_span_t *span); + +/* in ftmod_sangoma_ss7_cli.c */ +ftdm_status_t ftdm_sngss7_handle_cli_cmd(ftdm_stream_handle_t *stream, const char *data); + +/* in ftmod_sangoma_ss7_support.c */ uint8_t copy_cgPtyNum_from_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum); uint8_t copy_cgPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum); uint8_t copy_cdPtyNum_from_sngss7(ftdm_caller_data_t *ftdm, SiCdPtyNum *cdPtyNum); @@ -545,16 +561,19 @@ int check_for_reset(sngss7_chan_data_t *sngss7_info); ftdm_status_t extract_chan_data(uint32_t circuit, sngss7_chan_data_t **sngss7_info, ftdm_channel_t **ftdmchan); unsigned long get_unique_id(void); -int ftmod_ss7_parse_xml(ftdm_conf_parameter_t *ftdm_parameters, ftdm_span_t *span); - -void handle_isup_t35(void *userdata); - -ftdm_status_t ftdm_sngss7_handle_cli_cmd(ftdm_stream_handle_t *stream, const char *data); - ftdm_status_t check_if_rx_grs_started(ftdm_span_t *ftdmspan); ftdm_status_t check_if_rx_grs_processed(ftdm_span_t *ftdmspan); ftdm_status_t check_if_rx_gra_started(ftdm_span_t *ftdmspan); ftdm_status_t check_for_res_sus_flag(ftdm_span_t *ftdmspan); + +ftdm_status_t clear_rx_grs_flags(sngss7_chan_data_t *sngss7_info); +ftdm_status_t clear_tx_grs_flags(sngss7_chan_data_t *sngss7_info); +ftdm_status_t clear_rx_rsc_flags(sngss7_chan_data_t *sngss7_info); +ftdm_status_t clear_tx_rsc_flags(sngss7_chan_data_t *sngss7_info); + + +/* in ftmod_sangoma_ss7_timers.c */ +void handle_isup_t35(void *userdata); /******************************************************************************/ /* MACROS *********************************************************************/