]> git.mxchange.org Git - flightgear.git/commitdiff
Implement IAX callerID feature
authorClément de l'Hamaide <clemaez@hotmail.fr>
Sun, 22 Sep 2013 15:34:51 +0000 (17:34 +0200)
committerClément de l'Hamaide <clemaez@hotmail.fr>
Sun, 22 Sep 2013 15:38:47 +0000 (17:38 +0200)
src/Network/fgcom.cxx
src/Network/fgcom.hxx

index 2068e03484f85959d57f177a8fdb4efc530fe0de..adc541a7aa98e1594a756f037dc19db6897573d2 100644 (file)
@@ -52,6 +52,7 @@
 #define IAX_DELAY 300  // delay between calls in milliseconds
 #define TEST_FREQ 910.00
 #define NULL_ICAO "ZZZZ"
+#define NUM_ID "0100000000000001"
 
 const int special_freq[] = { // Define some freq who need to be used with NULL_ICAO
        910000,
@@ -134,6 +135,7 @@ void FGCom::bind()
   _ptt0_node               = fgGetNode("/instrumentation/comm[0]/ptt", true); //FIXME: what about /instrumentation/comm[1]/ptt ?
   _callsign_node           = fgGetNode("/sim/multiplay/callsign", true);
   _text_node               = fgGetNode("/sim/messages/atc", true );
+  _version_node            = fgGetNode("/sim/version/flightgear", true );
 
   // Set default values if not provided
   if ( !_enabled_node->hasValue() )
@@ -231,6 +233,10 @@ void FGCom::postinit()
     
     // FIXME: To be implemented in IAX audio driver
     //iaxc_mic_boost_set( _micBoost_node->getIntValue() );
+    std::string app = "FGFS-";
+    app += _version_node->getStringValue();
+
+    iaxc_set_callerid( _callsign_node->getStringValue(), app.c_str() );
     iaxc_set_formats( IAXC_FORMAT_GSM, IAXC_FORMAT_GSM );
     iaxc_start_processing_thread ();
 
@@ -351,7 +357,7 @@ void FGCom::updateCall(bool& changed, int& callNo, double freqMHz)
         if( !isInRange(freqMHz) )
             return;
         if( !num.empty() ) {
-            callNo = iaxc_call_ex(num.c_str(), _callsign.c_str(), NULL, 0 /* no video */);
+            callNo = iaxc_call(num.c_str());
 
             if( callNo == -1 )
                 SG_LOG( SG_IO, SG_DEBUG, "FGCom: cannot call " << num.c_str() );
index f951aa14b6f756459d6dcee220786fc4416610c0..400d379334cbb0f59e260797c20cb06ad6c2a02c 100644 (file)
@@ -50,6 +50,7 @@ class FGCom : public SGSubsystem, public SGPropertyChangeListener
     SGPropertyNode_ptr _text_node;                            // sim/fgcom/text
     SGPropertyNode_ptr _server_node;                          // sim/fgcom/server
     SGPropertyNode_ptr _enabled_node;                         // sim/fgcom/enabled
+    SGPropertyNode_ptr _version_node;                         // sim/version/flightgear
     SGPropertyNode_ptr _micBoost_node;                        // sim/fgcom/mic-boost
     SGPropertyNode_ptr _callsign_node;                        // sim/multiplay/callsign
     SGPropertyNode_ptr _register_node;                        // sim/fgcom/register/enabled