Skip to content
Snippets Groups Projects
Commit f3efb587 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3649] Update managerimpl::setaccountdetails

parent 9a3f2c70
No related branches found
No related tags found
No related merge requests found
...@@ -197,6 +197,8 @@ class Account : public Serializable{ ...@@ -197,6 +197,8 @@ class Account : public Serializable{
*/ */
bool isEnabled() { return _enabled; } bool isEnabled() { return _enabled; }
void setEnabled(bool enabl) { _enabled = enabl; }
/** /**
* Get the registration state of the specified link * Get the registration state of the specified link
* @return RegistrationState The registration state of underlying VoIPLink * @return RegistrationState The registration state of underlying VoIPLink
......
This diff is collapsed.
...@@ -74,11 +74,10 @@ SIPAccount::SIPAccount (const AccountID& accountID) ...@@ -74,11 +74,10 @@ SIPAccount::SIPAccount (const AccountID& accountID)
, _stunServer("") , _stunServer("")
, _tlsEnabled(false) , _tlsEnabled(false)
, _stunEnabled(false) , _stunEnabled(false)
, _routeset("") // , _routeSet("")
// , _realm("") // , _realm("")
, _authenticationUsename("") , _authenticationUsename("")
, _tlsListenerPort("5061") // , _tlsListenerPort("5061")
, _dtmfType("")
, _srtpEnabled(false) , _srtpEnabled(false)
, _srtpKeyExchange("") , _srtpKeyExchange("")
, _srtpFallback(false) , _srtpFallback(false)
...@@ -134,7 +133,7 @@ void SIPAccount::unserialize(Conf::MappingNode *map) ...@@ -134,7 +133,7 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
val = (Conf::ScalarNode *)(map->getValue(hostnameKey)); val = (Conf::ScalarNode *)(map->getValue(hostnameKey));
_hostname = val->getValue(); _hostname = val->getValue();
val = (Conf::ScalarNode *)(map->getValue(accountEnableKey)); val = (Conf::ScalarNode *)(map->getValue(accountEnableKey));
_enabled = val->getValue().compare("true") ? true : false; _enabled = (val->getValue().compare("true") == 0) ? true : false;
// val = (Conf::ScalarNode *)(map->getValue(mailboxKey)); // val = (Conf::ScalarNode *)(map->getValue(mailboxKey));
val = (Conf::ScalarNode *)(map->getValue(codecsKey)); val = (Conf::ScalarNode *)(map->getValue(codecsKey));
...@@ -152,9 +151,9 @@ void SIPAccount::unserialize(Conf::MappingNode *map) ...@@ -152,9 +151,9 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
val = (Conf::ScalarNode *)(map->getValue(publishPortKey)); val = (Conf::ScalarNode *)(map->getValue(publishPortKey));
_publishedPort = atoi(val->getValue().data()); _publishedPort = atoi(val->getValue().data());
val = (Conf::ScalarNode *)(map->getValue(sameasLocalKey)); val = (Conf::ScalarNode *)(map->getValue(sameasLocalKey));
_publishedSameasLocal = val->getValue().compare("true") ? true : false; _publishedSameasLocal = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(map->getValue(resolveOnceKey)); val = (Conf::ScalarNode *)(map->getValue(resolveOnceKey));
_resolveOnce = val->getValue().compare("true") ? true : false; _resolveOnce = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(map->getValue(dtmfTypeKey)); val = (Conf::ScalarNode *)(map->getValue(dtmfTypeKey));
// _dtmfType = atoi(val->getValue(); // _dtmfType = atoi(val->getValue();
...@@ -164,23 +163,23 @@ void SIPAccount::unserialize(Conf::MappingNode *map) ...@@ -164,23 +163,23 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
srtpMap = (Conf::MappingNode *)(map->getValue(srtpKey)); srtpMap = (Conf::MappingNode *)(map->getValue(srtpKey));
val = (Conf::ScalarNode *)(srtpMap->getValue(srtpEnableKey)); val = (Conf::ScalarNode *)(srtpMap->getValue(srtpEnableKey));
_srtpEnabled = val->getValue().compare("true") ? true : false; _srtpEnabled = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(srtpMap->getValue(keyExchangeKey)); val = (Conf::ScalarNode *)(srtpMap->getValue(keyExchangeKey));
_srtpKeyExchange = val->getValue(); _srtpKeyExchange = val->getValue();
val = (Conf::ScalarNode *)(srtpMap->getValue(rtpFallbackKey)); val = (Conf::ScalarNode *)(srtpMap->getValue(rtpFallbackKey));
_srtpFallback = val->getValue().compare("true") ? true : false; _srtpFallback = (val->getValue().compare("true") == 0) ? true : false;
// get zrtp submap // get zrtp submap
zrtpMap = (Conf::MappingNode *)(map->getValue(zrtpKey)); zrtpMap = (Conf::MappingNode *)(map->getValue(zrtpKey));
val = (Conf::ScalarNode *)(zrtpMap->getValue(displaySasKey)); val = (Conf::ScalarNode *)(zrtpMap->getValue(displaySasKey));
_zrtpDisplaySas = val->getValue().compare("true") ? true : false; _zrtpDisplaySas = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(zrtpMap->getValue(displaySasOnceKey)); val = (Conf::ScalarNode *)(zrtpMap->getValue(displaySasOnceKey));
_zrtpDisplaySasOnce = val->getValue().compare("true") ? true : false; _zrtpDisplaySasOnce = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(zrtpMap->getValue(helloHashEnabledKey)); val = (Conf::ScalarNode *)(zrtpMap->getValue(helloHashEnabledKey));
_zrtpHelloHash = val->getValue().compare("true") ? true : false; _zrtpHelloHash = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(zrtpMap->getValue(notSuppWarningKey)); val = (Conf::ScalarNode *)(zrtpMap->getValue(notSuppWarningKey));
_zrtpNotSuppWarning = val->getValue().compare("true") ? true : false; _zrtpNotSuppWarning = (val->getValue().compare("true") == 0) ? true : false;
// get tls submap // get tls submap
tlsMap = (Conf::MappingNode *)(map->getValue(tlsKey)); tlsMap = (Conf::MappingNode *)(map->getValue(tlsKey));
...@@ -205,13 +204,13 @@ void SIPAccount::unserialize(Conf::MappingNode *map) ...@@ -205,13 +204,13 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
val = (Conf::ScalarNode *)(tlsMap->getValue(privateKeyKey)); val = (Conf::ScalarNode *)(tlsMap->getValue(privateKeyKey));
_tlsPrivateKeyFile = val->getValue(); _tlsPrivateKeyFile = val->getValue();
val = (Conf::ScalarNode *)(tlsMap->getValue(requireCertifKey)); val = (Conf::ScalarNode *)(tlsMap->getValue(requireCertifKey));
_tlsRequireClientCertificate = val->getValue().compare("true") ? true : false; _tlsRequireClientCertificate = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(tlsMap->getValue(serverKey)); val = (Conf::ScalarNode *)(tlsMap->getValue(serverKey));
_tlsServerName = val->getValue(); _tlsServerName = val->getValue();
val = (Conf::ScalarNode *)(tlsMap->getValue(verifyClientKey)); val = (Conf::ScalarNode *)(tlsMap->getValue(verifyClientKey));
_tlsVerifyServer = val->getValue().compare("true") ? true : false; _tlsVerifyServer = (val->getValue().compare("true") == 0) ? true : false;
val = (Conf::ScalarNode *)(tlsMap->getValue(verifyServerKey)); val = (Conf::ScalarNode *)(tlsMap->getValue(verifyServerKey));
_tlsVerifyClient = val->getValue().compare("true") ? true : false; _tlsVerifyClient = (val->getValue().compare("true") == 0) ? true : false;
} }
......
...@@ -157,6 +157,7 @@ class SIPAccount : public Account ...@@ -157,6 +157,7 @@ class SIPAccount : public Account
inline void setAuthenticationUsername(const std::string& username) { _authenticationUsername = username; } inline void setAuthenticationUsername(const std::string& username) { _authenticationUsername = username; }
inline bool isResolveOnce(void) { return _resolveOnce; } inline bool isResolveOnce(void) { return _resolveOnce; }
void setResolveOnce(bool reslv) { _resolveOnce = reslv; }
/** /**
...@@ -242,7 +243,6 @@ class SIPAccount : public Account ...@@ -242,7 +243,6 @@ class SIPAccount : public Account
* account is set to OTHER. * account is set to OTHER.
*/ */
inline bool isStunEnabled(void) { return (_transportType == PJSIP_TRANSPORT_START_OTHER) ? true: false; } inline bool isStunEnabled(void) { return (_transportType == PJSIP_TRANSPORT_START_OTHER) ? true: false; }
/* /*
* @return pj_str_t "From" uri based on account information. * @return pj_str_t "From" uri based on account information.
...@@ -375,9 +375,75 @@ class SIPAccount : public Account ...@@ -375,9 +375,75 @@ class SIPAccount : public Account
std::string getTransportMapKey(void); std::string getTransportMapKey(void);
DtmfType getDtmfType(void) { return _dtmfType; } DtmfType getDtmfType(void) { return _dtmfType; }
void setDtmfType(DtmfType type) { _dtmfType = type; } void setDtmfType(DtmfType type) { _dtmfType = type; }
std::string getDisplayName(void) { return _displayName; }
void setDisplayName(std::string name) { _displayName = name ;}
bool getSrtpEnable(void) { return _srtpEnabled; }
void setSrtpEnable(bool enabl) { _srtpEnabled = enabl; }
std::string getSrtpKeyExchange(void) { return _srtpKeyExchange; }
void setSrtpKeyExchange(std::string key) { _srtpKeyExchange = key; }
bool getSrtpFallback(void) { return _srtpFallback; }
void setSrtpFallback(bool fallback) { _srtpFallback = fallback; }
bool getZrtpDisplaySas(void) { return _zrtpDisplaySas; }
void setZrtpDisplaySas(bool sas) { _zrtpDisplaySas = sas; }
bool getZrtpDiaplaySasOnce(void) { return _zrtpDisplaySasOnce; }
void setZrtpDiaplaySasOnce(bool sasonce) { _zrtpDisplaySasOnce = sasonce; }
bool getZrtpNotSuppWarning(void) { return _zrtpDisplaySasOnce; }
void setZrtpNotSuppWarning(bool warning) { _zrtpDisplaySasOnce = _zrtpNotSuppWarning; }
bool getZrtpHelloHash(void) { return _zrtpHelloHash; }
void setZrtpHelloHash(bool hellohash) { _zrtpHelloHash = hellohash; }
// void setSrtpKeyExchange
std::string getTlsEnable(void) {return _tlsEnable; }
void setTlsEnable(std::string enabl) { _tlsEnable = enabl; }
std::string getTlsCaListFile(void) { return _tlsCaListFile; }
void setTlsCaListFile(std::string calist) { _tlsCaListFile = calist; }
std::string getTlsCertificateFile(void) { return _tlsCertificateFile; }
void setTlsCertificateFile(std::string cert) { _tlsCertificateFile = cert; }
std::string getTlsPrivateKeyFile(void) { return _tlsPrivateKeyFile; }
void setTlsPrivateKeyFile(std::string priv) { _tlsPrivateKeyFile = priv; }
std::string getTlsPassword(void) { return _tlsPassword; }
void setTlsPassword(std::string pass) { _tlsPassword = pass; }
std::string getTlsMethod(void) { return _tlsMethod; }
void setTlsMethod(std::string meth) { _tlsMethod = meth; }
std::string getTlsCiphers(void) { return _tlsCiphers; }
void setTlsCiphers(std::string cipher) { _tlsCiphers = cipher; }
std::string getTlsServerName(void) { return _tlsServerName; }
void setTlsServerName(std::string name) { _tlsServerName = name; }
bool getTlsVerifyServer(void) { return _tlsVerifyServer; }
void setTlsVerifyServer(bool verif) { _tlsVerifyServer = verif; }
bool getTlsVerifyClient(void) { return _tlsVerifyClient; }
void setTlsVerifyClient(bool verif) { _tlsVerifyClient = verif; }
bool getTlsRequireClientCertificate(void) { return _tlsRequireClientCertificate; }
void setTlsRequireClientCertificate(bool require) { _tlsRequireClientCertificate = require; }
std::string getTlsNegotiationTimeoutSec(void) { return _tlsNegotiationTimeoutSec; }
void setTlsNegotiationTimeoutSec(std::string timeout) { _tlsNegotiationTimeoutSec = timeout; }
std::string getTlsNegotiationTimeoutMsec(void) { return _tlsNegotiationTimeoutMsec; }
void setTlsNegotiationTimeoutMsec(std::string timeout) { _tlsNegotiationTimeoutMsec = timeout; }
std::string getUseragent(void) { return _useragent; }
void setUseragent(std::string ua) { _useragent = ua; }
private: private:
/* Maps a string description of the SSL method /* Maps a string description of the SSL method
...@@ -477,26 +543,26 @@ class SIPAccount : public Account ...@@ -477,26 +543,26 @@ class SIPAccount : public Account
std::string _displayName; std::string _displayName;
std::string _tlsEnable; std::string _tlsEnable;
std::string _tlsPortStr;// = Manager::instance().getConfigString(_accountID, TLS_LISTENER_PORT); std::string _tlsPortStr;
std::string _tlsCaListFile;// = Manager::instance().getConfigString (_accountID, TLS_CA_LIST_FILE); std::string _tlsCaListFile;
std::string _tlsCertificateFile;// = Manager::instance().getConfigString (_accountID, TLS_CERTIFICATE_FILE); std::string _tlsCertificateFile;
std::string _tlsPrivateKeyFile;// = Manager::instance().getConfigString (_accountID, TLS_PRIVATE_KEY_FILE); std::string _tlsPrivateKeyFile;
std::string _tlsPassword;// = Manager::instance().getConfigString (_accountID, TLS_PASSWORD); std::string _tlsPassword;
std::string _tlsMethod;// = Manager::instance().getConfigString (_accountID, TLS_METHOD); std::string _tlsMethod;
std::string _tlsCiphers;// = Manager::instance().getConfigString (_accountID, TLS_CIPHERS); std::string _tlsCiphers;
std::string _tlsServerName;// = Manager::instance().getConfigString (_accountID, TLS_SERVER_NAME); std::string _tlsServerName;
bool _tlsVerifyServer;// = Manager::instance().getConfigBool (_accountID, TLS_VERIFY_SERVER); bool _tlsVerifyServer;
bool _tlsVerifyClient;// = Manager::instance().getConfigBool (_accountID, TLS_VERIFY_CLIENT); bool _tlsVerifyClient;
bool _tlsRequireClientCertificate;// = Manager::instance().getConfigBool (_accountID, TLS_REQUIRE_CLIENT_CERTIFICATE); bool _tlsRequireClientCertificate;
std::string _tlsNegotiationTimeoutSec;// = Manager::instance().getConfigString (_accountID, TLS_NEGOTIATION_TIMEOUT_SEC); std::string _tlsNegotiationTimeoutSec;
std::string _tlsNegotiationTimeoutMsec;// = Manager::instance().getConfigString (_accountID, TLS_NEGOTIATION_TIMEOUT_MSEC); std::string _tlsNegotiationTimeoutMsec;
std::string _stunServer; // = Manager::instance().getConfigString (_accountID, STUN_SERVER); std::string _stunServer;
bool _tlsEnabled; // = Manager::instance().getConfigBool (_accountID, TLS_ENABLE); bool _tlsEnabled;
bool _stunEnabled; // = Manager::instance().getConfigBool (_accountID, STUN_ENABLE); bool _stunEnabled;
std::string _routeset; // std::string _routeset;
// std::string _realm; // std::string _realm;
std::string _authenticationUsename; std::string _authenticationUsename;
...@@ -515,6 +581,8 @@ class SIPAccount : public Account ...@@ -515,6 +581,8 @@ class SIPAccount : public Account
bool _zrtpHelloHash; bool _zrtpHelloHash;
bool _zrtpNotSuppWarning; bool _zrtpNotSuppWarning;
std::string _useragent;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment