[commit] r10369 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax
Author: gmaruzz Date: Wed Nov 12 23:22:35 2008 New Revision: 10369 Log: skypiax: now it reads both DTMFs and audio, and the IVR's echo works (it echoes your voice from skype back to you) :-) Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c ============================================================================== --- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original) +++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Wed Nov 12 23:22:35 2008 @@ -583,7 +583,39 @@ } return 0; } +static switch_status_t skypiax_skypeaudio_read(private_t *tech_pvt) +{ + struct skypiax_config *p; + short buf[640]; + int samples; + + p = tech_pvt->p; + + //DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG); + + + memset(buf, '\0', sizeof(buf)); + + + //if ((samples = read(p->audiopipe[0], buf, SAMPLES_PER_FRAME * sizeof(short))) != 320) + if ((samples = read(p->audiopipe[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short))) != 320) { + DEBUGA_SKYPE("read=====> NOT GOOD samples=%d expected=%d\n", SKYPIAX_P_LOG, samples, + 320); + usleep(1000); + //do nothing + } else { + tech_pvt->read_frame.datalen=samples; + //DEBUGA_SKYPE("read=====> GOOD samples=%d\n", SKYPIAX_P_LOG, samples); + /* A real frame */ + } + + //DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG); + + return SWITCH_STATUS_SUCCESS; +} + #ifdef NOTDEF +//cicopet struct ast_frame *skypiax_skypeaudio_read(struct skypiax_config *p) { static struct ast_frame f; @@ -825,6 +857,15 @@ *frame = NULL; +if ( skypiax_skypeaudio_read(tech_pvt) != SWITCH_STATUS_SUCCESS ) { + + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_skypeaudio_read ERROR\n"); + +} else { + //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "skypiax_skypeaudio_read SUCCESS\n"); + +} + while (switch_test_flag(tech_pvt, TFLAG_IO)) { if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { switch_clear_flag(tech_pvt, TFLAG_BREAK);
participants (1)
-
FreeSWITCH SVN