]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: fix REL receiving leg always stay in TERMINATING stae in
authorJames Zhang <jzhang@sangoma.com>
Mon, 16 Apr 2012 17:48:35 +0000 (13:48 -0400)
committerJames Zhang <jzhang@sangoma.com>
Mon, 16 Apr 2012 17:48:35 +0000 (13:48 -0400)
         native bridge mode
         - This is supposed to be included in commit of
           b324f8679782957bc9db3bdfd6687aa42cba77dd. Somehow it's
           not included in that commit. Without this change, the
           REL receiving leg always stay in TERMINATING state when
           received an incoming REL message.

libs/freetdm/src/ftdm_io.c

index 513fc0c595a578b176522a70c26e7b4827a82ba8..1c057971026ab902198ec48269f8139ff1a0ef1e 100644 (file)
@@ -2199,9 +2199,12 @@ static ftdm_status_t _ftdm_channel_call_hangup_nl(const char *file, const char *
 {
        ftdm_status_t status = FTDM_SUCCESS;
 
-       if (ftdm_test_flag(chan, FTDM_CHANNEL_NATIVE_SIGBRIDGE)) {
+       /* In native sigbridge mode we ignore hangup requests from the user and hangup only when the signaling module decides it */
+       if (ftdm_test_flag(chan, FTDM_CHANNEL_NATIVE_SIGBRIDGE) && chan->state != FTDM_CHANNEL_STATE_TERMINATING) {
+
                ftdm_log_chan_ex(chan, file, func, line, FTDM_LOG_LEVEL_DEBUG, 
                                "Ignoring hangup in channel in state %s (native bridge enabled)\n", ftdm_channel_state2str(chan->state));
+               ftdm_set_flag(chan, FTDM_CHANNEL_USER_HANGUP);
                goto done;
        }