Giter Site home page Giter Site logo

coturn's Introduction

Coturn docker deployment

Replace all CUSTOMIZE THIS strings inside the config and run with docker-compose up -d.

As for Prosody side see https://prosody.im/doc/coturn

iNPUTmice's A/V calls in Conversations provides more technical details.

ejabberd

ejabberd has built in STUN/TURN server so you won't need coturn (you still can use coturn if you like). Just upgrade to 20.04.

Then follow instructions for ejabberd. See also official resource for ejabberd.

Prosody

Make sure you have mod_turncredentials installed from prosody-modules repository (see https://prosody.im/doc/installing_modules) and it's the latest version. This is important as there were compatibility fixes merged upstream on 18.04.2020.

You can check if you got this part right via CAAS: https://compliance.conversations.im/test/stun/ and https://compliance.conversations.im/test/turn/ or via local installation: https://github.com/iNPUTmice/caas

If CAAS tests fail check if you updated your Prosody modules.

Alternatively use XML console (replace shakespeare.lit with your own domain):

<iq
    id='ul2bc7y6'
    to='shakespeare.lit'
    type='get'>
  <services xmlns='urn:xmpp:extdisco:2'/>
</iq>

Response should contain two STUN and two TURN servers for Prosody.

If you get service-unavailable error as a reply then most likely you don't have the module installed or the installed version is too old.

Verify if urn:xmpp:extdisco:2 is listed as an advertised feature:

<iq type='get'
    to='shakespeare.lit'
    id='info1'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>

If only the first version is available (urn:xmpp:extdisco:1) then the module that you have is outdated.

If you have battery saver module installed update it too from upstream (patch) or you won't receive calls when the application is in the background.

Checking TURN

This checks if your coturn server is configured correctly.

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

Remove all servers.

Insert your stun server there: stun:example.com:3478 (replace domain and port name).

Get credentials using the make-credentials script or the XML console like in the previous step and insert the TURN server: turn:example.com:3478 select relay checkbox and click Gather candidates. You should get some relay components.

TURN relay candidates on site output

Site output should contain several Type = relay components.

Checking TURN in Conversations

Get adb running on one phone and grep for relay:

$ adb -d logcat -v time -s conversations | grep relay
sending candidate: audio:0:candidate:700011408 1 udp 41888255 ... 52256 typ relay raddr ... rport 46819 generation 0 ufrag VDdO network-id 3 network-cost 900:turn:...:3478?transport=udp:UNKNOWN
sending candidate: video:1:candidate:700011408 1 udp 41888255 ... 49581 typ relay raddr ... rport 59079 generation 0 ufrag VDdO network-id 3 network-cost 900:turn:...:3478?transport=udp:UNKNOWN
sending candidate: video:1:candidate:1731899232 1 udp 25110783 ... 50680 typ relay raddr ... rport 60907 generation 0 ufrag VDdO network-id 3 network-cost 900:turn:...:3478?transport=tcp:UNKNOWN         , sb=true
sending candidate: audio:0:candidate:1731899232 1 udp 25110783 ... 52082 typ relay raddr ... rport 56856 generation 0 ufrag VDdO network-id 3 network-cost 900:turn:...:3478?transport=tcp:UNKNOWN         1:
received candidate: audio:0:candidate:700011408 1 udp 41888255 ... 63762 typ relay raddr ... rport 56152 generation 0 ufrag /zqy::UNKNOWN
received candidate: audio:0:candidate:2721783836 1 udp 41820159 ... 51130 typ relay raddr ... rport 41410 generation 0 ufrag /zqy::UNKNOWN
remote candidate selected: :-1:candidate:700011408 1 udp 41888255 ... 63762 typ relay raddr ... rport 56152 generation 0 ufrag /zqy::UNKNOWN

Ideally it should have selected candidate with typ relay. Try to get phones behind NAT (two different WiFi networks or one mobile one WiFi).

Note about IPv6 connections

Some networks using IPv6 with Dual-Stack-Lite PCP (such as Orange PL) will fail the TURN connection silently. If you're experiencing connection issues on LTE make sure that your coturn has explicitly listed listening-ip for both IPv4 and IPv6.

Thanks for gdr, Holger and k8n from the Conversations channel (2020-04-30 23:17).

More details at https://dasheimnetzwerk.de/Lexikon/Netzwerkkonzepte/Eintrag_DSLite.html

Potential problems caused by Dual-Stack Lite (DS-Lite):

  • Voice over IP calls using the SIP protocol.

https://conference.apnic.net/data/37/2014-02-24-transition-technologies-tutorial_1393291083.pdf

coturn's People

Contributors

anjandev avatar wiktor-k avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coturn's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.