I’ve have configured my default Freedombox eJabberd XMPP chat server for STUN/TURN voice and video connections. However, I’m finding it hard to verify that the STUN/TURN server is configured correctly. There are some references to STUN and TURN in my eJabberd log files (detailed below) but I can’t tell if I’m testing my setup correctly. Any help with understanding how to test my set up would be much appreciated?
TESTS SO FAR
I’m able to make voice calls between two Jitsi clients (Jitsi is the only XMPP client that I have found that can reliably and compatibly make voice connections between devices). My Android phone is running the Jitsi app installed from an APK and my Ubuntu laptop is running the Jitsi desktop app from the jitsi_2.11.5624-1_amd64.deb package.
Both client devices are connected to the internet through VPN connections, to different locations. Because both devices are connected through VPNs and are managing to establish a voice connection, to me this suggests that the STUN/TURN relay server it being activated, but I would appreciate verification of my setup from others who know more about this than I do?
SETUP STEPS
Below are the details of my configuration and the steps I took to set up the eJabberd STUN/TURN server:
- created DNS XMPP, STUN and TURN SRV records with domain host, based on instructions from the eJabberd documentation, here;
- installed Rasbian Buster on Raspberry Pi3B+;
- installed Freedombox as per instructions on the Wiki;;
- updated Freedombox to version 2.7;
- created two user accounts;
- installed eJabberd via Plinth Freedombox;
- edited eJabberd config file:
sudo nano /etc/ejabberd/ejabberd.yml
- added STUN/TURN configuration (see below):
- restarted eJabberd via Plinth
- logged into the eJabberd with Jitsi on Android and desktop both via VPN - the desktop took about a min to show “online”;
- opened up eJabbered.log and eJabbered’s error.log in real time view in the terminal to view connection activity and ascertain if TURN is being used (further details below);
- initiate a voice call from either device and establish an audio connection - the connection is audible.
CONFIGURATION
DNS
Configuration of DNS SRV records based on info from the eJabbered documentation and further info here and here - see screenshot below (double click to enlarge image!):
EJABBERD CONFIG FILE
eJabberd STUN/TURN configuration, below, added to the eJabberd config file: /etc/ejabberd/ejabberd.yml
based on info from here:
certfiles:
- "/etc/ejabberd/letsencrypt/MY-DOMAIN-NAME/ejabberd.pem"
(I can’t remember if the above line was the default or not!)
STUN/TURN configuration lines
listen:
- port: 3478
transport: udp
module: ejabberd_stun
auth_type: user
auth_realm: "MY-DOMAIN-NAME"
use_turn: true
turn_ip: "MY-EXTERNAL-HOME-IP" # Your IP address
- port: 3478
transport: tcp
module: ejabberd_stun
auth_type: user
auth_realm: "MY-DOMAIN-NAME"
use_turn: true
turn_ip: "MY-EXTERNAL-HOME-IP" # Your IP address
LOGS
Having a look at the error.log
:
sudo su
cd /var/log/ejabberd
tail -f error.log
I had the following reference to STUN and TURN connecting, but have been unable to replicate:
2020-05-01 00:50:00.339 [error] <0.383.0>@ejabberd_listener:init:114 failed to process callback function ejabberd_stun:udp_init(#Port<0.15>, [{turn_ip,{MY-IP}},{use_turn,true},{auth_realm,<<"MY-DOMAIN-NAMEe">>}]): {'EXIT',{application_start_failed,[{ejabberd,exit_or_halt,2,[{file,"src/ejabberd.erl"},{line,142}]},{ejabberd_stun,udp_init,2,[{file,"src/ejabberd_stun.erl"},{line,61}]},{ejabberd_listener,init,4,[{file,"src/ejabberd_listener.erl"},{line,112}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}}
2020-05-01 00:50:00.348 [critical] <0.382.0>@ejabberd:exit_or_halt:137 failed to start application 'stun': {error,
{"no such file or directory","stun.app"}}
2020-05-01 00:50:00.349 [error] <0.382.0>@ejabberd_listener:init:146 failed to process callback function ejabberd_stun:tcp_init(#Port<0.14>, [{turn_ip,{MY-IP}},{use_turn,true},{auth_realm,<<"MY-DOMAIN-NAMEe">>}]): {'EXIT',{application_start_failed,[{ejabberd,exit_or_halt,2,[{file,"src/ejabberd.erl"},{line,142}]},{ejabberd_stun,tcp_init,2,[{file,"src/ejabberd_stun.erl"},{line,57}]},{ejabberd_listener,init,4,[{file,"src/ejabberd_listener.erl"},{line,144}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}}
2020-05-01 00:52:39.691 [critical] <0.392.0>@ejabberd:exit_or_halt:137 failed to start application 'stun': {error,
{"no such file or directory","stun.app"}}
2020-05-01 00:52:39.691 [error] <0.392.0>@ejabberd_listener:init:114 failed to process callback function ejabberd_stun:udp_init(#Port<0.15>, [{turn_ip,{MY-IP}},{use_turn,true},{auth_realm,<<"MY-DOMAIN-NAMEe">>}]): {'EXIT',{application_start_failed,[{ejabberd,exit_or_halt,2,[{file,"src/ejabberd.erl"},{line,142}]},{ejabberd_stun,udp_init,2,[{file,"src/ejabberd_stun.erl"},{line,61}]},{ejabberd_listener,init,4,[{file,"src/ejabberd_listener.erl"},{line,112}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}}
2020-05-01 00:52:39.717 [critical] <0.391.0>@ejabberd:exit_or_halt:137 failed to start application 'stun': {error,
{"no such file or directory","stun.app"}}
2020-05-01 00:52:39.717 [error] <0.391.0>@ejabberd_listener:init:146 failed to process callback function ejabberd_stun:tcp_init(#Port<0.14>, [{turn_ip,{MY-IP}},{use_turn,true},{auth_realm,<<"MY-DOMAIN-NAMEe">>}]): {'EXIT',{application_start_failed,[{ejabberd,exit_or_halt,2,[{file,"src/ejabberd.erl"},{line,142}]},{ejabberd_stun,tcp_init,2,[{file,"src/ejabberd_stun.erl"},{line,57}]},{ejabberd_listener,init,4,[{file,"src/ejabberd_listener.erl"},{line,144}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}}
Is there anything obviously wrong with my eJabberd STUN/TURN setup? Or any idea how I might verifiy my setup would be gratfully recived?
@homer77 I wonder if you might be able to shed any light on this?