} else { /* time off the channel (if you must) */
switch_frame_t *read_frame;
switch_status_t status;
- while (switch_channel_test_flag(channel, CF_HOLD)) {
+ while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
switch_yield(10000);
}
status = switch_core_session_read_frame(session, &read_frame, -1, 0);
switch_frame_t *read_frame;
switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
- while (switch_channel_test_flag(channel, CF_HOLD)) {
+ while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
switch_yield(10000);
}
switch_frame_t *read_frame;
switch_status_t status = switch_core_session_read_frame(session, &read_frame, -1, 0);
- while (switch_channel_test_flag(channel, CF_HOLD)) {
+ while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) {
switch_yield(10000);
}