Skip to content
Snippets Groups Projects
Commit b60f5ef3 authored by Brando Tovar's avatar Brando Tovar Committed by Sébastien Blin
Browse files

settings: reads port of the turn server

This patch enables Jami to read the port of the turn server after the ':'.

Change-Id: I045e3aa585b3d725445f666d2c9f8629501f124c
Gitlab: #258
parent f2c38a56
No related branches found
No related tags found
No related merge requests found
...@@ -262,7 +262,8 @@ add_turn_server(pj_pool_t& pool, pj_ice_strans_cfg& cfg, const TurnServerInfo& i ...@@ -262,7 +262,8 @@ add_turn_server(pj_pool_t& pool, pj_ice_strans_cfg& cfg, const TurnServerInfo& i
pj_ice_strans_turn_cfg_default(&turn); pj_ice_strans_turn_cfg_default(&turn);
pj_strdup2_with_null(&pool, &turn.server, ip.toString().c_str()); pj_strdup2_with_null(&pool, &turn.server, ip.toString().c_str());
turn.af = ip.getFamily(); turn.af = ip.getFamily();
turn.port = PJ_STUN_PORT; if (!(turn.port = ip.getPort()))
turn.port = PJ_STUN_PORT;
turn.cfg.max_pkt_size = STUN_MAX_PACKET_SIZE; turn.cfg.max_pkt_size = STUN_MAX_PACKET_SIZE;
turn.conn_type = cfg.turn.conn_type; turn.conn_type = cfg.turn.conn_type;
......
...@@ -449,14 +449,14 @@ SIPAccountBase::getIceOptions() const noexcept ...@@ -449,14 +449,14 @@ SIPAccountBase::getIceOptions() const noexcept
cached = cacheTurnV4_ || cacheTurnV6_; cached = cacheTurnV4_ || cacheTurnV6_;
if (cacheTurnV4_ && *cacheTurnV4_) { if (cacheTurnV4_ && *cacheTurnV4_) {
opts.turnServers.emplace_back(TurnServerInfo() opts.turnServers.emplace_back(TurnServerInfo()
.setUri(*cacheTurnV4_) .setUri(cacheTurnV4_->toString(true))
.setUsername(turnServerUserName_) .setUsername(turnServerUserName_)
.setPassword(turnServerPwd_) .setPassword(turnServerPwd_)
.setRealm(turnServerRealm_)); .setRealm(turnServerRealm_));
} }
if (cacheTurnV6_ && *cacheTurnV6_) { if (cacheTurnV6_ && *cacheTurnV6_) {
opts.turnServers.emplace_back(TurnServerInfo() opts.turnServers.emplace_back(TurnServerInfo()
.setUri(*cacheTurnV4_) .setUri(cacheTurnV4_->toString(true))
.setUsername(turnServerUserName_) .setUsername(turnServerUserName_)
.setPassword(turnServerPwd_) .setPassword(turnServerPwd_)
.setRealm(turnServerRealm_)); .setRealm(turnServerRealm_));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment