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

[#2296] Reinit tls account settings after modification

parent a9f25b14
No related branches found
No related tags found
No related merge requests found
...@@ -245,6 +245,11 @@ void SIPAccount::initTlsConfiguration (void) ...@@ -245,6 +245,11 @@ void SIPAccount::initTlsConfiguration (void)
/* /*
* Initialize structure to zero * Initialize structure to zero
*/ */
if(_tlsSetting){
free (_tlsSetting);
_tlsSetting = NULL;
}
_tlsSetting = (pjsip_tls_setting *) malloc (sizeof (pjsip_tls_setting)); _tlsSetting = (pjsip_tls_setting *) malloc (sizeof (pjsip_tls_setting));
assert (_tlsSetting); assert (_tlsSetting);
...@@ -337,7 +342,18 @@ void SIPAccount::loadConfig() ...@@ -337,7 +342,18 @@ void SIPAccount::loadConfig()
_publishedIpAddress = Manager::instance().getConfigString (_accountID, PUBLISHED_ADDRESS); _publishedIpAddress = Manager::instance().getConfigString (_accountID, PUBLISHED_ADDRESS);
// Init TLS settings if the user wants to use TLS
bool tlsEnabled = Manager::instance().getConfigBool (_accountID, TLS_ENABLE);
if (tlsEnabled) {
_debug("---------------------------- TLS Enabled\n");
initTlsConfiguration();
_transportType = PJSIP_TRANSPORT_TLS;
}
else
{
_transportType = PJSIP_TRANSPORT_UDP; _transportType = PJSIP_TRANSPORT_UDP;
}
// Account generic // Account generic
Account::loadConfig(); Account::loadConfig();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment