Commit 38eb28db authored by Rafaël Carré's avatar Rafaël Carré
Browse files

* #6554 : cleanup sipvoiplink

parent 70516e43
......@@ -59,11 +59,13 @@ std::map<std::string, std::string> ConfigurationManager::getAccountDetails (
std::map<std::string, std::string> ConfigurationManager::getTlsSettingsDefault (
void)
{
std::map<std::string, std::string> tlsSettingsDefault;
std::stringstream portstr;
portstr << DEFAULT_SIP_TLS_PORT;
tlsSettingsDefault.insert (std::pair<std::string, std::string> (
TLS_LISTENER_PORT, DEFAULT_SIP_TLS_PORT));
TLS_LISTENER_PORT, portstr.str()));
tlsSettingsDefault.insert (std::pair<std::string, std::string> (
TLS_CA_LIST_FILE, ""));
tlsSettingsDefault.insert (std::pair<std::string, std::string> (
......
......@@ -125,8 +125,8 @@ static const SOUND_FORMAT INT32 = 0x8;
#define UNUSED __attribute__((__unused__))
#define DEFAULT_SIP_PORT "5060"
#define DEFAULT_SIP_TLS_PORT "5061"
#define DEFAULT_SIP_PORT 5060
#define DEFAULT_SIP_TLS_PORT 5061
#define HOOK_DEFAULT_SIP_FIELD "X-sflphone-url"
#define HOOK_DEFAULT_URL_COMMAND "x-www-browser"
......
......@@ -51,10 +51,10 @@ SIPAccount::SIPAccount (const std::string& accountID)
, _interface ("default")
, _publishedSameasLocal (true)
, _publishedIpAddress ("")
, _localPort (atoi (DEFAULT_SIP_PORT))
, _publishedPort (atoi (DEFAULT_SIP_PORT))
, _localPort (DEFAULT_SIP_PORT)
, _publishedPort (DEFAULT_SIP_PORT)
, _serviceRoute ("")
, _tlsListenerPort (atoi (DEFAULT_SIP_TLS_PORT))
, _tlsListenerPort (DEFAULT_SIP_TLS_PORT)
, _transportType (PJSIP_TRANSPORT_UNSPECIFIED)
, _transport (NULL)
, _resolveOnce (false)
......@@ -62,7 +62,7 @@ SIPAccount::SIPAccount (const std::string& accountID)
, _tlsSetting (NULL)
, _dtmfType (OVERRTP)
, _tlsEnable ("false")
, _tlsPortStr (DEFAULT_SIP_TLS_PORT)
, _tlsPort (DEFAULT_SIP_TLS_PORT)
, _tlsCaListFile ("")
, _tlsCertificateFile ("")
, _tlsPrivateKeyFile ("")
......@@ -155,7 +155,9 @@ void SIPAccount::serialize (Conf::YamlEmitter *emitter)
Conf::ScalarNode helloHashEnabled (_zrtpHelloHash);
Conf::ScalarNode notSuppWarning (_zrtpNotSuppWarning);
Conf::ScalarNode tlsport (_tlsPortStr);
portstr.str("");
portstr << _tlsPort;
Conf::ScalarNode tlsport (portstr.str());
Conf::ScalarNode certificate (_tlsCertificateFile);
Conf::ScalarNode calist (_tlsCaListFile);
Conf::ScalarNode ciphers (_tlsCiphers);
......@@ -356,7 +358,7 @@ void SIPAccount::unserialize (Conf::MappingNode *map)
tlsMap = (Conf::MappingNode *) (map->getValue (tlsKey));
if (tlsMap) {
tlsMap->getValue(tlsEnableKey, &_tlsEnable);
tlsMap->getValue(tlsPortKey, &_tlsPortStr);
tlsMap->getValue(tlsPortKey, &_tlsPort);
tlsMap->getValue(certificateKey, &_tlsCertificateFile);
tlsMap->getValue(calistKey, &_tlsCaListFile);
tlsMap->getValue(ciphersKey, &_tlsCiphers);
......@@ -615,7 +617,7 @@ pjsip_ssl_method SIPAccount::sslMethodStringToPjEnum (const std::string& method)
void SIPAccount::initTlsConfiguration (void)
{
// TLS listener is unique and should be only modified through IP2IP_PROFILE
setTlsListenerPort (atoi (_tlsPortStr.c_str()));
setTlsListenerPort(_tlsPort);
delete _tlsSetting;
_tlsSetting = new pjsip_tls_setting;
......
......@@ -732,7 +732,7 @@ class SIPAccount : public Account
DtmfType _dtmfType;
std::string _tlsEnable;
std::string _tlsPortStr;
int _tlsPort;
std::string _tlsCaListFile;
std::string _tlsCertificateFile;
std::string _tlsPrivateKeyFile;
......
This diff is collapsed.
......@@ -359,11 +359,6 @@ class SIPVoIPLink : public VoIPLink
*/
pjsip_route_hdr *createRouteSet(Account *account, pj_pool_t *pool);
/**
* Wrapper around getaddrinfo
*/
bool dnsResolution(pjsip_tx_data *tdata);
/**
* This function unset the transport for a given account. It tests wether the
* associated transport is used by other accounts. If not, it shutdown the transport
......@@ -418,7 +413,7 @@ class SIPVoIPLink : public VoIPLink
/**
* Delete link-related stuff like calls
*/
bool pjsipShutdown (void);
void pjsipShutdown (void);
/**
* Resolve public address for this account
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment