As I am fiddeling around with synapse and coturn as TURN/STUN-server lately I like to addd some findings. Might help some people to save some time.
Instructions I found for setting up coturn:
- decatec. de/home-server/nextcloud-talk-mit-eigenem-turn-server-coturn/
- www .nomachine. com/AR07N00894
- github. com/matrix-org/synapse/blob/master/docs/turn-howto.md
of course a good overview about flags and options is https://github.com/coturn/coturn/wiki/turnserver
Most important!
If you think: Hey, I opened all the ports on my router. Obviously the problem that nothing works is because of a buggy /etc/turnserver.conf! But how to know since the log-file is nowhere to find or simply empty!
Then please remember that freedombox comes with the firewallD. And as you installed coturn outside of plinth it is not configured as a service in firewalld. So all the ports you opened in your router/NAT are still blocked by your homeserver.
Invest some minutes in learning how to add a service and ports to it using firewalld-cmd …
To have a working log you need to add the verbose and the simple-log flags than you might find it under /var/log/turnserver.log (check the path in config-file).
After restarting the coturn daemon you can watch the log by
sudo tail -f /var/log/turnserver.log
With https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ you can check if your stun/turn server receives signal or can be found. Or you can
apt install stun-client
on another machine and
stun yourdoma.in -p 3478
if you want to use your letsencrypt certs for the turn server remember that its privileges don’t suffice to read them. You might change the group of the services process with sudo systemctl edit --full turnserver
from turnserver to root.
Right now coturn does receive information when trying to videocall with matrix but the call doesn’t get media streams to work. The screens turn black and call is canceled.
I used the coturn server in a nextcloud config of Nextcloud Talk on another machine. A conference between the same devices (Notebook and Android both with Firefox) works with Video/Audio and the turnserver.log indicates that it works.
Tomorrow I’ll try to find out why Matrix-Calls still don’t work and what authentification method of coturn might have to do with it.
As you see: To fiddle with TURN-server is a pain in the ass.
So it would obviously be great to solve this make an one-click-app of it !