diff --git a/src/useragent.cpp b/src/useragent.cpp index 3f0e4288c03f35b13fee1e41ca1605b3cc0660c5..0807cb0c053a53bc542dc0da5cde1a6cad031599 100644 --- a/src/useragent.cpp +++ b/src/useragent.cpp @@ -348,7 +348,8 @@ void UserAgent::busy_sleep(unsigned msec) #endif } -bool UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& server, const std::string& user, const std::string& passwd, const int& timeout UNUSED, const unsigned int& port) { +bool UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& server, const std::string& user, const std::string& passwd, + const int& timeout UNUSED, const unsigned int& port) { pj_status_t status; AccountID *currentId = new AccountID(id); char contactTmp[256]; @@ -389,6 +390,7 @@ bool UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& return status; } + account = dynamic_cast<SIPAccount *> (Manager::instance().getAccount(id)); pjsip_cred_info *cred = account->getCredInfo();