I want to configure STUN/TURN in ejabberd in order to use WebRTC with 'Conversations' XMPP client.
Of course I read ejabberd STUN/TURN documentation and how to configure DNS SRV records. I also temporarily set authentication to anonymous. According to the gist A/V calls in Conversations I tested ICE / STUN / TURN with adb logcat and Trickle ICE.
My problem is: I do see "discovered ICE servers" and "STUN candidate" with type "srflx" (so I think STUN works correctly), but there is no "candidate" with type "relay", I just get type "host". Sometimes(!) I get the notification: "Not reachable?"
My config (ejabberd.yml):
'listen' is configured for udp and tcp, both with use_turn: true
'mod_stun_disco' contains four entries: type: stun and turn and transport: udp and tcp, all with identical IP and portnumber, matching the DNS SRV records.
listen:
-
port: 43210
transport: udp
module: ejabberd_stun
use_turn: true
## The server's public IPv4 address:
turn_ip: 123.123.123.123 # Servers real IPv4 IP
auth_type: anonymous
mod_stun_disco:
services:
-
host: 123.123.123.123 # Servers real IPv4 IP
port: 43210
type: turn
transport: udp
So my last possible source of trouble is: I'm using a 'beginners friendly' managed hosting provider where I only have an unprivileged user account (Fedora). So I built and run ejabberd as a user and had to open several custom firewall ports: c2s, s2s_in, https, with and without TLS (and 'let's encrypt' certificate). But AFAICS everything works fine, everything except TURN. Of course I have no rights to run tcpdump to analyze TCP / UDP Traffic, but in ejabberd.log there I can find:
[info] @mod_stun_disco:handle_call:332 Offering STUN/TURN services to user@server.tld/Conversations.AbCD
And when I increase the loglevel to debug, with a real XMPP-Client there are 'Send XML on stream' entries with "reading that 'Relay candidate harvesting in WebRTC only works with credentials.', I changed auth: anonymous to user and provided the plaintext-credentials of a valid testuser to TrickleICE, and now I only see 'Not an ephemeral username' in my log.
So my question is: What to try next? Does anyone know whats going wrong? Or is there a way to dig deeper into debugging?