Skip to content
Snippets Groups Projects
Commit 2a49b64a authored by Adrien Béraud's avatar Adrien Béraud
Browse files

registration state: add initial unloaded state

Change-Id: Ic96399c9d58b4abbd0bc9b3cbab9f27c8b479b04
parent 85de1297
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,6 @@ const std::string Account::DEFAULT_USER_AGENT = Account::getDefaultUserAgent(); ...@@ -72,7 +72,6 @@ const std::string Account::DEFAULT_USER_AGENT = Account::getDefaultUserAgent();
Account::Account(const std::string& accountID) Account::Account(const std::string& accountID)
: rand(dht::crypto::getSeededRandomEngine<std::mt19937_64>()) : rand(dht::crypto::getSeededRandomEngine<std::mt19937_64>())
, accountID_(accountID) , accountID_(accountID)
, registrationState_(RegistrationState::UNREGISTERED)
, systemCodecContainer_(getSystemCodecContainer()) , systemCodecContainer_(getSystemCodecContainer())
{ {
// Initialize the codec order, used when creating a new account // Initialize the codec order, used when creating a new account
...@@ -228,6 +227,7 @@ Account::mapStateNumberToString(RegistrationState state) ...@@ -228,6 +227,7 @@ Account::mapStateNumberToString(RegistrationState state)
return #X return #X
switch (state) { switch (state) {
CASE_STATE(UNLOADED);
CASE_STATE(UNREGISTERED); CASE_STATE(UNREGISTERED);
CASE_STATE(TRYING); CASE_STATE(TRYING);
CASE_STATE(REGISTERED); CASE_STATE(REGISTERED);
......
...@@ -455,7 +455,7 @@ protected: ...@@ -455,7 +455,7 @@ protected:
* The general, protocol neutral registration * The general, protocol neutral registration
* state of the account * state of the account
*/ */
RegistrationState registrationState_; RegistrationState registrationState_ {RegistrationState::UNLOADED};
/** /**
* Vector containing all system codecs (with default parameters) * Vector containing all system codecs (with default parameters)
......
...@@ -29,6 +29,7 @@ namespace jami { ...@@ -29,6 +29,7 @@ namespace jami {
/** Contains all the Registration states for an account can be in */ /** Contains all the Registration states for an account can be in */
enum class RegistrationState { enum class RegistrationState {
UNLOADED,
UNREGISTERED, UNREGISTERED,
TRYING, TRYING,
REGISTERED, REGISTERED,
......
...@@ -1055,6 +1055,8 @@ SIPAccount::loadConfig() ...@@ -1055,6 +1055,8 @@ SIPAccount::loadConfig()
transportType_ = PJSIP_TRANSPORT_TLS; transportType_ = PJSIP_TRANSPORT_TLS;
} else } else
transportType_ = PJSIP_TRANSPORT_UDP; transportType_ = PJSIP_TRANSPORT_UDP;
if (registrationState_ == RegistrationState::UNLOADED)
setRegistrationState(RegistrationState::UNREGISTERED);
} }
bool bool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment