}
while (!(tech_pvt->read_codec.implementation && switch_rtp_ready(tech_pvt->rtp_session) && !switch_channel_test_flag(channel, CF_REQ_MEDIA))) {
+ switch_ivr_parse_all_messages(tech_pvt->session);
+
if (--sanity && switch_channel_up(channel)) {
switch_yield(10000);
} else {
switch_assert(channel != NULL);
+ switch_ivr_parse_all_messages(channel->session);
+
if (check_media) {
ret = ((switch_channel_test_flag(channel, CF_ANSWERED) ||
switch_channel_test_flag(channel, CF_EARLY_MEDIA)) && !switch_channel_test_flag(channel, CF_PROXY_MODE) &&
switch_assert(session != NULL);
- if (session->message_queue) {
+ if (session->message_queue && switch_queue_size(session->message_queue)) {
if ((status = (switch_status_t) switch_queue_trypop(session->message_queue, &pop)) == SWITCH_STATUS_SUCCESS) {
*message = (switch_core_session_message_t *) pop;
if ((*message)->delivery_time && (*message)->delivery_time > switch_epoch_time_now(NULL)) {