diff --git a/lib/Config.php b/lib/Config.php index a7163ef9cd1..c3c807e1ad6 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -243,6 +243,10 @@ public function getTurnServers(): array { return []; } + foreach ($servers as $key => $server) { + $servers[$key]['schemes'] = $server['schemes'] ?? 'turn'; + } + return $servers; } @@ -256,6 +260,7 @@ public function getTurnSettings(): array { if (empty($servers)) { return [ + 'schemes' => '', 'server' => '', 'username' => '', 'password' => '', @@ -278,6 +283,7 @@ public function getTurnSettings(): array { $password = base64_encode(hash_hmac('sha1', $username, $server['secret'], true)); return [ + 'schemes' => $server['schemes'], 'server' => $server['server'], 'username' => $username, 'password' => $password, diff --git a/lib/Controller/SignalingController.php b/lib/Controller/SignalingController.php index fc315158fba..de5518e0f79 100644 --- a/lib/Controller/SignalingController.php +++ b/lib/Controller/SignalingController.php @@ -147,14 +147,17 @@ public function getSettings(string $apiVersion, string $token = ''): DataRespons $turn = []; $turnSettings = $this->talkConfig->getTurnSettings(); if (!empty($turnSettings['server'])) { + $schemes = explode(',', $turnSettings['schemes']); $protocols = explode(',', $turnSettings['protocols']); - foreach ($protocols as $proto) { - $turn[] = [ - 'url' => ['turn:' . $turnSettings['server'] . '?transport=' . $proto], - 'urls' => ['turn:' . $turnSettings['server'] . '?transport=' . $proto], - 'username' => $turnSettings['username'], - 'credential' => $turnSettings['password'], - ]; + foreach ($schemes as $scheme) { + foreach ($protocols as $proto) { + $turn[] = [ + 'url' => [$scheme . ':' . $turnSettings['server'] . '?transport=' . $proto], + 'urls' => [$scheme . ':' . $turnSettings['server'] . '?transport=' . $proto], + 'username' => $turnSettings['username'], + 'credential' => $turnSettings['password'], + ]; + } } } diff --git a/src/components/AdminSettings/StunServer.vue b/src/components/AdminSettings/StunServer.vue index 080bdf92d2d..e302504fc8d 100644 --- a/src/components/AdminSettings/StunServer.vue +++ b/src/components/AdminSettings/StunServer.vue @@ -22,6 +22,8 @@