Skip to content
Snippets Groups Projects
Commit bd2d9d27 authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

ring: use turn.ring.cx as default TURN server

Give a default TURN server at Ring account creation.
This server is a proposed by Savoir-faire Linux.

Change-Id: I95b4c8d3e9a7efe0fcd109a5ba7246927723dced
parent 12996f11
No related branches found
No related tags found
No related merge requests found
...@@ -79,6 +79,10 @@ static constexpr auto ICE_NEGOTIATION_TIMEOUT = std::chrono::seconds(60); ...@@ -79,6 +79,10 @@ static constexpr auto ICE_NEGOTIATION_TIMEOUT = std::chrono::seconds(60);
static constexpr auto TLS_TIMEOUT = std::chrono::seconds(30); static constexpr auto TLS_TIMEOUT = std::chrono::seconds(30);
static constexpr const char * const RING_URI_PREFIX = "ring:"; static constexpr const char * const RING_URI_PREFIX = "ring:";
static constexpr const char * DEFAULT_TURN_SERVER = "turn.ring.cx";
static constexpr const char * DEFAULT_TURN_USERNAME = "ring";
static constexpr const char * DEFAULT_TURN_PWD = "ring";
static constexpr const char * DEFAULT_TURN_REALM = "ring";
constexpr const char * const RingAccount::ACCOUNT_TYPE; constexpr const char * const RingAccount::ACCOUNT_TYPE;
/* constexpr */ const std::pair<uint16_t, uint16_t> RingAccount::DHT_PORT_RANGE {4000, 8888}; /* constexpr */ const std::pair<uint16_t, uint16_t> RingAccount::DHT_PORT_RANGE {4000, 8888};
...@@ -142,6 +146,13 @@ RingAccount::RingAccount(const std::string& accountID, bool /* presenceEnabled * ...@@ -142,6 +146,13 @@ RingAccount::RingAccount(const std::string& accountID, bool /* presenceEnabled *
cachePath_ = fileutils::get_cache_dir()+DIR_SEPARATOR_STR+getAccountID(); cachePath_ = fileutils::get_cache_dir()+DIR_SEPARATOR_STR+getAccountID();
dataPath_ = cachePath_ + DIR_SEPARATOR_STR "values"; dataPath_ = cachePath_ + DIR_SEPARATOR_STR "values";
idPath_ = fileutils::get_data_dir()+DIR_SEPARATOR_STR+getAccountID(); idPath_ = fileutils::get_data_dir()+DIR_SEPARATOR_STR+getAccountID();
// Force the SFL turn server if none provided yet
turnServer_ = DEFAULT_TURN_SERVER;
turnServerUserName_ = DEFAULT_TURN_USERNAME;
turnServerPwd_ = DEFAULT_TURN_PWD;
turnServerRealm_ = DEFAULT_TURN_REALM;
turnEnabled_ = true;
} }
RingAccount::~RingAccount() RingAccount::~RingAccount()
...@@ -525,6 +536,7 @@ void ...@@ -525,6 +536,7 @@ void
RingAccount::setAccountDetails(const std::map<std::string, std::string> &details) RingAccount::setAccountDetails(const std::map<std::string, std::string> &details)
{ {
SIPAccountBase::setAccountDetails(details); SIPAccountBase::setAccountDetails(details);
if (hostname_.empty()) if (hostname_.empty())
hostname_ = DHT_DEFAULT_BOOTSTRAP; hostname_ = DHT_DEFAULT_BOOTSTRAP;
parseInt(details, Conf::CONFIG_DHT_PORT, dhtPort_); parseInt(details, Conf::CONFIG_DHT_PORT, dhtPort_);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment