/* go through all the relays channels and configure it */
x = 1;
- while (g_ftdm_sngss7_data.cfg.relay[x].id != 0) {
+ while (x < (MAX_RELAY_CHANNELS)) {
/* check if this relay channel has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.relay[x].flags & SNGSS7_CONFIGURED)) {
+ if ((g_ftdm_sngss7_data.cfg.relay[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.relay[x].flags & SNGSS7_CONFIGURED))) {
/* send the specific configuration */
if (ftmod_ss7_relay_chan_config(x)) {
g_ftdm_sngss7_data.cfg.relay[x].flags |= SNGSS7_CONFIGURED;
} /* if !SNGSS7_CONFIGURED */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.relay[x].id != 0) */
+ } /* while (x < (MAX_RELAY_CHANNELS)) */
x = 1;
- while (x < (MAX_MTP_LINKS + 1)) {
+ while (x < (MAX_MTP_LINKS)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.mtp1Link[x].flags & SNGSS7_CONFIGURED) &&
- (g_ftdm_sngss7_data.cfg.mtp1Link[x].id != 0)) {
+ if ((g_ftdm_sngss7_data.cfg.mtp1Link[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.mtp1Link[x].flags & SNGSS7_CONFIGURED))) {
/* configure mtp1 */
if (ftmod_ss7_mtp1_psap_config(x)) {
g_ftdm_sngss7_data.cfg.mtp1Link[x].flags |= SNGSS7_CONFIGURED;
}
x++;
- } /* while (g_ftdm_sngss7_data.cfg.mtp1Link[x].id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
x = 1;
- while (x < (MAX_MTP_LINKS + 1)) {
+ while (x < (MAX_MTP_LINKS)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.mtp2Link[x].flags & SNGSS7_CONFIGURED) &&
- (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0)) {
+ if ((g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.mtp2Link[x].flags & SNGSS7_CONFIGURED))) {
/* configure mtp2 */
if (ftmod_ss7_mtp2_dlsap_config(x)) {
g_ftdm_sngss7_data.cfg.mtp2Link[x].flags |= SNGSS7_CONFIGURED;
}
x++;
- } /* while (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
x = 1;
- while (x < (MAX_MTP_LINKS + 1)) {
+ while (x < (MAX_MTP_LINKS)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.mtp3Link[x].flags & SNGSS7_CONFIGURED) &&
- (g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0)) {
+ if ((g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.mtp3Link[x].flags & SNGSS7_CONFIGURED))) {
/* configure mtp3 */
if (ftmod_ss7_mtp3_dlsap_config(x)) {
}
x++;
- } /* while (g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
x = 1;
- while (g_ftdm_sngss7_data.cfg.nsap[x].id != 0) {
+ while (x < (MAX_NSAPS)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_CONFIGURED)) {
+ if ((g_ftdm_sngss7_data.cfg.nsap[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_CONFIGURED))) {
ret = ftmod_ss7_mtp3_nsap_config(x);
if (ret) {
} /* if !SNGSS7_CONFIGURED */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.nsap[x].id != 0) */
+ } /* while (x < (MAX_NSAPS)) */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) {
+ while (x < (MAX_MTP_LINKSETS+1)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].flags & SNGSS7_CONFIGURED)) {
+ if ((g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].flags & SNGSS7_CONFIGURED))) {
if (ftmod_ss7_mtp3_linkset_config(x)) {
SS7_CRITICAL("MTP3 LINKSET %d configuration FAILED!\n", x);
} /* if !SNGSS7_CONFIGURED */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) */
+ } /* while (x < (MAX_MTP_LINKSETS+1)) */
x = 1;
- while ((g_ftdm_sngss7_data.cfg.mtpRoute[x].id != 0)) {
+ while (x < (MAX_MTP_ROUTES+1)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.mtpRoute[x].flags & SNGSS7_CONFIGURED)) {
+ if ((g_ftdm_sngss7_data.cfg.mtpRoute[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.mtpRoute[x].flags & SNGSS7_CONFIGURED))) {
if (ftmod_ss7_mtp3_route_config(x)) {
SS7_CRITICAL("MTP3 ROUTE %d configuration FAILED!\n", x);
} /* if !SNGSS7_CONFIGURED */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.mtpRoute[x].id != 0) */
+ } /* while (x < (MAX_MTP_ROUTES+1)) */
x = 1;
- while (g_ftdm_sngss7_data.cfg.isap[x].id != 0) {
+ while (x < (MAX_ISAPS)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.isap[x].flags & SNGSS7_CONFIGURED)) {
+ if ((g_ftdm_sngss7_data.cfg.isap[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.isap[x].flags & SNGSS7_CONFIGURED))) {
if (ftmod_ss7_isup_isap_config(x)) {
SS7_CRITICAL("ISUP ISAP %d configuration FAILED!\n", x);
} /* if !SNGSS7_CONFIGURED */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.isap[x].id != 0) */
+ } /* while (x < (MAX_ISAPS)) */
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP)) {
x = 1;
- while (g_ftdm_sngss7_data.cfg.isupIntf[x].id != 0) {
+ while (x < (MAX_ISUP_INFS)) {
/* check if this link has been configured already */
- if (!(g_ftdm_sngss7_data.cfg.isupIntf[x].flags & SNGSS7_CONFIGURED)) {
+ if ((g_ftdm_sngss7_data.cfg.isupIntf[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.isupIntf[x].flags & SNGSS7_CONFIGURED))) {
if (ftmod_ss7_isup_intf_config(x)) {
SS7_CRITICAL("ISUP INTF %d configuration FAILED!\n", x);
} /* if !SNGSS7_CONFIGURED */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.isupIntf[x].id != 0) */
+ } /* while (x < (MAX_ISUP_INFS)) */
} /* if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP)) */
x = (g_ftdm_sngss7_data.cfg.procId * 1000) + 1;
while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {
+ /* check if this link has been configured already */
+ if ((g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.isupCkt[x].flags & SNGSS7_CONFIGURED))) {
- if (ftmod_ss7_isup_ckt_config(x)) {
- SS7_CRITICAL("ISUP CKT %d configuration FAILED!\n", x);
- return 1;
- } else {
- SS7_INFO("ISUP CKT %d configuration DONE!\n", x);
- }
+ if (ftmod_ss7_isup_ckt_config(x)) {
+ SS7_CRITICAL("ISUP CKT %d configuration FAILED!\n", x);
+ return 1;
+ } else {
+ SS7_INFO("ISUP CKT %d configuration DONE!\n", x);
+ }
- /* set the SNGSS7_CONFIGURED flag */
- g_ftdm_sngss7_data.cfg.isupCkt[x].flags |= SNGSS7_CONFIGURED;
+ /* set the SNGSS7_CONFIGURED flag */
+ g_ftdm_sngss7_data.cfg.isupCkt[x].flags |= SNGSS7_CONFIGURED;
+ } /* if !SNGSS7_CONFIGURED */
x++;
} /* while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) */
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the status request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Failed to find link=\"%s\"\n", name);
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp2Link[x].name, name)) {
/* send the status request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Failed to find link=\"%s\"\n", name);
/* find the linkset request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) {
+ while(x < (MAX_MTP_LINKSETS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].name, name)) {
/* send the status request */
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the inhibit request */
/* move to the next linkset */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Failed to find link=\"%s\"\n", name);
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the uninhibit request */
/* move to the next linkset */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Failed to find link=\"%s\"\n", name);
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the uninhibit request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Could not find link=%s\n", name);
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the uninhibit request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Could not find link=%s\n", name);
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the uninhibit request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Could not find link=%s\n", name);
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the deactivate request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Could not find link=%s\n", name);
/* find the linkset request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) {
+ while(x < (MAX_MTP_LINKSETS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].name, name)) {
/* send the activate request */
/* find the linkset request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) {
+ while(x < (MAX_MTP_LINKSETS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].name, name)) {
/* send the deactivate request */
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the uninhibit request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Could not find link=%s\n", name);
/* find the link request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while(x < (MAX_MTP_LINKS+1)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.mtp3Link[x].name, name)) {
/* send the uninhibit request */
/* move to the next link */
x++;
- } /* while (id != 0) */
+ } /* while (x < (MAX_MTP_LINKS+1)) */
stream->write_function(stream, "Could not find link=%s\n", name);
/* find the channel request by it's name */
x = 1;
- while(g_ftdm_sngss7_data.cfg.relay[x].id != 0) {
+ while(x < (MAX_RELAY_CHANNELS)) {
if (!strcasecmp(g_ftdm_sngss7_data.cfg.relay[x].name, name)) {
if (ftmod_ss7_relay_status(g_ftdm_sngss7_data.cfg.relay[x].id, &sta)) {
/* move to the next link */
x++;
- } /* g_ftdm_sngss7_data.cfg.relay[x].id */
+ } /* x < (MAX_RELAY_CHANNELS) */
success:
return FTDM_SUCCESS;
int x;
x = 1;
- while (g_ftdm_sngss7_data.cfg.isap[x].id != 0) {
+ while (x < (MAX_ISAPS)) {
/* check if this link has already been actived */
- if (!(g_ftdm_sngss7_data.cfg.isap[x].flags & SNGSS7_ACTIVE)) {
+ if ((g_ftdm_sngss7_data.cfg.isap[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.isap[x].flags & SNGSS7_ACTIVE))) {
if (ftmod_ss7_enable_isap(x)) {
SS7_CRITICAL("ISAP %d Enable: NOT OK\n", x);
} /* if !SNGSS7_ACTIVE */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.isap[x].id != 0) */
+ } /* while (x < (MAX_ISAPS)) */
x = 1;
- while (g_ftdm_sngss7_data.cfg.nsap[x].id != 0) {
+ while (x < (MAX_NSAPS)) {
/* check if this link has already been actived */
- if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_ACTIVE)) {
+ if ((g_ftdm_sngss7_data.cfg.nsap[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_ACTIVE))) {
if (ftmod_ss7_enable_nsap(x)) {
SS7_CRITICAL("NSAP %d Enable: NOT OK\n", x);
} /* if !SNGSS7_ACTIVE */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.nsap[x].id != 0) */
+ } /* while (x < (MAX_NSAPS)) */
if (g_ftdm_sngss7_data.cfg.mtpRoute[1].id != 0) {
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) {
+ while (x < (MAX_MTP_LINKSETS+1)) {
/* check if this link has already been actived */
- if (!(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].flags & SNGSS7_ACTIVE)) {
+ if ((g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) &&
+ (!(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].flags & SNGSS7_ACTIVE))) {
if (ftmod_ss7_enable_mtpLinkSet(x)) {
SS7_CRITICAL("LinkSet \"%s\" Enable: NOT OK\n", g_ftdm_sngss7_data.cfg.mtpLinkSet[x].name);
} /* if !SNGSS7_ACTIVE */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) */
+ } /* while (x < (MAX_MTP_LINKSETS+1)) */
}
return 0;
/* find the name for the sap in question */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) {
+ while (x < (MAX_MTP_LINKS+1)) {
if (g_ftdm_sngss7_data.cfg.mtp2Link[x].id == sta->t.usta.evntParm[0]) {
break;
}
/* find the name for the sap in question */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) {
+ while (x < (MAX_MTP_LINKS+1)) {
if (g_ftdm_sngss7_data.cfg.mtp2Link[x].id == sta->t.usta.evntParm[0]) {
break;
}
/* find the name for the sap in question */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) {
+ while (x < (MAX_MTP_LINKS+1)) {
if (g_ftdm_sngss7_data.cfg.mtp2Link[x].id == sta->t.usta.evntParm[0]) {
break;
}
/* find the name for the sap in question */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) {
+ while (x < (MAX_MTP_LINKS+1)) {
if (g_ftdm_sngss7_data.cfg.mtp2Link[x].id == sta->t.usta.evntParm[0]) {
break;
}
/* find the name for the sap in question */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) {
+ while (x < (MAX_MTP_LINKS+1)) {
if (g_ftdm_sngss7_data.cfg.mtp2Link[x].id == sta->t.usta.evntParm[0]) {
break;
}
/* find the name for the sap in question */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtp2Link[x].id != 0) {
+ while (x < (MAX_MTP_LINKS+1)) {
if (g_ftdm_sngss7_data.cfg.mtp2Link[x].id == sta->t.usta.evntParm[0]) {
break;
}
/* find the name for the sap in question */
x = 1;
- while (g_ftdm_sngss7_data.cfg.mtp3Link[x].id != 0) {
+ while (x < (MAX_MTP_LINKS+1)) {
if (g_ftdm_sngss7_data.cfg.mtp3Link[x].id == sta->hdr.elmId.elmntInst1) {
break;
}
}
} /* if (sngss7_test_flag(sngss7_info, FLAG_INFID_RESUME)) */
- if ((sngss7_test_ckt_flag(sngss7_info, FLAG_INFID_PAUSED)) &&
- (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_SIG_UP))) {
+ if (sngss7_test_ckt_flag(sngss7_info, FLAG_INFID_PAUSED)) {
SS7_DEBUG_CHAN(ftdmchan, "Processing PAUSE%s\n", "");
- /* bring the sig status down */
- sngss7_set_sig_status(sngss7_info, FTDM_SIG_STATE_DOWN);
+ if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_SIG_UP)) {
+ /* bring the sig status down */
+ sigev.event_id = FTDM_SIGEVENT_SIGSTATUS_CHANGED;
+ sigev.ev_data.sigstatus.status = FTDM_SIG_STATE_DOWN;
+ ftdm_span_send_signal(ftdmchan->span, &sigev);
+ }
} /* if (sngss7_test_ckt_flag(sngss7_info, FLAG_INFID_PAUSED)) { */
/**********************************************************************/
- if (sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_BLOCK_RX) &&
+ if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_MN_BLOCK_RX))&&
!sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_BLOCK_RX_DN)) {
+
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_MN_BLOCK_RX flag %s\n", "");
/* bring the sig status down */
goto suspend_goto_last;
}
- if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_MN_UNBLK_RX) &&
- !sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_MN_UNBLK_RX_DN)){
+ if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_MN_UNBLK_RX)){
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_MN_UNBLK_RX flag %s\n", "");
/* clear the block flags */
/**********************************************************************/
if (sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_BLOCK_TX) &&
!sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_MN_BLOCK_TX_DN)) {
+
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_MN_BLOCK_TX flag %s\n", "");
/* bring the sig status down */
goto suspend_goto_last;
}
- if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_MN_UNBLK_TX) &&
- !sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_MN_UNBLK_TX_DN)){
+ 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", "");
/* clear the block flags */
/**********************************************************************/
if (sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_LC_BLOCK_RX) &&
!sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_LC_BLOCK_RX_DN)) {
+
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_LC_BLOCK_RX flag %s\n", "");
/* send a BLA */
goto suspend_goto_last;
}
- if (sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_LC_UNBLK_RX) &&
- !sngss7_test_ckt_blk_flag(sngss7_info, FLAG_CKT_LC_UNBLK_RX_DN)) {
+ if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_LC_UNBLK_RX)) {
+
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_LC_UNBLK_RX flag %s\n", "");
/* clear the block flags */
/**********************************************************************/
if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_UCIC_BLOCK) &&
!sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_UCIC_BLOCK_DN)) {
+
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_UCIC_BLOCK flag %s\n", "");
/* bring the channel signaling status to down */
goto suspend_goto_last;
}
- if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_UCIC_UNBLK) &&
- !sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_UCIC_UNBLK_DN)) {
+ if (sngss7_test_ckt_blk_flag (sngss7_info, FLAG_CKT_UCIC_UNBLK)) {
SS7_DEBUG_CHAN(ftdmchan, "Processing CKT_UCIC_UNBLK flag %s\n", "");
/* remove the UCIC block flag */
goto suspend_goto_restart;
}
- SS7_ERROR_CHAN(ftdmchan,"No block flag processed!%s\n", "");
+ SS7_DEBUG_CHAN(ftdmchan,"No block flag processed!%s\n", "");
suspend_goto_last:
state_flag = 0;
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_RY)) {
/* go through all the relays channels and configure it */
x = 1;
- while (g_ftdm_sngss7_data.cfg.relay[x].id != 0) {
+ while (x < (MAX_RELAY_CHANNELS)) {
/* check if this relay channel has been configured already */
if ((g_ftdm_sngss7_data.cfg.relay[x].flags & SNGSS7_CONFIGURED)) {
g_ftdm_sngss7_data.cfg.relay[x].flags &= !SNGSS7_CONFIGURED;
} /* if !SNGSS7_CONFIGURED */
x++;
- } /* while (g_ftdm_sngss7_data.cfg.relay[x].id != 0) */
+ } /* while (x < (MAX_RELAY_CHANNELS)) */
ftmod_ss7_shutdown_relay();
sng_isup_free_relay();
/* go through all the isupIntfs and ask the stack to give their current state */
x = 1;
- for (x = 1; x < (MAX_ISUP_INFS + 1); x++) {
+ for (x = 1; x < (MAX_ISUP_INFS); x++) {
/**************************************************************************/
if (g_ftdm_sngss7_data.cfg.isupIntf[x].id == 0) continue;
} /* switch (status) */
/**************************************************************************/
- } /* for (x = 1; x < MAX_ISUP_INFS + 1); i++) */
+ } /* for (x = 1; x < MAX_ISUP_INFS); i++) */
return FTDM_SUCCESS;
}
/* go through all the mtp3 links and fill in the apc */
i = 1;
- while (g_ftdm_sngss7_data.cfg.mtp3Link[i].id != 0) {
+ while (i < (MAX_MTP_LINKS)) {
if (g_ftdm_sngss7_data.cfg.mtp3Link[i].linkSetId == mtpLinkSet.id) {
g_ftdm_sngss7_data.cfg.mtp3Link[i].apc = mtpLinkSet.apc;
}
/**************************************************************************/
/* go through all the links and check if they belong to this linkset*/
i = 1;
- while (g_ftdm_sngss7_data.cfg.mtp3Link[i].id != 0) {
+ while (i < (MAX_MTP_LINKS)) {
/* check if this link is in the linkset */
if (g_ftdm_sngss7_data.cfg.mtp3Link[i].linkSetId == lnkSet->lsId) {
/* fill in the spc */
{
int i = 1;
- while (g_ftdm_sngss7_data.cfg.mtpRoute[i].id != 0) {
+ while (i < (MAX_MTP_ROUTES)) {
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].dpc == spc) {
/* we have a match so break out of this loop */
break;
}
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
+ /* this is a new route...find the first free spot */
+ i = 1;
+ while (i < (MAX_MTP_ROUTES)) {
+ if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
+ /* we have a match so break out of this loop */
+ break;
+ }
+ /* move on to the next one */
+ i++;
+ }
g_ftdm_sngss7_data.cfg.mtpRoute[i].id = i;
SS7_DEBUG("found new mtp3 self route\n");
} else {