Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
huguesdk opened this issue Oct 30, 2020 · 10 comments
Open

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

huguesdk opened this issue Oct 30, 2020 · 10 comments
Assignees
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements

Comments

@huguesdk
Copy link

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 huguesdk added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Oct 30, 2020
@bkil
Copy link

bkil commented Nov 1, 2020

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: #2033 (comment)

@huguesdk huguesdk changed the title allow to use fallbackcall assist server (turn.matrix.org) allow to use fallback call assist server (turn.matrix.org) Nov 1, 2020
@huguesdk
Copy link
Author

huguesdk commented Dec 3, 2020

is this being considered?

@bmarty
Copy link
Member

bmarty commented Sep 28, 2021

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

@ouchadam
Copy link
Contributor

ouchadam commented Oct 22, 2021

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? 🤔

@opusforlife2
Copy link
Contributor

@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?

@ouchadam
Copy link
Contributor

ouchadam commented Oct 25, 2021

@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
element-hq/riot-android#3286
element-hq/riot-android#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

@opusforlife2
Copy link
Contributor

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.

@CicadaCinema
Copy link

CicadaCinema commented Nov 1, 2021

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.

@Galbar
Copy link

Galbar commented Aug 26, 2022

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?

@CicadaCinema
Copy link

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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements
Projects
None yet
8 participants