]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: added debugging - changed order of block/unblock
authorNenad Corbic <ncorbic@sangoma.com>
Tue, 25 Oct 2011 23:04:50 +0000 (19:04 -0400)
committerNenad Corbic <ncorbic@sangoma.com>
Tue, 25 Oct 2011 23:04:50 +0000 (19:04 -0400)
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_relay.c

index f58aad4ca7d0161aad72428ba824405bb5be437f..a96dae5cdda7b51cad48fc72041115d22327d6ef 100644 (file)
@@ -42,8 +42,6 @@
 /******************************************************************************/
 
 /* 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 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)
 {
+       SS7_DEBUG("SS7 relay disconnect on error\n");
 
        /* check which procId is in error, if it is 1, disable the ckts */
        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 */
                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 */
        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 */
                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;
@@ -110,6 +109,8 @@ ftdm_status_t handle_relay_disconnect_on_error(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 */
        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);