element-android icon indicating copy to clipboard operation
element-android copied to clipboard

allow to use fallback call assist server (turn.matrix.org)

Open huguesdk opened this issue 5 years ago • 11 comments

it seems that element android does not allow to use the fallback call assist server (turn.matrix.org), while riot android did, and element web does.

this option is useful for people running their own homeserver without a turn server. ideally, each homeserver should have its turn server, but it is not always possible to run one. it can be because of network traffic or computing power limitations, or because of network setup constraints. for example, when the homeserver is running in a home network behind nat and has a different ip address inside and outside the home network, running a turn server on it does not seem to work (or if it is, its configuration seems pretty challenging).

will you please add this option?

huguesdk avatar Oct 30 '20 21:10 huguesdk

Or it could also be a case that the homeserver is not configured correctly or there were unintended network configuration changes either by the operator or the host. So it should definitely be useful to have backup servers listed. See my comment here: https://github.com/vector-im/element-android/issues/2033#issuecomment-720012557

bkil avatar Nov 01 '20 01:11 bkil

is this being considered?

huguesdk avatar Dec 03 '20 20:12 huguesdk

@ganfra can we close this issue, i.e. is it implemented now?

bmarty avatar Sep 28 '21 12:09 bmarty

From my understanding it doesn't look like we currently provide a fallback

Call flow

  • Fetch the Homeserver TurnServerResponse from CallSignalingService.getTurnServer
  • Map the TurnServerResponse.uris to IceServers
  • Create an RTCConfiguration from the IceServers
  • Create a peer connection from the RTCConfiguration

When the homeserver doesn't have turn enabled it has an no uris meaning we provide an empty IceServers list to the RTCConfiguration

TurnServerResponse(username=null, password=null, uris=null, ttl=null)

compared to a matrix.org account

TurnServerResponse(username=redacted, password=redacted, uris=[turn:turn.matrix.org:3478?transport=udp, turn:turn.matrix.org:3478?transport=tcp, turns:turn.matrix.org:443?transport=tcp], ttl=86400)

https://github.com/vector-im/element-android/blob/develop/vector/src/main/java/im/vector/app/features/call/webrtc/WebRtcCall.kt#L273


The rtc connection also requires a username and password which is provided to us by the homeserver turn response, is it possible to have a client side fallback? :thinking:

ouchadam avatar Oct 22 '21 14:10 ouchadam

@ouchadam Question: does the lack of this fallback mean that users (clients) on a VoIP call cannot connect to each other after picking the other's call?

Or is this something different altogether?

opusforlife2 avatar Oct 23 '21 19:10 opusforlife2

@opusforlife2 it depends~ on my personal homeserver without turn I can make calls fine on WiFi but mobile data fails to connect

It's related to call stability and compatibility due to network configuration (firewalls/port forwarding etc)

More references to defaults/fallbacks from riot https://github.com/vector-im/riot-android/pull/3286 https://github.com/vector-im/riot-android/issues/3251


After speaking internally

  • turn.matrix.org supports both STUN and TURN
  • STUN allows unauthenticated usage at the cost of leaking user information (eg pointing to a STUN server different to the homeserver)
  • We'll need to show an opt in dialog to warn the user about the risks of using the fallback STUN server

ouchadam avatar Oct 25 '21 09:10 ouchadam

Any idea why out of 2 devices on the same WLAN, I (on another wifi network) can successfully establish a VoIP call with one of them but not the other? Same ISP and same Wifi router for both devices, so you'd think the network configuration would be the same.

From reading this issue I thought it might have to do with turn, but from your latest comment it seems like that's not the case.

opusforlife2 avatar Oct 29 '21 17:10 opusforlife2

Could someone test my builds in #4391 with a homeserver that doesn't have its own turn server? You need to enable the fallback option in Settings>Voice & Video first. Myself, I've had mixed results on an emulator.

CicadaCinema avatar Nov 01 '21 17:11 CicadaCinema

I was wondering what was blocking this feature from being done. There seems to be a PR that does the thing since some time ago.

Is there anything I can help with to help to have this merged?

Galbar avatar Aug 26 '22 09:08 Galbar

I was wondering what was blocking this feature from being done. There seems to be a PR that does the thing since some time ago.

Is there anything I can help with to help to have this merged?

you could visit the following link, download the correct .apk build for your device, install it, sign in with your Matrix account, enable the turn server fallback option in the "voice and video" section of the settings, attempt to make calls between various devices (of course, the other device should be verified as working) and report the results/any bugs you encounter

https://buildkite.com/matrix-dot-org/element-android/builds/7567

these are just the auto-generated builds that have been created as a result of the changes in my pull request ( #5781 )

CicadaCinema avatar Aug 26 '22 21:08 CicadaCinema

by 2025 is this still considered to be added to play market android build?

bbetter avatar Feb 16 '25 15:02 bbetter