fix sleep to work right on unanswered channels

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4072 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-01-28 03:17:12 +00:00
parent 066807ed52
commit 1ef78b928f

View File

@ -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);