提交 20461f1c authored 作者: Konrad Hammel's avatar Konrad Hammel

freetdm: ss7 - bug fix for race condition on start

上级 7fe291f1
...@@ -1370,21 +1370,6 @@ static ftdm_status_t ftdm_sangoma_ss7_start(ftdm_span_t * span) ...@@ -1370,21 +1370,6 @@ static ftdm_status_t ftdm_sangoma_ss7_start(ftdm_span_t * span)
ftdm_clear_flag (span, FTDM_SPAN_STOP_THREAD); ftdm_clear_flag (span, FTDM_SPAN_STOP_THREAD);
ftdm_clear_flag (span, FTDM_SPAN_IN_THREAD); ftdm_clear_flag (span, FTDM_SPAN_IN_THREAD);
/* activate all the configured ss7 links */
if (ft_to_sngss7_activate_all()) {
SS7_CRITICAL ("Failed to activate LibSngSS7!\n");
return FTDM_FAIL;
}
/*start the span monitor thread */
if (ftdm_thread_create_detached (ftdm_sangoma_ss7_run, span) != FTDM_SUCCESS) {
SS7_CRITICAL ("Failed to start Span Monitor Thread!\n");
return FTDM_FAIL;
}
/* confirm the state of all isup interfaces*/
check_status_of_all_isup_intf();
/* throw the channels in pause */ /* throw the channels in pause */
for (x = 1; x < (span->chan_count + 1); x++) { for (x = 1; x < (span->chan_count + 1); x++) {
/* extract the channel structure and sngss7 channel data */ /* extract the channel structure and sngss7 channel data */
...@@ -1437,6 +1422,18 @@ static ftdm_status_t ftdm_sangoma_ss7_start(ftdm_span_t * span) ...@@ -1437,6 +1422,18 @@ static ftdm_status_t ftdm_sangoma_ss7_start(ftdm_span_t * span)
ftdm_mutex_unlock(ftdmchan->mutex); ftdm_mutex_unlock(ftdmchan->mutex);
} }
/* activate all the configured ss7 links */
if (ft_to_sngss7_activate_all()) {
SS7_CRITICAL ("Failed to activate LibSngSS7!\n");
return FTDM_FAIL;
}
/*start the span monitor thread */
if (ftdm_thread_create_detached (ftdm_sangoma_ss7_run, span) != FTDM_SUCCESS) {
SS7_CRITICAL ("Failed to start Span Monitor Thread!\n");
return FTDM_FAIL;
}
SS7_DEBUG ("Finished starting span %s:%u.\n", span->name, span->span_id); SS7_DEBUG ("Finished starting span %s:%u.\n", span->name, span->span_id);
return FTDM_SUCCESS; return FTDM_SUCCESS;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论