]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't execute apps on channels that are hungup
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 20 Feb 2009 15:30:01 +0000 (15:30 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 20 Feb 2009 15:30:01 +0000 (15:30 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12177 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_session.c

index ca7bb5239b710446eaa955bb10ba4949ee248050..f026aa0c096d5b8b40055d4b0ccab5841ec47427 100644 (file)
@@ -1238,6 +1238,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application(switch_c
 {
        switch_application_interface_t *application_interface;
 
+       if (switch_channel_get_state(session->channel) >= CS_HANGUP) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel is hungup, aborting execution of application: %s\n", app);
+               return SWITCH_STATUS_FALSE;
+       }
+
        if ((application_interface = switch_loadable_module_get_application_interface(app)) == 0) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Application %s\n", app);
                switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);