[ekiga] OPAL: Fixed account registration when STUN is used.



commit bd54b3c8e4c5febb3ec646cd079b62a0d4bdd32d
Author: Damien Sandras <dsandras seconix com>
Date:   Sat Apr 25 11:15:04 2015 +0200

    OPAL: Fixed account registration when STUN is used.
    
    It must happen *after* both endpoints have handled the "ready" signal
    from the Opal EndPoint.

 lib/engine/components/opal/opal-main.cpp |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-main.cpp b/lib/engine/components/opal/opal-main.cpp
index 49e2ffe..fda5fc7 100644
--- a/lib/engine/components/opal/opal-main.cpp
+++ b/lib/engine/components/opal/opal-main.cpp
@@ -93,7 +93,23 @@ public:
       Opal::H323::EndPoint& h323_endpoint = endpoint.GetH323EndPoint ();
 #endif
 
+      // We create our various CallManagers: SIP, H.323
+      boost::shared_ptr<Opal::Sip::CallManager> sip_call_manager (new Opal::Sip::CallManager (core, 
endpoint, sip_endpoint));
+      contact_core->push_back (Ekiga::URIActionProviderPtr (sip_call_manager));
+      presence_core->push_back (Ekiga::URIActionProviderPtr (sip_call_manager));
+      call_core->add_manager (sip_call_manager);
+
+#ifdef HAVE_H323
+      boost::shared_ptr<Opal::H323::CallManager> h323_call_manager (new Opal::H323::CallManager (core, 
endpoint, h323_endpoint));
+      contact_core->push_back (Ekiga::URIActionProviderPtr (h323_call_manager));
+      presence_core->push_back (Ekiga::URIActionProviderPtr (h323_call_manager));
+      call_core->add_manager (h323_call_manager);
+#endif
+
       // We create the Bank
+      // It must be created last. That way, it will handle the Opal::EndPoint
+      // "ready" signal after the SIP and H.323 EndPoints. Otherwise, accounts
+      // registration could not work when STUN is used.
       boost::shared_ptr<Opal::Bank> bank = boost::shared_ptr<Opal::Bank> (new Opal::Bank (core,
                                                                                           endpoint,
 #ifdef HAVE_H323
@@ -106,18 +122,6 @@ public:
       core.add (bank);
       presence_core->add_presence_publisher (bank);
 
-      // We create our various CallManagers: SIP, H.323
-      boost::shared_ptr<Opal::Sip::CallManager> sip_call_manager (new Opal::Sip::CallManager (core, 
endpoint, sip_endpoint));
-      contact_core->push_back (Ekiga::URIActionProviderPtr (sip_call_manager));
-      presence_core->push_back (Ekiga::URIActionProviderPtr (sip_call_manager));
-      call_core->add_manager (sip_call_manager);
-
-#ifdef HAVE_H323
-      boost::shared_ptr<Opal::H323::CallManager> h323_call_manager (new Opal::H323::CallManager (core, 
endpoint, h323_endpoint));
-      contact_core->push_back (Ekiga::URIActionProviderPtr (h323_call_manager));
-      presence_core->push_back (Ekiga::URIActionProviderPtr (h323_call_manager));
-      call_core->add_manager (h323_call_manager);
-#endif
 
       result = true;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]