FS-11820 [core] check read_frame_callback in switch_ivr_sleep()

This commit is contained in:
Chris Rienzo 2019-04-29 19:17:13 +00:00 committed by Andrey Volk
parent 295982dafa
commit ab7c9f6f2e
1 changed files with 6 additions and 0 deletions

View File

@ -303,6 +303,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
}
}
if (read_frame && args && (args->read_frame_callback)) {
if ((status = args->read_frame_callback(session, read_frame, args->user_data)) != SWITCH_STATUS_SUCCESS) {
break;
}
}
if (sval && write_frame.datalen) {
switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, imp.number_of_channels, sval);
switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0);