Not getting relay data after setting up coturn on ec2

667 views
Skip to first unread message

Abhishek Chaubey

unread,
Jun 21, 2021, 1:13:18 AM6/21/21
to TURN Server (Open-Source project)
Hi Everyone.

Facing issue with co turn.
All the required ports are enabled and firewall is inactive.

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

When on wifi same network

TURN CACHY
Time Component Type Foundation Protocol Address Port Priority
0.005 rtp host 0 udp aa754c6d-e3e5-429c-a8c6-3bb23f563bc6.local 51409 126 | 32512 | 255
0.005 rtp host 5 tcp aa754c6d-e3e5-429c-a8c6-3bb23f563bc6.local 9 125 | 32704 | 255
0.005 rtcp host 0 udp aa754c6d-e3e5-429c-a8c6-3bb23f563bc6.local 51410 126 | 32512 | 254
0.005 rtcp host 5 tcp aa754c6d-e3e5-429c-a8c6-3bb23f563bc6.local 9 125 | 32704 | 254
0.273 rtcp srflx 1 udp 150.129.44.218 51410 100 | 32543 | 254
0.280 rtp srflx 1 udp 150.129.44.218 51409 100 | 32543 | 255
11.495 Done

I can't see any relay candidate which means i think our turn is not in the play
STUN CACHY
Time Component Type Foundation Protocol Address Port Priority
0.004 rtp host 0 udp 411f805e-f101-4fd1-a0b0-a5fbcf09751b.local 49170 126 | 32512 | 255
0.004 rtp host 5 tcp 411f805e-f101-4fd1-a0b0-a5fbcf09751b.local 9 125 | 32704 | 255
0.004 rtcp host 0 udp 411f805e-f101-4fd1-a0b0-a5fbcf09751b.local 49171 126 | 32512 | 254
0.005 rtcp host 5 tcp 411f805e-f101-4fd1-a0b0-a5fbcf09751b.local 9 125 | 32704 | 254
0.054 rtp srflx 1 udp 150.129.44.218 49170 100 | 32543 | 255
0.118 rtcp srflx 1 udp 150.129.44.218 49171 100 | 32543 | 254
11.248 Done

On Nat enabled network.
When selected All
Time Component Type Foundation Protocol Address Port Priority
0.005 rtp host 0 udp 41d53e43-752c-4d23-a5ed-9b505f512b58.local 62303 126 | 32512 | 255
0.006 rtp host 3 tcp 41d53e43-752c-4d23-a5ed-9b505f512b58.local 9 125 | 32704 | 255
0.006 rtcp host 0 udp 41d53e43-752c-4d23-a5ed-9b505f512b58.local 62304 126 | 32512 | 254
0.006 rtcp host 3 tcp 41d53e43-752c-4d23-a5ed-9b505f512b58.local 9 125 | 32704 | 254
11.207

When selected Relay
Time Component Type Foundation Protocol Address Port Priority
11.160
Not reachable?

Turnserver.config


 /etc/turnserver.conf
# STUN server port is 3478 for UDP and TCP, and 5349 for TLS.
# Allow connection on the UDP port 3478
listening-port=3478
# and 5349 for TLS (secure)
tls-listening-port=5349

# Require authentication
fingerprint
lt-cred-mech

# We will use the longterm authentication mechanism, but if
# you want to use the auth-secret mechanism, comment lt-cred-mech and 
# uncomment use-auth-secret
#The static auth secret needs to be changed, in this tutorial
# we'll generate a token using OpenSSL
# use-auth-secret
# static-auth-secret=replace-this-secret
# ----
# If you decide to use use-auth-secret, After saving the changes, change the auth-secret using the following command:
# sed -i "s/replace-this-secret/$(openssl rand -hex 32)/" /etc/turnserver.conf
# This will replace the replace-this-secret text on the file with the generated token using openssl. 

# Specify the server name and the realm that will be used
# if is your first time configuring, just use the domain as name
server-name=bloggernepal.com

# Important: 
# Create a test user if you want
# You can remove this user after testing
user=guest:somepassword

total-quota=100
stale-nonce=600

# Path to the SSL certificate and private key. In this example we will use
# the letsencrypt generated certificate files.
cert=/etc/letsencrypt/live/stun.bloggernepal.com/cert.pem
pkey=/etc/letsencrypt/live/stun.bloggernepal.com/privkey.pem

# Specify the allowed OpenSSL cipher list for TLS/DTLS connections
cipher-list="ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384"

# Specify the process user and group
proc-user=turnserver
proc-group=turnserver

Used this from  

https://www.bloggernepal.com/2021/05/setup-stun-and-turn-server-on-ubuntu.html

Any help would be appreciated



Giacomo Vacca

unread,
Jul 26, 2021, 10:09:41 AM7/26/21
to TURN Server (Open-Source project)
There are various ways you can debug this:
- Open the Chrome Developer Tools (cmd, option, I) and select "Console" to read what the application is logging (and confirmation of what TURN configuration the application is using).
- Take a network trace on the client machine - you should see the STUN Binding Requests towards the TURN server, followed by Allocate requests. Maybe they are failing if the credentials are wrong.
- Take a network trace on the host where coturn is running - you should see the TURN activity if the server is reachable from the client.

You can also use turnutils_uclient to verify that the TURN server is working correctly (https://manpages.debian.org/testing/coturn/turnutils_uclient.1.en.html).

Giacomo
Message has been deleted

Olivier Anguenot

unread,
Aug 15, 2021, 12:25:26 PM8/15/21
to TURN Server (Open-Source project)
I've had the same error and the problem on my side was the configuration of the relay-ip parameter.

For my Coturn instance on EC2, I put relay-ip  as described in the turnserver.conf (default)

Olivier

iwasaki_at_silklab

unread,
Aug 19, 2021, 5:37:56 AM8/19/21
to TURN Server (Open-Source project)
Hi,
I'm not sure this is relevant to your case, but one thing I remember about the Tricle-ICE client is it needed user and password to get to TURN (relay) servers, while it didn't to get to STUN servers.

As for EC2, maybe turnserver -E option has to be provided with the global IP address of your EC2 instance.
 iwasaki

2021年6月21日月曜日 14:13:18 UTC+9 abhishek...@cachy.com:
Reply all
Reply to author
Forward
0 new messages