diff --git a/utils/fgcom/fgcom_external.cxx b/utils/fgcom/fgcom_external.cxx index 6057e3b..0159565 100644 --- a/utils/fgcom/fgcom_external.cxx +++ b/utils/fgcom/fgcom_external.cxx @@ -133,7 +133,12 @@ int main(int argc, char** argv) sgSocket.open(false); sgSocket.bind(_host.c_str(), _port); sgSocket.setBlocking(false); - lib_setVolume(0.0, 1.0); + + //lib_setVolume(0.0, 1.0); + iaxc_input_level_set(0.1); + iaxc_output_level_set(0.8); + + static char currentPacket[MAXBUFLEN+2], previousPacket[MAXBUFLEN+2]; struct Data currentData, previousData, previousPosData; double currentFreq = -1, previousFreq = -1; @@ -179,18 +184,31 @@ int main(int argc, char** argv) SG_LOG( SG_GENERAL, SG_INFO, "Select radio " << activeComm << " on " << currentFreq << " MHz" ); } else if(currentData.ptt) { SG_LOG( SG_GENERAL, SG_INFO, "[SPEAK] unmute mic, mute speaker" ); - lib_setVolume(1.0, 0.0); + + //lib_setVolume(1.0, 0.0); + iaxc_input_level_set(1.0); + iaxc_output_level_set(0.1); + + } else { SG_LOG( SG_GENERAL, SG_INFO, "[LISTEN] mute mic, unmute speaker" ); //lib_setVolume(0.0, currentData.outputVol); - lib_setVolume(0.0, 1.0); + //lib_setVolume(0.0, 1.0); + + iaxc_input_level_set(0.1); + iaxc_output_level_set(0.8); + } } if(currentData.outputVol != previousData.outputVol) - lib_setVolume(0.0, currentData.outputVol); + //lib_setVolume(0.0, currentData.outputVol); + + iaxc_input_level_set(0.1); + iaxc_output_level_set(0.8); + if(currentData.silenceThd != previousData.silenceThd) lib_setSilenceThreshold(currentData.silenceThd); @@ -256,11 +274,17 @@ int main(int argc, char** argv) if(mode == OBS) { SG_LOG( SG_GENERAL, SG_INFO, "Entering main loop in mode OBS (max duration: 6 hours)" ); sessionDuration *= 2160; // 6 hours for OBS mode - lib_setVolume(0.0, 1.0); + //lib_setVolume(0.0, 1.0); + iaxc_input_level_set(0.1); + iaxc_output_level_set(0.8); + lib_setCallerId("::OBS::"); num = computePhoneNumber(_frequency, _airport); } else { - lib_setVolume(1.0, 1.0); + //lib_setVolume(1.0, 1.0); + iaxc_input_level_set(1.0); + iaxc_output_level_set(0.8); + if(mode == TEST) { sessionDuration *= 65; // 65 seconds for TEST mode SG_LOG( SG_GENERAL, SG_INFO, "Entering main loop in mode TEST (max duration: 65 seconds)" ); @@ -565,6 +589,12 @@ bool lib_init() iaxc_set_event_callback(iaxc_callback); iaxc_start_processing_thread (); lib_setSilenceThreshold(_silenceThd); + + iaxc_input_level_set(0.1); + iaxc_output_level_set(0.8); + + iaxc_millisleep(30); + return true; }