[ekiga] SIP: Move the MWI Subscribe operation in the main thread.



commit 963d4c8bed0fe607ca45c9623a9af86acbfd9d55
Author: Damien Sandras <dsandras beip be>
Date:   Sat Oct 6 14:06:21 2012 +0200

    SIP: Move the MWI Subscribe operation in the main thread.
    
    This is supposed to fix deadlock issues following Robert.
    
    If it does not work, we should trigger all of them in separate threads
    or wait for OPAL Eridani.

 lib/engine/components/opal/sip-endpoint.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index 176c83b..dbc63d8 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -584,10 +584,6 @@ Opal::Sip::EndPoint::OnRegistrationStatus (const RegistrationStatus & status)
   /* Successful registration or unregistration */
   if (status.m_reason == SIP_PDU::Successful_OK) {
 
-    /* Subscribe for MWI */
-    if (status.m_wasRegistering &&!IsSubscribed (SIPSubscribe::MessageSummary, aor))
-      Subscribe (SIPSubscribe::MessageSummary, 3600, aor);
-
     Ekiga::Runtime::run_in_main (boost::bind (&Opal::Sip::EndPoint::registration_event_in_main, this, strm.str (), status.m_wasRegistering ? Account::Registered : Account::Unregistered, std::string ()));
   }
   /* Registration or unregistration failure */
@@ -1034,6 +1030,10 @@ Opal::Sip::EndPoint::registration_event_in_main (const std::string aor,
 						 Opal::Account::RegistrationState state,
 						 const std::string msg)
 {
+  /* Subscribe for MWI */
+  if (state == Opal::Account::Registered &&!IsSubscribed (SIPSubscribe::MessageSummary, aor))
+    Subscribe (SIPSubscribe::MessageSummary, 3600, aor);
+
   if (boost::shared_ptr<Opal::Bank> bk = bank.lock ()) {
 
     AccountPtr account = bk->find_account (aor);



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