Fix switch_ivr_parse_event() to not hangup a session when there is no media yet

If the lead-frames header is set but there is no media ready yet do not
attempt to read media from the channel and continue with command execution

FS-7455 #resolve
This commit is contained in:
Moises Silva 2015-04-20 18:23:57 -04:00
parent 777c1154ee
commit b4250c87a5

View File

@ -521,7 +521,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se
elp = 1;
}
if (lead_frames) {
if (lead_frames && switch_channel_media_ready(channel)) {
switch_frame_t *read_frame;
int frame_count = atoi(lead_frames);
int max_frames = frame_count * 2;