Integrate TURN|STUN with XMPP

domain-name-systemejabberdxmpp

How do XMPP clients find TURN or STUN servers? XEP-0215 isn't supported (by any servers or clients afaik), but XEP-0176 suggests using XEP-0215?

I am running both an XMPP and TURN server, and I would like XMPP client to be informed or discover my TURN server. What do pidgin/empathy (the clients I need to support) do? Is there a canonical cross-client approach? Possibly:

  • Embed information in disco (XEP-0030 – would be misuse)
  • Servers use XEP-0114 to work some "magic"
  • Clients check DNS records
  • Clients check host (derived from JID) @ well-known port
  • Clients do nothing (I hope not)

Thanks.

Also I am asking in the context of Jingle/ICE/RTP, however this applies to any use of TURN with XMPP.

Best Answer

Some XMPP clients (e.g. libpurple-based clients such as Adium and Pidgin) use DNS SRV records, cf.:

http://wiki.xmpp.org/web/SRV_Records#STUN_SRV_records

_stun._tcp.example.net. TTL IN SRV priority weight port target
_stun._udp.example.net. TTL IN SRV priority weight port target

e.g.

_stun._tcp.example.net. 86400 IN SRV 5 50 3478 server1.example.net.
_stun._tcp.example.net. 86400 IN SRV 10 30 3478 server2.example.net.
_stun._tcp.example.net. 86400 IN SRV 10 10 3478 server3.example.net.
_stun._tcp.example.net. 86400 IN SRV 10 10 3478 server4.example.net.
_stun._tcp.example.net. 86400 IN SRV 15 0 3478 backup.example.net.
_stun._udp.example.net. 86400 IN SRV 5 50 3478 server1.example.net.
_stuns._tcp.example.net. 86400 IN SRV 5 50 5349 server1.example.net.

http://wiki.xmpp.org/web/SRV_Records#TURN_SRV_records

_turn._tcp.example.net. TTL IN SRV priority weight port target
_turn._udp.example.net. TTL IN SRV priority weight port target
_turns._tcp.example.net. TTL IN SRV priority weight port target

e.g.

_turn._tcp.example.net. 86400 IN SRV 5 50 3478 server1.example.net.
_turn._tcp.example.net. 86400 IN SRV 10 30 3478 server2.example.net.
_turn._tcp.example.net. 86400 IN SRV 10 10 3478 server3.example.net.
_turn._tcp.example.net. 86400 IN SRV 10 10 3478 server4.example.net.
_turn._tcp.example.net. 86400 IN SRV 15 0 3478 backup.example.net.
_turn._udp.example.net. 86400 IN SRV 5 50 3478 server1.example.net.
_turns._tcp.example.net. 86400 IN SRV 5 50 5349 server1.example.net.
Related Topic