]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3218 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 1 Apr 2011 01:03:31 +0000 (20:03 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 1 Apr 2011 01:03:31 +0000 (20:03 -0500)
src/switch_core_state_machine.c

index e2d50704b57cd1299875fc2054188e0de722dda0..e69c408013f861f558429f9798533a94a545fec9 100644 (file)
@@ -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) {