From eeca625af6ab615e5108a7593a23ffe14b5fc89d Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 19 Apr 2020 19:46:43 +0200 Subject: [PATCH] Some more settings --- server/src/Configuration.cpp | 14 ++++++++++++++ server/src/Configuration.h | 3 +++ server/src/client/web/VoiceBridge.cpp | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/server/src/Configuration.cpp b/server/src/Configuration.cpp index 32de01d..0dfeb23 100644 --- a/server/src/Configuration.cpp +++ b/server/src/Configuration.cpp @@ -127,6 +127,8 @@ bool config::web::stun_enabled; std::string config::web::stun_host; uint16_t config::web::stun_port; bool config::web::enable_upnp; +bool config::web::udp_enabled; +bool config::web::tcp_enabled; size_t config::log::vs_size; std::string config::log::path; @@ -1489,6 +1491,18 @@ std::deque> config::create_bindings() { ADD_DESCRIPTION("Port of the stun server"); ADD_NOTE_RELOADABLE(); } + { + CREATE_BINDING("webrtc.udp", 0); + BIND_INTEGRAL(config::web::udp_enabled, true, false, true); + ADD_DESCRIPTION("Enable UDP for theweb client"); + ADD_NOTE_RELOADABLE(); + } + { + CREATE_BINDING("webrtc.tcp", 0); + BIND_INTEGRAL(config::web::tcp_enabled, true, false, true); + ADD_DESCRIPTION("Enable TCP for theweb client"); + ADD_NOTE_RELOADABLE(); + } } { BIND_GROUP(geolocation); diff --git a/server/src/Configuration.h b/server/src/Configuration.h index eeb6fc2..7cb7076 100644 --- a/server/src/Configuration.h +++ b/server/src/Configuration.h @@ -214,6 +214,9 @@ namespace ts::config { extern bool stun_enabled; extern std::string stun_host; extern uint16_t stun_port; + + extern bool tcp_enabled; + extern bool udp_enabled; } namespace threads { diff --git a/server/src/client/web/VoiceBridge.cpp b/server/src/client/web/VoiceBridge.cpp index 3882e0e..8a1623a 100644 --- a/server/src/client/web/VoiceBridge.cpp +++ b/server/src/client/web/VoiceBridge.cpp @@ -72,8 +72,8 @@ VoiceBridge::VoiceBridge(const shared_ptr& owner) : _owner(owner) { if(config::web::stun_enabled) config->nice_config->stun_server = { config::web::stun_host, config::web::stun_port }; - config->nice_config->allow_ice_udp = true; - config->nice_config->allow_ice_tcp = false; + config->nice_config->allow_ice_udp = config::web::udp_enabled; + config->nice_config->allow_ice_tcp = config::web::tcp_enabled; config->nice_config->use_upnp = config::web::enable_upnp; gioloop::initialize();