freetdm: added debugging - changed order of block/unblock

This commit is contained in:
Nenad Corbic 2011-10-25 19:04:50 -04:00
parent f8ae7e7464
commit 982bcf4146

View File

@ -42,8 +42,6 @@
/******************************************************************************/ /******************************************************************************/
/* PROTOTYPES *****************************************************************/ /* PROTOTYPES *****************************************************************/
ftdm_status_t handle_relay_connect(RyMngmt *sta);
ftdm_status_t handle_relay_disconnect(RyMngmt *sta);
/*static ftdm_status_t enable_all_ckts_for_relay(void);*/ /*static ftdm_status_t enable_all_ckts_for_relay(void);*/
static ftdm_status_t reconfig_all_ckts_for_relay(void); static ftdm_status_t reconfig_all_ckts_for_relay(void);
@ -84,23 +82,24 @@ ftdm_status_t handle_relay_connect(RyMngmt *sta)
/******************************************************************************/ /******************************************************************************/
ftdm_status_t handle_relay_disconnect_on_error(RyMngmt *sta) ftdm_status_t handle_relay_disconnect_on_error(RyMngmt *sta)
{ {
SS7_DEBUG("SS7 relay disconnect on error\n");
/* check which procId is in error, if it is 1, disable the ckts */ /* check which procId is in error, if it is 1, disable the ckts */
if (sta->t.usta.s.ryErrUsta.errPid == 1 ) { if (sta->t.usta.s.ryErrUsta.errPid == 1 ) {
/* we've lost the server, bring down the mtp2 links */
disble_all_mtp2_sigs_for_relay();
/* we've lost the server, bring the sig status down on all ckts */ /* we've lost the server, bring the sig status down on all ckts */
disable_all_ckts_for_relay(); disable_all_ckts_for_relay();
/* we've lost the server, bring down the mtp2 links */
disble_all_mtp2_sigs_for_relay();
} }
/* check if the channel is a server, means we just lost a MGW */ /* check if the channel is a server, means we just lost a MGW */
if (g_ftdm_sngss7_data.cfg.relay[sta->t.usta.s.ryErrUsta.errPid].type == LRY_CT_TCP_SERVER) { if (g_ftdm_sngss7_data.cfg.relay[sta->t.usta.s.ryErrUsta.errPid].type == LRY_CT_TCP_SERVER) {
/* we've lost the client, bring down all mtp3 links for this procId */
disable_all_sigs_for_relay(sta->t.usta.s.ryErrUsta.errPid);
/* we've lost the client, bring down all the ckts for this procId */ /* we've lost the client, bring down all the ckts for this procId */
block_all_ckts_for_relay(sta->t.usta.s.ryErrUsta.errPid); block_all_ckts_for_relay(sta->t.usta.s.ryErrUsta.errPid);
/* we've lost the client, bring down all mtp3 links for this procId */
disable_all_sigs_for_relay(sta->t.usta.s.ryErrUsta.errPid);
} }
return FTDM_SUCCESS; return FTDM_SUCCESS;
@ -110,6 +109,8 @@ ftdm_status_t handle_relay_disconnect_on_error(RyMngmt *sta)
ftdm_status_t handle_relay_disconnect_on_down(RyMngmt *sta) ftdm_status_t handle_relay_disconnect_on_down(RyMngmt *sta)
{ {
SS7_DEBUG("SS7 relay disconnect on down\n");
/* check if the channel is a server, means we just lost a MGW */ /* check if the channel is a server, means we just lost a MGW */
if (g_ftdm_sngss7_data.cfg.relay[sta->t.usta.s.ryUpUsta.id].type == LRY_CT_TCP_SERVER) { if (g_ftdm_sngss7_data.cfg.relay[sta->t.usta.s.ryUpUsta.id].type == LRY_CT_TCP_SERVER) {
block_all_ckts_for_relay(sta->t.usta.s.ryUpUsta.id); block_all_ckts_for_relay(sta->t.usta.s.ryUpUsta.id);