]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3373 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 27 Jun 2011 15:01:06 +0000 (10:01 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 27 Jun 2011 15:01:06 +0000 (10:01 -0500)
src/switch_ivr.c

index 92eb97ef12614b66cfddb58a2d7bd6ff9ade85ef..6c1202a4ed394b58197cb71e215a1a4a7dd96c54 100644 (file)
@@ -151,7 +151,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
         */
 
        if (!switch_channel_media_ready(channel)) {
-               switch_yield(ms * 1000);
+               
+               for (elapsed=0; elapsed<(ms/20); elapsed++) {
+                       if (switch_channel_test_flag(channel, CF_BREAK)) {
+                               switch_channel_clear_flag(channel, CF_BREAK);
+                               return SWITCH_STATUS_BREAK;
+                       }
+               
+                       switch_yield(20 * 1000);
+               }
                return SWITCH_STATUS_SUCCESS;
        }