From 8c97af6e5c9f2be55244e0297bf6a4a0ea2a44c0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 20 Feb 2009 15:30:01 +0000 Subject: [PATCH] don't execute apps on channels that are hungup git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12177 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_session.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index ca7bb5239b..f026aa0c09 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -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);