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
This commit is contained in:
Anthony Minessale 2009-02-20 15:30:01 +00:00
parent ff1a9d091e
commit 8c97af6e5c
1 changed files with 5 additions and 0 deletions

View File

@ -1238,6 +1238,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_execute_application(switch_c
{ {
switch_application_interface_t *application_interface; 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) { 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_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Application %s\n", app);
switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); switch_channel_hangup(session->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);