if (switch_test_flag(tech_pvt, TFLAG_PROGRESS)) {
//DEBUGA_SKYPE("CHANNEL READ FRAME in TFLAG_PROGRESS goto CNG\n", SKYPOPEN_P_LOG);
- switch_sleep(MS_SKYPOPEN * 1000);
+ //switch_sleep(MS_SKYPOPEN * 1000);
goto cng;
}
DEBUGA_SKYPE("skypopen_audio_read going back to read\n", SKYPOPEN_P_LOG);
goto read;
}
- DEBUGA_SKYPE("skypopen_audio_read Silence\n", SKYPOPEN_P_LOG);
+ DEBUGA_SKYPE("READ BUFFER EMPTY, skypopen_audio_read Silence\n", SKYPOPEN_P_LOG);
memset(tech_pvt->read_frame.data, 255, BYTES_PER_FRAME);
tech_pvt->read_frame.datalen = BYTES_PER_FRAME;
switch_mutex_lock(tech_pvt->mutex_audio_cli);
if (switch_buffer_freespace(tech_pvt->write_buffer) < frame->datalen) {
- DEBUGA_SKYPE("NO SPACE WRITE: %d\n", SKYPOPEN_P_LOG, frame->datalen);
switch_buffer_zero(tech_pvt->write_buffer);
no_space = 1;
}
switch_buffer_write(tech_pvt->write_buffer, frame->data, frame->datalen);
switch_mutex_unlock(tech_pvt->mutex_audio_cli);
if (no_space) {
- switch_sleep(MS_SKYPOPEN * 1000);
- } else {
- tech_pvt->begin_to_write = 1;
+ //switch_sleep(MS_SKYPOPEN * 1000);
+ DEBUGA_SKYPE("NO SPACE in WRITE BUFFER: there was no space for %d\n", SKYPOPEN_P_LOG, frame->datalen);
}
+ tech_pvt->begin_to_write = 1;
return SWITCH_STATUS_SUCCESS;
}
DEBUGA_SKYPE("Skype FAILED on skype_call %s. Let's wait for the FAILED message.\n", SKYPOPEN_P_LOG, id);
}
#if 0
+#ifndef WIN32
if (!strcasecmp(prop, "DURATION")) { /* each 20 seconds, we zero the buffers and sync the timers */
if (!((atoi(value) % 20))) {
if (tech_pvt->read_buffer) {
DEBUGA_SKYPE("Synching audio on skype_call: %s.\n", SKYPOPEN_P_LOG, id);
}
}
+#endif //WIN32
#endif //0
if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) {
if (strcasecmp(id, tech_pvt->skype_call_id)) {
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPOPEN_STATE_UP)) {
- unsigned int fdselect;
+ //unsigned int fdselect;
int rt=1;
- fd_set fs;
+ //fd_set fs;
//struct timeval to;
int nospace;
if (!(running && tech_pvt->running))
break;
+#if 0
fdselect = fd;
FD_ZERO(&fs);
FD_SET(fdselect, &fs);
- //to.tv_usec = MS_SKYPOPEN * 1000 * 3;
- //to.tv_sec = 0;
+ to.tv_usec = MS_SKYPOPEN * 1000 * 3;
+ to.tv_sec = 0;
+#endif //0
if (tech_pvt->timer_read_srv.timer_interface && tech_pvt->timer_read_srv.timer_interface->timer_next) {
switch_core_timer_next(&tech_pvt->timer_read_srv);
}
switch_mutex_unlock(tech_pvt->mutex_audio_srv);
if (nospace) {
- DEBUGA_SKYPE("NO SPACE READ: there was no space for: %d\n", SKYPOPEN_P_LOG, len);
+ DEBUGA_SKYPE("NO SPACE in READ BUFFER: there was no space for: %d\n", SKYPOPEN_P_LOG, len);
}
} else if (len == 0) {
DEBUGA_SKYPE("CLOSED\n", SKYPOPEN_P_LOG);
}
switch_mutex_lock(tech_pvt->mutex_audio_cli);
if (tech_pvt->write_buffer && switch_buffer_inuse(tech_pvt->write_buffer)) {
- bytes_to_write = switch_buffer_read(tech_pvt->write_buffer, cli_out, BYTES_PER_FRAME * 2);
+ bytes_to_write = switch_buffer_read(tech_pvt->write_buffer, cli_out, BYTES_PER_FRAME);
}
switch_mutex_unlock(tech_pvt->mutex_audio_cli);