Skip to content
Snippets Groups Projects
Commit f6025f9d authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #26453: sip: use HAVE_TLS around all ssl dependent code

This fixes building after running ./configure --without-tls
parent 92d62cfc
No related branches found
No related tags found
No related merge requests found
...@@ -631,12 +631,14 @@ void SIPAccount::registerVoIPLink() ...@@ -631,12 +631,14 @@ void SIPAccount::registerVoIPLink()
if (hostname_.length() >= PJ_MAX_HOSTNAME) if (hostname_.length() >= PJ_MAX_HOSTNAME)
return; return;
#if HAVE_TLS
// Init TLS settings if the user wants to use TLS // Init TLS settings if the user wants to use TLS
if (tlsEnable_ == TRUE_STR) { if (tlsEnable_ == TRUE_STR) {
DEBUG("TLS is enabled for account %s", accountID_.c_str()); DEBUG("TLS is enabled for account %s", accountID_.c_str());
transportType_ = PJSIP_TRANSPORT_TLS; transportType_ = PJSIP_TRANSPORT_TLS;
initTlsConfiguration(); initTlsConfiguration();
} }
#endif
// Init STUN settings for this account if the user selected it // Init STUN settings for this account if the user selected it
if (stunEnabled_) { if (stunEnabled_) {
...@@ -716,6 +718,7 @@ void SIPAccount::stopKeepAliveTimer() ...@@ -716,6 +718,7 @@ void SIPAccount::stopKeepAliveTimer()
} }
} }
#if HAVE_TLS
pjsip_ssl_method SIPAccount::sslMethodStringToPjEnum(const std::string& method) pjsip_ssl_method SIPAccount::sslMethodStringToPjEnum(const std::string& method)
{ {
if (method == "Default") if (method == "Default")
...@@ -775,6 +778,7 @@ void SIPAccount::initTlsConfiguration() ...@@ -775,6 +778,7 @@ void SIPAccount::initTlsConfiguration()
tlsSetting_.qos_type = PJ_QOS_TYPE_BEST_EFFORT; tlsSetting_.qos_type = PJ_QOS_TYPE_BEST_EFFORT;
tlsSetting_.qos_ignore_error = PJ_TRUE; tlsSetting_.qos_ignore_error = PJ_TRUE;
} }
#endif
void SIPAccount::initStunConfiguration() void SIPAccount::initStunConfiguration()
{ {
...@@ -803,10 +807,12 @@ void SIPAccount::loadConfig() ...@@ -803,10 +807,12 @@ void SIPAccount::loadConfig()
if (registrationExpire_ == 0) if (registrationExpire_ == 0)
registrationExpire_ = DEFAULT_REGISTRATION_TIME; /** Default expire value for registration */ registrationExpire_ = DEFAULT_REGISTRATION_TIME; /** Default expire value for registration */
#if HAVE_TLS
if (tlsEnable_ == TRUE_STR) { if (tlsEnable_ == TRUE_STR) {
initTlsConfiguration(); initTlsConfiguration();
transportType_ = PJSIP_TRANSPORT_TLS; transportType_ = PJSIP_TRANSPORT_TLS;
} else } else
#endif
transportType_ = PJSIP_TRANSPORT_UDP; transportType_ = PJSIP_TRANSPORT_UDP;
} }
......
...@@ -528,6 +528,7 @@ class SIPAccount : public Account { ...@@ -528,6 +528,7 @@ class SIPAccount : public Account {
*/ */
std::vector< std::map<std::string, std::string > > credentials_; std::vector< std::map<std::string, std::string > > credentials_;
#if HAVE_TLS
/** /**
* Maps a string description of the SSL method * Maps a string description of the SSL method
* to the corresponding enum value in pjsip_ssl_method. * to the corresponding enum value in pjsip_ssl_method.
...@@ -545,6 +546,7 @@ class SIPAccount : public Account { ...@@ -545,6 +546,7 @@ class SIPAccount : public Account {
* Display the list of ciphers currently supported on the * Display the list of ciphers currently supported on the
*/ */
void displayCipherSuite(); void displayCipherSuite();
#endif
/** /**
* Initializes STUN config from the config file * Initializes STUN config from the config file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment