Skip to content
Snippets Groups Projects
Commit 139f3642 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

* #6554 : access the SIPVoIPLink directly, not per account

parent c5f8f631
No related branches found
No related tags found
No related merge requests found
...@@ -1445,8 +1445,6 @@ class ManagerImpl ...@@ -1445,8 +1445,6 @@ class ManagerImpl
*/ */
VoIPLink* getAccountLink (const std::string& accountID=""); VoIPLink* getAccountLink (const std::string& accountID="");
VoIPLink* getSIPAccountLink (void);
std::string getAccountIdFromNameAndServer (const std::string& userName, const std::string& server); std::string getAccountIdFromNameAndServer (const std::string& userName, const std::string& server);
int getLocalIp2IpPort(); int getLocalIp2IpPort();
......
...@@ -139,25 +139,17 @@ ManagerImpl::initRegisterAccounts() ...@@ -139,25 +139,17 @@ ManagerImpl::initRegisterAccounts()
void ManagerImpl::restartPJSIP (void) void ManagerImpl::restartPJSIP (void)
{ {
_debug ("ManagerImpl::restartPJSIP\n"); _debug ("ManagerImpl::restartPJSIP\n");
VoIPLink *link = getSIPAccountLink(); SIPVoIPLink *siplink = SIPVoIPLink::instance ();
SIPVoIPLink *siplink = NULL;
if (link) {
siplink = dynamic_cast<SIPVoIPLink*> (getSIPAccountLink ());
}
_debug ("ManagerImpl::unregister sip account\n"); _debug ("ManagerImpl::unregister sip account\n");
this->unregisterCurSIPAccounts(); this->unregisterCurSIPAccounts();
/* Terminate and initialize the PJSIP library */ /* Terminate and initialize the PJSIP library */
if (siplink) {
_debug ("ManagerImpl::Terminate sip\n"); _debug ("ManagerImpl::Terminate sip\n");
siplink->terminate (); siplink->terminate ();
siplink = SIPVoIPLink::instance (); siplink = SIPVoIPLink::instance ();
_debug ("ManagerImpl::Init new sip\n"); _debug ("ManagerImpl::Init new sip\n");
siplink->init (); siplink->init ();
}
_debug ("ManagerImpl::register sip account\n"); _debug ("ManagerImpl::register sip account\n");
...@@ -179,26 +171,6 @@ VoIPLink* ManagerImpl::getAccountLink (const std::string& accountID) ...@@ -179,26 +171,6 @@ VoIPLink* ManagerImpl::getAccountLink (const std::string& accountID)
return SIPVoIPLink::instance (); return SIPVoIPLink::instance ();
} }
VoIPLink* ManagerImpl::getSIPAccountLink()
{
/* We are looking for the first SIP account we met because all the SIP accounts have the same voiplink */
Account *account;
AccountMap::iterator iter = _accountMap.begin();
while (iter != _accountMap.end()) {
account = iter->second;
if (account->getType() == "sip") {
return account->getVoIPLink();
}
++iter;
}
return NULL;
}
pjsip_regc *getSipRegcFromID (const std::string& id UNUSED) pjsip_regc *getSipRegcFromID (const std::string& id UNUSED)
{ {
/*SIPAccount *tmp = dynamic_cast<SIPAccount *>getAccount(id); /*SIPAccount *tmp = dynamic_cast<SIPAccount *>getAccount(id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment