diff --git a/src/useragent.cpp b/src/useragent.cpp index 2fdc3ab9041d33ef38a54d7227480d95e9bba56a..cc9d8c1e5adf351cb2e26c8cecbe7ac1cc02b87b 100644 --- a/src/useragent.cpp +++ b/src/useragent.cpp @@ -358,7 +358,7 @@ void UserAgent::busy_sleep(unsigned msec) #endif } -int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& server, const std::string& user, const std::string& passwd, +bool UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& server, const std::string& user, const std::string& passwd, const int& timeout UNUSED) { pj_status_t status; AccountID *currentId = new AccountID(id); @@ -376,7 +376,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s status = pjsip_regc_create(_endpt, (void *) currentId, ®c_cb, ®c); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to create regc.\n"); - return status; + return false; } tmp = "sip:" + server; @@ -394,7 +394,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s status = pjsip_regc_init(regc, &svr, &aor, &aor, 1, &contact, 600); //timeout); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to initialize regc. %d\n", status); //, regc->str_srv_url.ptr); - return status; + return false; } @@ -418,13 +418,13 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s status = pjsip_regc_register(regc, PJ_TRUE, &tdata); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to register regc.\n"); - return status; + return false; } status = pjsip_regc_send(regc, tdata); if (status != PJ_SUCCESS) { _debug("UserAgent: Unable to send regc request.\n"); - return status; + return false; } account->setUserName(user); @@ -436,7 +436,7 @@ int UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& s pj_mutex_unlock(_mutex); - return PJ_SUCCESS; + return true; } bool UserAgent::removeAccount(pjsip_regc *regc) @@ -893,7 +893,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const &to, NULL, &dialog); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, false); setCallAudioLocal(call); call->setIp(getInstance()->getLocalIP()); @@ -904,7 +904,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const // Create the invite session for this call pjsip_inv_session *inv; status = pjsip_inv_create_uac(dialog, call->getLocalSDPSession(), 0, &inv); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, false); // Set auth information pjsip_auth_clt_set_credentials(&dialog->auth_sess, 1, account->getCredInfo()); @@ -913,7 +913,7 @@ bool UserAgent::makeOutgoingCall(const std::string& strTo, SIPCall* call, const inv->mod_data[_mod.id] = call; status = pjsip_inv_invite(inv, &tdata); - PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); + PJ_ASSERT_RETURN(status == PJ_SUCCESS, false); // Associate current invite session in the call call->setInvSession(inv); diff --git a/src/useragent.h b/src/useragent.h index 32f579dcdd9d1f48669201153872daf4342834c7..6e99397ffa5baa430e6ea56c71c0f6a12905f9c1 100644 --- a/src/useragent.h +++ b/src/useragent.h @@ -102,7 +102,7 @@ public: pj_str_t getStunServer() { return _stunHost; } - int addAccount(AccountID id, pjsip_regc **regc, const std::string& server, const std::string& user, const std::string& passwd + bool addAccount(AccountID id, pjsip_regc **regc, const std::string& server, const std::string& user, const std::string& passwd , const int& timeout); bool removeAccount(pjsip_regc *regc);