From 1ef78b928f67558dfe34064fec4b0956f2a705ce Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sun, 28 Jan 2007 03:17:12 +0000 Subject: [PATCH] fix sleep to work right on unanswered channels git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4072 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 7774042b45..6af32747f6 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -71,7 +71,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, break; } - if (switch_channel_test_flag(channel, CF_SERVICE)) { + if (switch_channel_test_flag(channel, CF_SERVICE) || + (!switch_channel_test_flag(channel, CF_ANSWERED) && !switch_channel_test_flag(channel, CF_EARLY_MEDIA))) { switch_yield(1000); } else { status = switch_core_session_read_frame(session, &read_frame, left, 0);