From d7e1a4e8d9ae0df9ed64e1388cb23e0b26bab4da Mon Sep 17 00:00:00 2001
From: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
Date: Wed, 9 Apr 2008 14:55:40 -0400
Subject: [PATCH] IAX2 register/unregister from the GUI works very well

---
 src/iaxvoiplink.cpp |  2 ++
 src/managerimpl.cpp | 10 ++--------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/iaxvoiplink.cpp b/src/iaxvoiplink.cpp
index f28a33bc41..9efe1b2fde 100644
--- a/src/iaxvoiplink.cpp
+++ b/src/iaxvoiplink.cpp
@@ -430,7 +430,9 @@ IAXVoIPLink::sendUnregister()
 
   _nextRefreshStamp = 0;
 
+  _debug("IAX2 send unregister\n");
   setRegistrationState(Unregistered);
+  Manager::instance().unregistrationSucceed("");
 
   return false;
 }
diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp
index 52824428f6..21bf054ced 100644
--- a/src/managerimpl.cpp
+++ b/src/managerimpl.cpp
@@ -798,7 +798,6 @@ ManagerImpl::registrationSucceed(const AccountID& accountid)
 {
   Account* acc = getAccount(accountid);
   if ( acc ) { 
-    //acc->setState(true); 
     _debug("REGISTRATION SUCCEED\n");
     if (_dbus) _dbus->getConfigurationManager()->accountsChanged();
   }
@@ -808,12 +807,8 @@ ManagerImpl::registrationSucceed(const AccountID& accountid)
   void 
 ManagerImpl::unregistrationSucceed(const AccountID& accountid)
 {
-  Account* acc = getAccount(accountid);
-  if ( acc ) { 
-    //acc->setState(true); 
-    _debug("UNREGISTRATION SUCCEED\n");
-    if (_dbus) _dbus->getConfigurationManager()->accountsChanged();
-  }
+  _debug("UNREGISTRATION SUCCEED\n");
+  if (_dbus) _dbus->getConfigurationManager()->accountsChanged();
 }
 
 //THREAD=VoIP
@@ -1751,7 +1746,6 @@ ManagerImpl::getCallStatus(const std::string& sequenceId)
 }
 
 //THREAD=Main
-/* Unused, Deprecated */
   bool 
 ManagerImpl::getConfigAll(const std::string& sequenceId)
 {
-- 
GitLab