提交 62941f69 authored 作者: David Yat Sin's avatar David Yat Sin

Added FTDM_SPAN_NON_STOPPABLE flag for signalling modules that do not support individual start/stop

上级 21f8605d
...@@ -634,6 +634,10 @@ static ftdm_status_t ftdm_span_destroy(ftdm_span_t *span) ...@@ -634,6 +634,10 @@ static ftdm_status_t ftdm_span_destroy(ftdm_span_t *span)
ftdm_mutex_lock(span->mutex); ftdm_mutex_lock(span->mutex);
/* stop the signaling */ /* stop the signaling */
/* This is a forced stopped */
ftdm_clear_flag(span, FTDM_SPAN_NON_STOPPABLE);
ftdm_span_stop(span); ftdm_span_stop(span);
/* destroy the channels */ /* destroy the channels */
...@@ -739,6 +743,11 @@ FT_DECLARE(ftdm_status_t) ftdm_span_stop(ftdm_span_t *span) ...@@ -739,6 +743,11 @@ FT_DECLARE(ftdm_status_t) ftdm_span_stop(ftdm_span_t *span)
ftdm_status_t status = FTDM_SUCCESS; ftdm_status_t status = FTDM_SUCCESS;
ftdm_mutex_lock(span->mutex); ftdm_mutex_lock(span->mutex);
if (ftdm_test_flag(span, FTDM_SPAN_NON_STOPPABLE)) {
status = FTDM_NOTIMPL;
goto done;
}
if (!ftdm_test_flag(span, FTDM_SPAN_STARTED)) { if (!ftdm_test_flag(span, FTDM_SPAN_STARTED)) {
status = FTDM_EINVAL; status = FTDM_EINVAL;
......
...@@ -1094,6 +1094,7 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_isdn_span_config) ...@@ -1094,6 +1094,7 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_isdn_span_config)
ftdm_set_flag(span, FTDM_SPAN_USE_SIGNALS_QUEUE); ftdm_set_flag(span, FTDM_SPAN_USE_SIGNALS_QUEUE);
ftdm_set_flag(span, FTDM_SPAN_USE_PROCEED_STATE); ftdm_set_flag(span, FTDM_SPAN_USE_PROCEED_STATE);
ftdm_set_flag(span, FTDM_SPAN_USE_SKIP_STATES); ftdm_set_flag(span, FTDM_SPAN_USE_SKIP_STATES);
ftdm_set_flag(span, FTDM_SPAN_NON_STOPPABLE);
if (span->trunk_type == FTDM_TRUNK_BRI_PTMP || if (span->trunk_type == FTDM_TRUNK_BRI_PTMP ||
span->trunk_type == FTDM_TRUNK_BRI) { span->trunk_type == FTDM_TRUNK_BRI) {
......
...@@ -186,6 +186,9 @@ typedef enum { ...@@ -186,6 +186,9 @@ typedef enum {
/* If this flag is set, the signalling module supports jumping directly to state up, without /* If this flag is set, the signalling module supports jumping directly to state up, without
going through PROGRESS/PROGRESS_MEDIA */ going through PROGRESS/PROGRESS_MEDIA */
FTDM_SPAN_USE_SKIP_STATES = (1 << 12), FTDM_SPAN_USE_SKIP_STATES = (1 << 12),
/* If this flag is set, then this span cannot be stopped individually, it can only be stopped
on freetdm unload */
FTDM_SPAN_NON_STOPPABLE = (1 << 13),
} ftdm_span_flag_t; } ftdm_span_flag_t;
/*! \brief Channel supported features */ /*! \brief Channel supported features */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论