From 45acdeb232176818fac2bf735bec834314212fa9 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Tue, 17 Nov 2020 17:43:10 +0200 Subject: [PATCH] STUN/TURN Server URI schemes 'stuns' and 'turns' are not currently supported --- app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt | 2 +- app/src/main/kotlin/com/tutpro/baresip/Utils.kt | 3 +-- app/src/main/res/values-fi/strings.xml | 4 ++-- app/src/main/res/values/strings.xml | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt index 12c7125b..b5f171bc 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt @@ -340,7 +340,7 @@ class AccountActivity : AppCompatActivity() { if (((mediaNat == "stun") || (mediaNat == "ice")) && (newStunServer == "")) newStunServer = resources.getString(R.string.stun_server_default) if (!Utils.checkStunUri(newStunServer) || - ((mediaNat == "turn") && !newStunServer.startsWith("turn"))) { + ((mediaNat == "turn") && !newStunServer.startsWith("turn:"))) { Utils.alertView(this, getString(R.string.notice), String.format(getString(R.string.invalid_stun_server), newStunServer)) return false diff --git a/app/src/main/kotlin/com/tutpro/baresip/Utils.kt b/app/src/main/kotlin/com/tutpro/baresip/Utils.kt index fce27dca..dfc6bd1e 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/Utils.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/Utils.kt @@ -125,8 +125,7 @@ object Utils { } fun checkStunUri(uri: String): Boolean { - if (!uri.startsWith("stun:") && !uri.startsWith("stuns:") && - !uri.startsWith("turn:") && !uri.startsWith("turns:")) + if (!uri.startsWith("stun:") && !uri.startsWith("turn:")) return false return checkHostPort(uri.substringAfter(":")) } diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 1db6674c..fee33030 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -131,8 +131,8 @@ STUN/TURN-palvelin STUN/TURN-palvelimen muotoa \'kaava:palvelin[:portti]\' - oleva URI, missä kaava on \'stun\', \'stuns\', \'turn\' tai \'turns\'. Oletus STUN-palvelin - STUN ja ICE protokollille on \'stun:stun.l.google.com:19302\', joka osoittaa Google:n + oleva URI, missä kaava on \'stun\' tai \'turn\'. Oletus STUN-palvelin + STUN- ja ICE-protokollille on \'stun:stun.l.google.com:19302\', joka osoittaa Google:n julkiseen STUN-palvelimeen. TURN-palvelimella ei ole oletusarvoa. STUN/TURN-palvelimen URI diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f73b0f26..898b2c00 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -126,7 +126,7 @@ STUN/TURN Server A STUN/TURN Server URI of form scheme:host[:port], where scheme - is \'stun\', \'stuns\', \'turn\', or \'turns\'. Factory default STUN Server for STUN and + is \'stun\' or \'turn\'. Factory default STUN Server for STUN and ICE protocols is \'stun:stun.l.google.com:19302\' pointing to public Google STUN server. There is no factory default TURN server.