[Freeswitch-svn] [commit] r14046 - in freeswitch/trunk/contrib/mod/endpoints/mod_khomp: . src
Author: raulfragoso Date: Tue Jun 30 04:20:34 2009 New Revision: 14046 Log: More flag checks Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp ============================================================================== --- freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp (original) +++ freeswitch/trunk/contrib/mod/endpoints/mod_khomp/mod_khomp.cpp Tue Jun 30 04:20:34 2009 @@ -166,6 +166,8 @@ */ static switch_status_t tech_init(KhompPvt *tech_pvt, switch_core_session_t *session) { + tech_pvt->flags = 0; + tech_pvt->_read_frame.data = tech_pvt->_databuf; tech_pvt->_read_frame.buflen = sizeof(tech_pvt->_databuf); Modified: freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp ============================================================================== --- freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp (original) +++ freeswitch/trunk/contrib/mod/endpoints/mod_khomp/src/khomp_pvt.cpp Tue Jun 30 04:20:34 2009 @@ -241,6 +241,9 @@ bool KhompPvt::start_stream(void) { + if(switch_test_flag(this, TFLAG_STREAM)) + return true; + try { Globals::_k3lapi.mixer(_KDeviceId, _KChannelId, 0, kmsPlay, _KChannelId); @@ -258,6 +261,9 @@ bool KhompPvt::stop_stream(void) { + if(!switch_test_flag(this, TFLAG_STREAM)) + return true; + try { Globals::_k3lapi.mixer(_KDeviceId, _KChannelId, 0, kmsGenerator, kmtSilence); @@ -275,6 +281,9 @@ bool KhompPvt::start_listen(bool conn_rx) { + if(switch_test_flag(this, TFLAG_LISTEN)) + return true; + const size_t buffer_size = KHOMP_PACKET_SIZE; if (conn_rx) @@ -299,6 +308,9 @@ bool KhompPvt::stop_listen(void) { + if(!switch_test_flag(this, TFLAG_LISTEN)) + return true; + try { Globals::_k3lapi.command(_KDeviceId, _KChannelId, CM_STOP_LISTEN);
participants (1)
-
FreeSWITCH SVN