break;
/**************************************************************************/
case (LRY_USTA_UP): /* channel up */
- ftdm_log(FTDM_LOG_ERROR,"[RELAY] Channel UP: tx procId %d: channel %d\n",
+ ftdm_log(FTDM_LOG_INFO,"[RELAY] Channel UP: tx procId %d: channel %d\n",
sta->t.usta.s.ryUpUsta.sendPid,
sta->t.usta.s.ryUpUsta.id);
static ftdm_status_t ftdm_sangoma_ss7_stop(ftdm_span_t * span)
{
/*this function is called by the FT-Core to stop this span */
+ int timeout=0;
ftdm_log (FTDM_LOG_INFO, "Stopping span %s:%u.\n", span->name,span->span_id);
/* wait for the thread to stop */
while (ftdm_test_flag (span, FTDM_SPAN_IN_THREAD)) {
- ftdm_log (FTDM_LOG_DEBUG,"Waiting for monitor thread to end for %s:%u.\n",
+ ftdm_set_flag (span, FTDM_SPAN_STOP_THREAD);
+ ftdm_log (FTDM_LOG_DEBUG,"Waiting for monitor thread to end for %s:%u. [flags=0x%08X]\n",
span->name,
- span->span_id);
- ftdm_sleep (1);
+ span->span_id,
+ span->flags);
+ /* Wait 50ms */
+ ftdm_sleep (50);
+ timeout++;
+
+ /* timeout after 5 sec, better to crash than hang */
+ ftdm_assert_return(timeout < 100, FTDM_FALSE, "SS7 Span stop timeout!\n");
}
/* KONRAD FIX ME - deconfigure any circuits, links, attached to this span */
/* parse the configuration and apply to the global config structure */
if (ftmod_ss7_parse_xml(ftdm_parameters, span)) {
ftdm_log (FTDM_LOG_CRIT, "Failed to parse configuration!\n");
+ ftdm_sleep (1000);
return FTDM_FAIL;
}
/* configure libsngss7 */
if (ft_to_sngss7_cfg_all()) {
ftdm_log (FTDM_LOG_CRIT, "Failed to configure LibSngSS7!\n");
+ ftdm_sleep (1000);
return FTDM_FAIL;
}
#define SS7_ERROR_CHAN(fchan, msg, args...) ftdm_log_chan(fchan, FTDM_LOG_ERROR, msg , ##args)
#define SS7_CTRIT_CHAN(fchan, msg, args...) ftdm_log_chan(fchan, FTDM_LOG_CRIT, msg , ##args)
-#ifdef KONRAD_DEVEL
+#ifdef SS7_CODE_DEVEL
#define SS7_DEVEL_DEBUG(a,...) ftdm_log(FTDM_LOG_DEBUG,a,##__VA_ARGS__ );
#else
#define SS7_DEVEL_DEBUG(a,...)
/******************************************************************************/
ftdm_status_t extract_chan_data(uint32_t circuit, sngss7_chan_data_t **sngss7_info, ftdm_channel_t **ftdmchan)
{
- if (g_ftdm_sngss7_data.cfg.isupCkt[circuit].obj == NULL) {
- SS7_ERROR("sngss7_info is Null for circuit #%d\n", circuit);
- return FTDM_FAIL;
- }
-
if (!g_ftdm_sngss7_data.cfg.isupCkt[circuit].obj) {
SS7_ERROR("No ss7 info for circuit #%d\n", circuit);
return FTDM_FAIL;
*sngss7_info = g_ftdm_sngss7_data.cfg.isupCkt[circuit].obj;
if (!(*sngss7_info)->ftdmchan) {
- SS7_ERROR("No channel for circuit #%d\n", circuit);
+ SS7_ERROR("No ftdmchan for circuit #%d\n", circuit);
+ return FTDM_FAIL;
+ }
+
+ if (!(*sngss7_info)->ftdmchan->span) {
+ SS7_CRITICAL("ftdmchan->span = NULL for circuit #%d\n",circuit);
return FTDM_FAIL;
+
+ }
+ if (!(*sngss7_info)->ftdmchan->span->signal_data) {
+ SS7_CRITICAL("ftdmchan->span->signal_data = NULL for circuit #%d\n",circuit);
+ return FTDM_FAIL;
+
}
*ftdmchan = (*sngss7_info)->ftdmchan;
(g_ftdm_sngss7_data.cfg.isupCkt[x].chan == count)) {
/* we are processing a circuit that already exists */
- SS7_DEBUG("Found an existing circuit %d, ccSpanId=%d, chan%d\n",
+ SS7_DEVEL_DEBUG("Found an existing circuit %d, ccSpanId=%d, chan%d\n",
x,
ccSpan->id,
count);
flag = 1;
/* not supporting reconfig at this time */
- SS7_DEBUG("Not supporting ckt reconfig at this time!\n");
+ SS7_DEVEL_DEBUG("Not supporting ckt reconfig at this time!\n");
goto move_along;
} else {
/* this is not the droid you are looking for */