3
votes

I don't get any candidates while testing my STUN & TURN server (CoTurn) with Trickle ICE on a MacBook 10.12.6 using Chrome 62.0.3202.89:

https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/

with:

stun:<ip-adres>:3478
turn:<ip-adres>:3478 [username:test]    

On Digital Ocean I created a droplet Ubuntu 16.04.3 x64 and installed CoTurn version 4.5.0.3 doing:

sudo apt-get update
sudo apt-get install coturn

By default the firewall is inactive.

Next, I edited sudo vi /etc/turnserver.conf and give the following options:

fingerprint
lt-cred-mech
user=username:test
realm=<ip-adres>
listening-ip=<ip-adres>
relay-ip=<ip-adres>
external-ip=<ip-adres>

Next, I edit sudo vi /etc/default/coturn and uncomment the option:

TURNSERVER_ENABLED=1

Then I start the Coturn daemon:

sudo systemctl start coturn
sudo systemctl status coturn

This gives the output:

● coturn.service - LSB: coturn TURN Server
   Loaded: loaded (/etc/init.d/coturn; bad; vendor preset: enabled)
   Active: active (exited) since Sat 2017-11-11 20:27:10 UTC; 52s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1386 ExecStart=/etc/init.d/coturn start (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
      CPU: 0

Nov 11 20:27:10 coturn systemd[1]: Starting LSB: coturn TURN Server...
Nov 11 20:27:10 coturn coturn[1386]:  * coturn disabled in /etc/default/coturn turnserver
Nov 11 20:27:10 coturn coturn[1386]:    ...done.
Nov 11 20:27:10 coturn coturn[1386]:  * See /etc/default/coturn for instructions on enabling turnserver
Nov 11 20:27:10 coturn coturn[1386]:    ...done.
Nov 11 20:27:10 coturn systemd[1]: Started LSB: coturn TURN Server.
Nov 11 20:27:53 coturn systemd[1]: Started LSB: coturn TURN Server.

Please help me, what is still needed here to let it work?

2
What browser and device are you trying the Trickle ICE from? Unless you hate life, do not use an iPhone or Safari while learning.Justin
Also, the Ubuntu 16 package is an older version of CoTURN. Not sure if that is hurting you, but I had to build mine, which was somewhat of a pain. I was too stupid to write down the steps. Okay I remember now... I had to update it to the latest version to get the web admin interface to work.Justin
@Justin, the resiprocate-turn-server from Ubuntu repositories works as it is. Maybe we should use it instead of CoTurn.Velkan
@Justin I am using Chrome 62.0.3202.89 on a MacBook 10.12.6 when trying Trickle ICE (I updated the post too with this information)Herman Fransen
@Justin, yes I know this is an older version, I don't mind for now. I first want to get it to work. I tried to build and install the latest version, that didn't work out since my linux knowledge is not sufficient.Herman Fransen

2 Answers

4
votes

Starting doesn't work:

sudo systemctl start coturn

This seems like a bug.

To fix this bug:

sudo systemctl edit --full coturn

Delete everything and paste this:

[Unit]  
Description=coturn  
Documentation=man:coturn(1) man:turnadmin(1) man:turnserver(1)
After=syslog.target network.target

[Service]
Type=forking
User=turnserver
Group=turnserver
RuntimeDirectory=turnserver
RuntimeDirectoryMode=0750
EnvironmentFile=/etc/default/coturn
PIDFile=/run/turnserver/turnserver.pid
ExecStart=/usr/bin/turnserver --daemon --pidfile /run/turnserver/turnserver.pid --syslog -c /etc/turnserver.conf $EXTRA_OPTIONS
Restart=on-abort
LimitCORE=infinity
LimitNOFILE=1000000
LimitNPROC=60000
LimitRTPRIO=infinity
LimitRTTIME=7000000
CPUSchedulingPolicy=other
UMask=0007

[Install]
WantedBy=multi-user.target

After modifying the unit file, I reload the systemd process itself to pick up my changes:

sudo systemctl daemon-reload

Now starting actual works:

sudo systemctl start coturn

To make it automatically restart at reboot:

sudo systemctl enable coturn
2
votes

I had the same issue, but simply doing a systemctl restart coturn made it start working for me. Before that, just doing systemctl start or stop reported success but no process was actually started.