diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 7cda473565..b8c8a69204 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -1066,11 +1066,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_session(switch_core_session switch_core_session_message_t msg = { 0 }; char cid_buf[1024] = ""; switch_caller_profile_t *cp = NULL; + uint32_t sanity = 600; if (!switch_channel_media_ready(channel)) { goto end; } + while(switch_channel_state_change_pending(tchannel)) { + switch_yield(10000); + if (!--sanity) break; + } + if (!switch_channel_media_ready(tchannel)) { goto end; }