From: Anthony Minessale Date: Fri, 1 Apr 2011 01:03:31 +0000 (-0500) Subject: FS-3218 --resolve X-Git-Tag: v1.2-rc1~120^2~5^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5daf80ef84d3e70bf0946cdc0f842dd0c272480;p=thirdparty%2Ffreeswitch.git FS-3218 --resolve --- diff --git a/src/switch_core_state_machine.c b/src/switch_core_state_machine.c index e2d50704b5..e69c408013 100644 --- a/src/switch_core_state_machine.c +++ b/src/switch_core_state_machine.c @@ -306,7 +306,12 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session_t *session) while ((state = switch_channel_get_state(session->channel)) != CS_DESTROY) { - switch_channel_wait_for_flag(session->channel, CF_BLOCK_STATE, SWITCH_FALSE, 0, NULL); + if (switch_channel_test_flag(session->channel, CF_BLOCK_STATE)) { + switch_channel_wait_for_flag(session->channel, CF_BLOCK_STATE, SWITCH_FALSE, 0, NULL); + if ((state = switch_channel_get_state(session->channel)) == CS_DESTROY) { + break; + } + } midstate = state; if (state != switch_channel_get_running_state(session->channel) || state >= CS_HANGUP) {