sngss7_info->circuit->flags );
if (!(sngss7_info->circuit->flags & SNGSS7_CONFIGURED)) {
- if ( !sngss7_test_ckt_flag(sngss7_info, FLAG_INFID_PAUSED)
- ||(sngss7_test_ckt_flag(sngss7_info, FLAG_INFID_RESUME))) {
+ /* Configure the circuit if RESUME and PAUSED are not set.
+ And also in a case when RESUME is set */
+ if (!sngss7_test_ckt_flag(sngss7_info, FLAG_INFID_PAUSED) ||
+ sngss7_test_ckt_flag(sngss7_info, FLAG_INFID_RESUME)) {
if (ftmod_ss7_isup_ckt_config(sngss7_info->circuit->id)) {
SS7_CRITICAL("ISUP CKT %d configuration FAILED!\n", sngss7_info->circuit->id);
- *(int*)0=0;
- return 1;
+ sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_PAUSED);
+ sngss7_clear_ckt_flag(sngss7_info, FLAG_INFID_RESUME);
} else {
SS7_INFO("ISUP CKT %d configuration DONE!\n", sngss7_info->circuit->id);
+ sngss7_info->circuit->flags |= SNGSS7_CONFIGURED;
+ sngss7_set_ckt_flag(sngss7_info, FLAG_RESET_TX);
}
- sngss7_info->circuit->flags |= SNGSS7_CONFIGURED;
}
}
/* check the last state and return to it to allow the call to finish */
goto suspend_goto_last;
}
-
+
if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_MN_UNBLK_TX)) {
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_MN_UNBLK_TX flag %s\n", "");
SS7_INFO("Relay Channel %d connection UP\n", sng_relay->id);
if (sng_relay->type == LRY_CT_TCP_CLIENT) {
- if (!sngss7_test_flag(sng_relay, SNGSS7_RELAY_INIT)) {
- if (reconfig_all_ckts_for_relay()) {
- SS7_ERROR("Failed to reconfigure ISUP Ckts!\n");
- /* we're done....this is very bad! */
- }
+ if (reconfig_all_ckts_for_relay()) {
+ SS7_ERROR("Failed to reconfigure ISUP Ckts!\n");
+ /* we're done....this is very bad! */
}
return FTDM_SUCCESS;
} else if (sng_relay->type == LRY_CT_TCP_SERVER) {
uint8_t bits_ef = 0;
int x;
int ret;
+ ret=0;
for (x = 1; x < (ftdmspan->chan_count + 1); x++) {
/**************************************************************************/
/* query for the status of the ckt */
if (ftmod_ss7_isup_ckt_sta(sngss7_info->circuit->id, &state)) {
+ /* NC: Circuit statistic failed: does not exist. Must re-configure circuit
+ Reset the circuit CONFIGURED flag so that RESUME will reconfigure
+ this circuit. */
+ sngss7_info->circuit->flags &= ~SNGSS7_CONFIGURED;
SS7_ERROR("Failed to read isup ckt = %d status\n", sngss7_info->circuit->id);
continue;
}
if (bits_cd == 0x0) {
/* check if circuit is UCIC or transient */
if (bits_ab == 0x3) {
+ SS7_INFO("ISUP CKT %d re-configuration pending!\n", x);
+ sngss7_info->circuit->flags &= ~SNGSS7_CONFIGURED;
+ SS7_STATE_CHANGE(ftdmchan, FTDM_CHANNEL_STATE_SUSPENDED);
+
+ /* NC: The code below should be deleted. Its here for hitorical
+ reason. The RESUME code will reconfigure the channel since
+ the CONFIGURED flag has been reset */
+#if 0
/* bit a and bit b are set, unequipped */
ret = ftmod_ss7_isup_ckt_config(sngss7_info->circuit->id);
if (ret) {
/* unlock the channel */
ftdm_mutex_unlock(ftdmchan->mutex);
+#endif
} /* if (bits_ab == 0x3) */
} else {
break;
/**************************************************************************/
case (1):
- /* locally blocked */
- sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_LC_BLOCK_RX);
+ /* locally blocked: Therefore we need to state machine to send an unblock */
+ sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_UNBLK_TX);
/* set the channel to suspended state */
SS7_STATE_CHANGE(ftdmchan, FTDM_CHANNEL_STATE_SUSPENDED);
/**************************************************************************/
case (3):
/* both locally and remotely blocked */
- sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_LC_BLOCK_RX);
+ sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_UNBLK_TX);
sngss7_set_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_BLOCK_RX);
/* set the channel to suspended state */