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

[#3648] Fix display name in configuration unserialization

parent 3ec5795a
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ accounts: ...@@ -17,6 +17,7 @@ accounts:
codecs: 0/9/110/111/112/ codecs: 0/9/110/111/112/
stunServer: stun.sflphone.org stunServer: stun.sflphone.org
stunEnabled: false stunEnabled: false
displayName: Alexandre Savard
credential: credential:
count: 0 count: 0
srtp: srtp:
...@@ -61,6 +62,7 @@ accounts: ...@@ -61,6 +62,7 @@ accounts:
codecs: 0/9/110/111/112/ codecs: 0/9/110/111/112/
stunServer: stun.sflphone.org stunServer: stun.sflphone.org
stunEnabled: false stunEnabled: false
displayName: Alexandre Savard
credential: credential:
count: 0 count: 0
srtp: srtp:
...@@ -105,6 +107,7 @@ accounts: ...@@ -105,6 +107,7 @@ accounts:
codecs: 0/9/110/111/112/ codecs: 0/9/110/111/112/
stunServer: stun.sflphone.org stunServer: stun.sflphone.org
stunEnabled: false stunEnabled: false
displayName: Alexandre Savard
credential: credential:
count: 0 count: 0
srtp: srtp:
......
...@@ -199,6 +199,9 @@ void SIPAccount::unserialize(Conf::MappingNode *map) ...@@ -199,6 +199,9 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
credMap = (Conf::MappingNode *)(map->getValue(credKey)); credMap = (Conf::MappingNode *)(map->getValue(credKey));
credentials.unserialize(credMap); credentials.unserialize(credMap);
val = (Conf::ScalarNode *)(map->getValue(displayNameKey));
if(val) { _displayName = val->getValue(); val = NULL; }
// get srtp submap // get srtp submap
srtpMap = (Conf::MappingNode *)(map->getValue(srtpKey)); srtpMap = (Conf::MappingNode *)(map->getValue(srtpKey));
if(!srtpMap) if(!srtpMap)
...@@ -457,8 +460,9 @@ void SIPAccount::initTlsConfiguration (void) ...@@ -457,8 +460,9 @@ void SIPAccount::initTlsConfiguration (void)
} }
// TLS listener is unique and should be only modified through IP2IP_PROFILE // TLS listener is unique and should be only modified through IP2IP_PROFILE
std::string tlsPortStr = Manager::instance().getConfigString(_accountID, TLS_LISTENER_PORT); // std::string tlsPortStr = Manager::instance().getConfigString(_accountID, TLS_LISTENER_PORT);
setTlsListenerPort(atoi(tlsPortStr.c_str())); // setTlsListenerPort(atoi(tlsPortStr.c_str()));
setTlsListenerPort(atoi(_tlsPortStr.c_str()));
_tlsSetting = (pjsip_tls_setting *) malloc (sizeof (pjsip_tls_setting)); _tlsSetting = (pjsip_tls_setting *) malloc (sizeof (pjsip_tls_setting));
...@@ -466,33 +470,33 @@ void SIPAccount::initTlsConfiguration (void) ...@@ -466,33 +470,33 @@ void SIPAccount::initTlsConfiguration (void)
pjsip_tls_setting_default (_tlsSetting); pjsip_tls_setting_default (_tlsSetting);
std::string tlsCaListFile = Manager::instance().getConfigString (_accountID, TLS_CA_LIST_FILE); // std::string tlsCaListFile = Manager::instance().getConfigString (_accountID, TLS_CA_LIST_FILE);
std::string tlsCertificateFile = Manager::instance().getConfigString (_accountID, TLS_CERTIFICATE_FILE); // std::string tlsCertificateFile = Manager::instance().getConfigString (_accountID, TLS_CERTIFICATE_FILE);
std::string tlsPrivateKeyFile = Manager::instance().getConfigString (_accountID, TLS_PRIVATE_KEY_FILE); // std::string tlsPrivateKeyFile = Manager::instance().getConfigString (_accountID, TLS_PRIVATE_KEY_FILE);
std::string tlsPassword = Manager::instance().getConfigString (_accountID, TLS_PASSWORD); // std::string tlsPassword = Manager::instance().getConfigString (_accountID, TLS_PASSWORD);
std::string tlsMethod = Manager::instance().getConfigString (_accountID, TLS_METHOD); // std::string tlsMethod = Manager::instance().getConfigString (_accountID, TLS_METHOD);
std::string tlsCiphers = Manager::instance().getConfigString (_accountID, TLS_CIPHERS); // std::string tlsCiphers = Manager::instance().getConfigString (_accountID, TLS_CIPHERS);
std::string tlsServerName = Manager::instance().getConfigString (_accountID, TLS_SERVER_NAME); // std::string tlsServerName = Manager::instance().getConfigString (_accountID, TLS_SERVER_NAME);
bool tlsVerifyServer = Manager::instance().getConfigBool (_accountID, TLS_VERIFY_SERVER); // bool tlsVerifyServer = Manager::instance().getConfigBool (_accountID, TLS_VERIFY_SERVER);
bool tlsVerifyClient = Manager::instance().getConfigBool (_accountID, TLS_VERIFY_CLIENT); // bool tlsVerifyClient = Manager::instance().getConfigBool (_accountID, TLS_VERIFY_CLIENT);
bool tlsRequireClientCertificate = Manager::instance().getConfigBool (_accountID, TLS_REQUIRE_CLIENT_CERTIFICATE); // bool tlsRequireClientCertificate = Manager::instance().getConfigBool (_accountID, TLS_REQUIRE_CLIENT_CERTIFICATE);
std::string tlsNegotiationTimeoutSec = Manager::instance().getConfigString (_accountID, TLS_NEGOTIATION_TIMEOUT_SEC); // std::string tlsNegotiationTimeoutSec = Manager::instance().getConfigString (_accountID, TLS_NEGOTIATION_TIMEOUT_SEC);
std::string tlsNegotiationTimeoutMsec = Manager::instance().getConfigString (_accountID, TLS_NEGOTIATION_TIMEOUT_MSEC); // std::string tlsNegotiationTimeoutMsec = Manager::instance().getConfigString (_accountID, TLS_NEGOTIATION_TIMEOUT_MSEC);
pj_cstr (&_tlsSetting->ca_list_file, tlsCaListFile.c_str()); pj_cstr (&_tlsSetting->ca_list_file, _tlsCaListFile.c_str());
pj_cstr (&_tlsSetting->cert_file, tlsCertificateFile.c_str()); pj_cstr (&_tlsSetting->cert_file, _tlsCertificateFile.c_str());
pj_cstr (&_tlsSetting->privkey_file, tlsPrivateKeyFile.c_str()); pj_cstr (&_tlsSetting->privkey_file, _tlsPrivateKeyFile.c_str());
pj_cstr (&_tlsSetting->password, tlsPassword.c_str()); pj_cstr (&_tlsSetting->password, _tlsPassword.c_str());
_tlsSetting->method = sslMethodStringToPjEnum (tlsMethod); _tlsSetting->method = sslMethodStringToPjEnum (_tlsMethod);
pj_cstr (&_tlsSetting->ciphers, tlsCiphers.c_str()); pj_cstr (&_tlsSetting->ciphers, _tlsCiphers.c_str());
pj_cstr (&_tlsSetting->server_name, tlsServerName.c_str()); pj_cstr (&_tlsSetting->server_name, _tlsServerName.c_str());
_tlsSetting->verify_server = (tlsVerifyServer == true) ? PJ_TRUE: PJ_FALSE; _tlsSetting->verify_server = (_tlsVerifyServer == true) ? PJ_TRUE: PJ_FALSE;
_tlsSetting->verify_client = (tlsVerifyClient == true) ? PJ_TRUE: PJ_FALSE; _tlsSetting->verify_client = (_tlsVerifyClient == true) ? PJ_TRUE: PJ_FALSE;
_tlsSetting->require_client_cert = (tlsRequireClientCertificate == true) ? PJ_TRUE: PJ_FALSE; _tlsSetting->require_client_cert = (_tlsRequireClientCertificate == true) ? PJ_TRUE: PJ_FALSE;
_tlsSetting->timeout.sec = atol (tlsNegotiationTimeoutSec.c_str()); _tlsSetting->timeout.sec = atol (_tlsNegotiationTimeoutSec.c_str());
_tlsSetting->timeout.msec = atol (tlsNegotiationTimeoutMsec.c_str()); _tlsSetting->timeout.msec = atol (_tlsNegotiationTimeoutMsec.c_str());
} }
...@@ -762,7 +766,7 @@ std::string SIPAccount::getContactHeader (const std::string& address, const std: ...@@ -762,7 +766,7 @@ std::string SIPAccount::getContactHeader (const std::string& address, const std:
transport = ""; transport = "";
} }
_displayName = Manager::instance().getConfigString (_accountID, DISPLAY_NAME); // _displayName = Manager::instance().getConfigString (_accountID, DISPLAY_NAME);
_debug ("Display Name: %s", _displayName.c_str()); _debug ("Display Name: %s", _displayName.c_str());
......
...@@ -96,6 +96,8 @@ const Conf::Key stunServerKey("stunServer"); ...@@ -96,6 +96,8 @@ const Conf::Key stunServerKey("stunServer");
const Conf::Key credKey("credential"); const Conf::Key credKey("credential");
const Conf::Key credentialCountKey("count"); const Conf::Key credentialCountKey("count");
const Conf::Key displayNameKey("displayName");
class SIPVoIPLink; class SIPVoIPLink;
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment