}
if (switch_core_session_read_frame(session_a, &read_frame, -1) == SWITCH_STATUS_SUCCESS && read_frame->datalen) {
if (switch_core_session_write_frame(session_b, read_frame, -1) != SWITCH_STATUS_SUCCESS) {
- switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Bad Frame.... %d Bubye!\n", read_frame->datalen);
+ switch_console_printf(SWITCH_CHANNEL_CONSOLE, "write: Bad Frame.... %d Bubye!\n", read_frame->datalen);
data->running = -1;
}
} else {
- switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Bad Frame....Bubye!\n");
+ switch_console_printf(SWITCH_CHANNEL_CONSOLE, "read: Bad Frame.... %d Bubye!\n", read_frame->datalen);
data->running = -1;
}
}
if (switch_test_flag(tech_pvt, TFLAG_IO)) {
switch_clear_flag(tech_pvt, TFLAG_VOICE);
if(!tech_pvt->read_frame.datalen) {
- break;
+ continue;
}
*frame = &tech_pvt->read_frame;
return SWITCH_STATUS_FALSE;
}
- switch_mutex_lock(globals.device_lock);
+ //switch_mutex_lock(globals.device_lock);
if (tech_pvt->audio_out) {
WriteAudioStream(tech_pvt->audio_out, (short *)frame->data, (int)(frame->datalen / sizeof(SAMPLE)));
status = SWITCH_STATUS_SUCCESS;
}
- switch_mutex_unlock(globals.device_lock);
+ //switch_mutex_unlock(globals.device_lock);
return status;