]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: added support for skip states, used by sangoma_isdn module
authorDavid Yat Sin <dyatsin@sangoma.com>
Thu, 9 Dec 2010 23:01:31 +0000 (18:01 -0500)
committerDavid Yat Sin <dyatsin@sangoma.com>
Thu, 9 Dec 2010 23:01:31 +0000 (18:01 -0500)
libs/freetdm/src/ftdm_io.c
libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.c
libs/freetdm/src/include/private/ftdm_types.h

index 605f13c0bcc8de13a5bf642f49aadea2a06a95a2..eaa25e3da554edb096aad568dc0c179bd480deb2 100644 (file)
@@ -2213,31 +2213,31 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_answer(const char *file, const char
                goto done;
        }
 
-#ifndef FREETDM_SKIP_SIG_STATES
-       /* We will fail RFC's if we not skip states, but some modules apart from ftmod_sangoma_isdn 
-        * expect the call to always to go PROGRESS and PROGRESS MEDIA state before going to UP, so 
-        * remove this only in netborder branch for now while we update the sig modules */
+       if (!ftdm_test_flag(ftdmchan->span, FTDM_SPAN_USE_SKIP_STATES)) {
+               /* We will fail RFC's if we not skip states, but some modules apart from ftmod_sangoma_isdn 
+               * expect the call to always to go PROGRESS and PROGRESS MEDIA state before going to UP, so
+               * use FTDM_SPAN_USE_SKIP_STATESfor now while we update the sig modules */
 
-       if (ftdmchan->state < FTDM_CHANNEL_STATE_PROGRESS) {
-               ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROGRESS, 1);
-       }
+               if (ftdmchan->state < FTDM_CHANNEL_STATE_PROGRESS) {
+                       ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROGRESS, 1);
+               }
 
-       /* set state unlocks the channel so we need to re-confirm that the channel hasn't gone to hell */
-       if (ftdmchan->state == FTDM_CHANNEL_STATE_TERMINATING) {
-               ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Ignoring answer because the call has moved to TERMINATING while we're moving to PROGRESS\n");
-               goto done;
-       }
+               /* set state unlocks the channel so we need to re-confirm that the channel hasn't gone to hell */
+               if (ftdmchan->state == FTDM_CHANNEL_STATE_TERMINATING) {
+                       ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Ignoring answer because the call has moved to TERMINATING while we're moving to PROGRESS\n");
+                       goto done;
+               }
 
-       if (ftdmchan->state < FTDM_CHANNEL_STATE_PROGRESS_MEDIA) {
-               ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, 1);
-       }
+               if (ftdmchan->state < FTDM_CHANNEL_STATE_PROGRESS_MEDIA) {
+                       ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_PROGRESS_MEDIA, 1);
+               }
 
-       /* set state unlocks the channel so we need to re-confirm that the channel hasn't gone to hell */
-       if (ftdmchan->state == FTDM_CHANNEL_STATE_TERMINATING) {
-               ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Ignoring answer because the call has moved to TERMINATING while we're moving to UP\n");
-               goto done;
+               /* set state unlocks the channel so we need to re-confirm that the channel hasn't gone to hell */
+               if (ftdmchan->state == FTDM_CHANNEL_STATE_TERMINATING) {
+                       ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Ignoring answer because the call has moved to TERMINATING while we're moving to UP\n");
+                       goto done;
+               }
        }
-#endif
        ftdm_channel_set_state(file, func, line, ftdmchan, FTDM_CHANNEL_STATE_UP, 1);
 
 done:
index 96f1a2b430419c3d78f18e314688370c6937f382..e20d3ae7e0b17edbe275224e72feed414c61ef74 100644 (file)
@@ -1067,6 +1067,7 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_sangoma_isdn_span_config)
        ftdm_set_flag(span, FTDM_SPAN_USE_CHAN_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_SKIP_STATES);
 
        if (span->trunk_type == FTDM_TRUNK_BRI_PTMP ||
                span->trunk_type == FTDM_TRUNK_BRI) {
index df747021b227a08e6c136f4ccc8160b7bf2e62ef..313044abc4538f983cddcd010e22307021dc1441 100644 (file)
@@ -184,6 +184,9 @@ typedef enum {
        FTDM_SPAN_USE_SIGNALS_QUEUE = (1 << 10),
        /* If this flag is set, channel will be moved to proceed state when calls goes to routing */
        FTDM_SPAN_USE_PROCEED_STATE = (1 << 11),
+       /* If this flag is set, the signalling module supports jumping directly to state up, without
+               going through PROGRESS/PROGRESS_MEDIA */
+       FTDM_SPAN_USE_SKIP_STATES = (1 << 12),
 } ftdm_span_flag_t;
 
 /*! \brief Channel supported features */