Commit 4b6b752c authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Disable PJsip shutdown when changing STUN parameters

parent 97c84363
......@@ -2247,20 +2247,24 @@ AccountMap ManagerImpl::getSipAccountMap( void )
void ManagerImpl::restartPJSIP (void)
{
SIPVoIPLink *siplink;
//SIPVoIPLink *siplink;
//unloadAccountMap ();
/* First unregister all SIP accounts */
this->unregisterCurSIPAccounts();
//this->unregisterCurSIPAccounts();
/* Terminate and initialize the PJSIP library */
siplink = dynamic_cast<SIPVoIPLink*> (getSIPAccountLink ());
if (siplink)
{
siplink->terminate ();
_debug ("*************************************************Terminate done\n");
//siplink = dynamic_cast<SIPVoIPLink*> (getSIPAccountLink ());
//if (siplink)
//{
// siplink->terminate ();
// _debug ("*************************************************Terminate done\n");
//siplink = SIPVoIPLink::instance("");
siplink->init ();
}
_debug("***************************************************Init Done\n");
//siplink->init ();
//}
//_debug("***************************************************Init Done\n");
//loadAccountMap();
//initRegisterAccounts ();
/* Then register all enabled SIP accounts */
//this->registerCurSIPAccounts(siplink);
}
......@@ -2326,7 +2330,7 @@ void ManagerImpl::registerCurSIPAccounts(VoIPLink *link)
current = iter->second;
if (current) {
if ( current->isEnabled() && current->getType() == "sip") {
current->setVoIPLink(link);
//current->setVoIPLink(link);
current->registerVoIPLink();
}
}
......
......@@ -233,7 +233,6 @@ SIPVoIPLink::terminateSIPCall()
void
SIPVoIPLink::getEvent()
{
_debug("a");
// We have to register the external thread so it could access the pjsip framework
if(!pj_thread_is_registered())
pj_thread_register( NULL, desc, &thread );
......@@ -1326,10 +1325,13 @@ std::string SIPVoIPLink::getSipTo(const std::string& to_url, std::string hostnam
bool SIPVoIPLink::pjsip_shutdown( void )
{
/*if (_endpt) {
if (_endpt) {
_debug("UserAgent: Shutting down...\n");
busy_sleep(1000);
}*/
}
pj_thread_destroy( thread );
thread = NULL;
/* Destroy endpoint. */
if (_endpt) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment