1

For video calling i am using Phonertc (based on Webrtc)

I set up turnserver in Ubuntu 14.04.3 LTS I followed the instruction from https://github.com/coturn/rfc5766-turn-server/

i dowloaded turnserver-3.2.5.9-debian-wheezy-ubuntu-mint-x86-64bits.tar.gz
from http://turnserver.open-sys.org/downloads/v3.2.5.9/ and setup according to provided instruction.

After installing i change the /etc/turnserver.conf and uncomment following lines:

fignerprint
lt-cred-mech
realm (i set my domain name)

on etc/turnuserdb.conf i added plain username and password

when i run turnserver using command 'turnserver' it prints log as

0: log file opened: /var/tmp/turn_14007_2016-05-17.log
0: 
RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
Version Citrix-3.2.5.9 'Marshal West'
0: 
Max number of open files/sockets allowed for this process: 4096
0: 
Due to the open files/sockets limitation,
max supported number of TURN Sessions possible is: 2000 (approximately)
0: 

==== Show him the instruments, Practical Frost: ====

0: TLS supported
0: DTLS supported
0: Redis supported
0: PostgreSQL supported
0: MySQL supported
0: OpenSSL compile-time version 0x1000105f: fresh enough
0: Default Net Engine version: 2 (UDP thread per network endpoint)

=====================================================

0: Config file found: /etc/turnserver.conf
0: Config file found: /etc/turnserver.conf
0: Config file found: /etc/turnuserdb.conf
0: WARNING: cannot find certificate file: turn_server_cert.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly
0: WARNING: cannot find private key file: turn_server_pkey.pem (1)
0: WARNING: cannot start TLS and DTLS listeners because private key file is not set properly
0: NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering listener addresses: =========
0: Listener address to use: 127.0.0.1
0: Listener address to use: 10.240.0.2
0: =====================================================
0: Total: 1 'real' addresses discovered
0: =====================================================
0: NO EXPLICIT RELAY ADDRESS(ES) ARE CONFIGURED
0: ===========Discovering relay addresses: =============
0: Relay address to use: 10.240.0.2
0: =====================================================
0: Total: 1 relay addresses discovered
0: =====================================================
Cannot create pid file: /var/run/turnserver.pid: Permission denied
0: Cannot create pid file: /var/run/turnserver.pid
0: pid file created: /var/tmp/turnserver.pid
0: IO method (main listener thread): epoll (with changelist)
0: Wait for relay ports initialization...
0:   relay 10.240.0.2 initialization...
0:   relay 10.240.0.2 initialization done
0: Relay ports initialization done
0: IO method (general relay thread): epoll (with changelist)
0: turn server id=0 created
0: Total UDP servers: 1
0: Total General servers: 1
0: IO method (cli thread): epoll (with changelist)
0: IO method (auth thread): epoll (with changelist)

i have setup ice servers in client as

iceServers: [
       {
         url: 'stun:stun.l.google.com:19302'

        },
        {
          url: self.config.turn.host,
          username: self.config.turn.username,
          password: self.config.turn.password
        }]

Here, when user calls from mobile, web user is supposed to see the video from mobile device. And it works fine on wifi network Now the problem is when i tried to call from 3g network or 4g network call will be established but there is no transfer of data(video). Screen gets black.

I also tried to check different link to check if my turnserver is running. Easy way to test TURN server and it says that the turnserver is not running.

I am confused if really my turnserver is not running or switching between stun and turn is not working.

Community
  • 1
  • 1
Tsujit Pathak
  • 77
  • 4
  • 14
  • i might be worng but I think you are setting the username/pass in the wrong place – mido May 18 '16 at 00:52
  • will u please suggest me where should i add it. according to their instruction i found that i should add flat username and password in etc/turnuserdb.conf – Tsujit Pathak May 18 '16 at 04:51
  • "sudo turnserver -a -o -v -n --no-dtls --no-tls -u test:test -r "someRealm" this is the smallest command I can think of for running the TURN server\ – mido May 18 '16 at 05:20
  • i tried it, but still its not working in 3G and 4G network. do u have any idea why 3g and 4g data transfer is not working – Tsujit Pathak May 18 '16 at 05:47
  • it is working in other networks? – mido May 18 '16 at 07:12
  • is the TURN server running on a public IP? – mido May 18 '16 at 07:13
  • yes it works on wifi. Also if i test video call using 3g on mobile and using wifi(of same isp providing 3g) then it is working. – Tsujit Pathak May 18 '16 at 07:18
  • i don't have much knowledge on server stuff, i just configured as suggested on installation guide, and i open all the ports needed for TURN to run. – Tsujit Pathak May 18 '16 at 07:20
  • guessing when you are running over wi-fi, both your ubuntu machine and TURN server are in same network, so no need of public ip, but for TURN server to be accessed from other machines on the internet, it needs to have a public IP – mido May 18 '16 at 07:23
  • how can i make TURN to run on public ip ? Do i need to setup things like listening ip on turnserver.conf ? actually i am running TURN server on one of the instance of google compute engine. – Tsujit Pathak May 18 '16 at 07:25
  • are you able to access the turn server(in gce) from other wifi networks? – mido May 18 '16 at 07:32
  • Even if i turn off the turnserver , connection between wifi network is working fine but i was not able to connect if mobile device is in 3G. I studied that only 80% of connection can be successful from STUN so TURN is needed for all connection. So i install it, but its not working yet. – Tsujit Pathak May 18 '16 at 07:47
  • you need to understand how WebRTC works, STUN is used for providing Public IP for the machine, TURN - acts as proxy for peer if said peer cannot be reached directly, usually because he is behind a symetric NAT – mido May 18 '16 at 08:18
  • i learned that, so i was trying to install TURN server so that i can make a video call from any network. can u please suggest me what should i do next to run turnserver now? i think i have gone through each and every link on google forum and on stack overflow and tried almost all option but i am not able to call from 3g and 4g network. – Tsujit Pathak May 18 '16 at 11:40
  • 1
    i configured TURN server in public ip and now its working fine. – Tsujit Pathak May 24 '16 at 04:46
  • good to know that the issue is solved, you can answer it and close the question. – mido May 24 '16 at 05:48
  • How did you configure it in public IP ? I am facing some issues with TURN, it starts in local but takes my local IP as relay address. Further more I also get IPv6 and IPv4 version mis match in about:webrtc logs in firefox. Anyone faced such issues ? – Bilbo Baggins Jun 12 '17 at 09:07

2 Answers2

1

i was having problem because my turnserver was not running in a public ip. i installed turnserver in an instance having public ip and access it through other network and now its working fine.

Tsujit Pathak
  • 77
  • 4
  • 14
  • Can you share the command you are using for running the turnserver. Thanks – Aayush Aarwal Jul 04 '17 at 11:54
  • what do you mean by command for running turnserver ? Which OS your are using? Install turnserver and setup credential according to installation guide. If you find any error while doing that then paste the error log over here. – Tsujit Pathak Jul 05 '17 at 09:08
  • if you have already setup trunserver and want to run from terminal you may test using command : sudo turnserver -a -o -v -n --no-dtls --no-tls -u yourUsername:yourPassword -r "yourRealm" – Tsujit Pathak Jul 05 '17 at 09:14
0

I think the problem might be the url config. Instead of 'url', you should use 'urls'.

iceServers: [
   {
     urls: 'stun:stun.l.google.com:19302'

    },
    {
      urls: self.config.turn.host,
      username: self.config.turn.username,
      password: self.config.turn.password
    }]

'url' is being deprecated. See here for more information: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer/urls

Tom Chen
  • 428
  • 1
  • 4
  • 9
  • this is not a solution in my case. I configured TURN server in public ip as suggested by @mido and now its working fine. – Tsujit Pathak May 24 '16 at 04:47