Docs/Intercom
TURN server.
Phones on 4G/5G (behind CGNAT) need a relay so the Intercom audio always gets through. In SRT Server it is chosen in Settings › Intercom and, if you use the tunnel, you already have it.
- Settings › Intercom
- coturn 4.6.3
- Port 3478
First
Choose your TURN.
Open the App, click the gear button and go to Intercom. The Intercom window shows which one it uses, and its «Configure» button takes you there.
-
01
The tunnel server's
If the PC connects through your own tunnel server (own NAS or Amazon Lightsail, the package the App creates), that server already carries the TURN. Choose «The tunnel server's» and you are done.
-
02
SAMedia service
With SAMedia's connection service, choose «SAMedia service»: the App gets temporary credentials with your license. It counts towards your plan limits.
-
03
Own (Lightsail · coturn)
In Direct mode (router ports), set up your own coturn with the steps below: 15 minutes and under $5 a month.
Own
Your coturn on Amazon Lightsail · 15 minutes
-
01
Create the instance in Amazon Lightsail
Choose the $3.50–5/month plan (512 MB–1 GB RAM is enough) and «OS Only → Ubuntu 22.04 LTS». Attach a static IP to the instance: the App needs it fixed.
-
02
Open the ports in the Lightsail firewall
In the instance's «Networking» tab add these rules:
3478 TCP + UDP # STUN / TURN 49152-65535 UDP # WebRTC media relay
-
03
Install Docker
Connect via SSH and install Docker with the official script:
curl -fsSL https://get.docker.com | sh sudo usermod -aG docker $USER && newgrp docker
-
04
Generate the secret in the App
In Settings › Intercom choose «Own (Lightsail · coturn)», type the instance's static IP, click «Generate secret» and then «Copy coturn command». The secret never leaves your PC: phones get temporary credentials that renew themselves.
-
05
Paste the command on the instance
Open the Lightsail SSH console and paste the copied command (it looks like this; always use the App's, which carries your IP and your secret). Use coturn 4.6.3: the latest version does not answer over UDP.
P=$(hostname -I | awk '{print $1}') A='--realm=intercom.srtserver.app --use-auth-secret --static-auth-secret=xxxxxxxx' A="$A --listening-ip=$P --relay-ip=$P --external-ip=203.0.113.10/$P" A="$A --listening-port=3478 --min-port=49152 --max-port=65535" A="$A --relay-threads=0 --no-tls --no-dtls --fingerprint --log-file=stdout" sudo systemctl disable --now coturn 2>/dev/null docker pull coturn/coturn:4.6.3 && docker rm -f coturn docker run -d --name coturn --restart always --network host coturn/coturn:4.6.3 $A sleep 3; docker ps --format '{{.Names}} {{.Image}} {{.Status}}' | grep coturn -
06
Test it from the App
In the same section, click «Test TURN». If it says «TURN works», operators on 4G/5G can connect: they get the settings by themselves when they open their link.