Voice or Video with ejabberd?

NethServer Version: 7.9.2009
Module: ejabberd 1.8.4

Does anyone have instructions on how to get voice and video calls working with the available ejabberd module?

XMPP works fine, but any attempts to use voice or video calling fails. I assume the STUN / TURN module(s) need to be enabled and configured?

Here’s a tutorial:

Thanks - I saw this but wasn’t sure if it would work on Nethserver (are the modules installed with our version of ejabberd?) and I wasn’t sure if anyone had a guide for it already, since changing config files in Nethserver is another layer of complexity.

I got this working, but it hasn’t been turned into a sleek script (yet?). Sharing my steps here so anyone else can copy them and possibly improve on them.

Server side install of ejabberd 20.04

wget https://www.process-one.net/downloads/downloads-action.php?file=/20.04/ejabberd-20.04-0.x86_64.rpm -O ejabberd-20.04-0.x86_64.rpm
rpm -i ejabberd-20.04-0.x86_64.rpm
# copy or move database folder from 20.03 folder to 20.04 folder
# update /usr/lib/systemd/system/ejabberd.service references to 20.03 to 20.04
# update /etc/ejabberd/ejabberd.yml <- details below, this should be done correctly using the official e-smith configuration language
systemctl daemon-reload
systemctl restart ejabberd

Add these listeners to ejabberd.yml:

  -
    port: 3478
    transport: udp
    module: ejabberd_stun
    use_turn: true
    turn_min_port: 49152
    turn_max_port: 65535
    ## The server's public IPv4 address:
    turn_ip: "YOUR IP HERE"
  -
    port: 5349
    transport: tcp
    module: ejabberd_stun
    use_turn: true
    tls: true
    turn_min_port: 49152
    turn_max_port: 65535
    ip: "YOUR IP HERE"
    turn_ip: "YOUR IP HERE"

and the module default configuration under modules:

mod_stun_disco: {}

And last but not least, make sure you add a service with the appropriate firewall ports opened:

At this point, your server will be running ejabberd 20.04 and configured to support voice and video calling.

P.S.: Here’s a script stolen form Holger and hacked together, not confirmed to work yet but should help to automate updating your IP.

#!/bin/sh

set -e
set -u

ejabberd_yml='/etc/ejabberd/ejabberd.yml'
ip_url='https://ifconfig.me/ip'
old_ip=$(sed -n 's/^[[:blank:]]\{1,\}turn_ip:[[:blank:]]*"\?\([[:digit:].]*\)"\?.*$/\1/p' "$ejabberd_yml")
new_ip=$(curl "$ip_url")

if [ $old_ip == $new_ip ]; then
        echo "IP Unchanged: $new_ip"
else
    	echo "IPs Match: Old: $old_ip New: $new_ip"
fi

if [ -z "$old_ip" ]
then
        echo >&2 "FATAL: Found no 'turn_ip' in $ejabberd_yml"
        exit 1
fi

if [ -z "$new_ip" ]
then
        echo >&2 "FATAL: Cannot retrieve my IP address from $ip_url"
        exit 1
fi

if [ "$old_ip" != "$new_ip" ]
then
        sed -i "s/$old_ip/$new_ip/" "$ejabberd_yml"
        systemctl restart ejabberd 
fi

1 Like

After doing this with ejabberd I noticed my backups started failing, with a very unhelpful error message:

Backup: b2_backup
Backup started at 2022-03-19 15:02:57
Event pre-backup-data: FAIL
Backup status: FAIL

Log file: /var/log/backup/backup-b2_backup-202203191502.log

When upgrading ejabberd, I left the old directory in place to avoid causing issues, but it seems that’s what caused it, because in the pre-upgrade event S50nethserver-ejabberd-backup there’s this command:

/opt/ejabberd-*/bin/ejabberdctl backup /var/lib/nethserver/ejabberd/ejabberd.backup

Having the old directory there caused problems, so I renamed the old one and the backups started working again. I haven’t noticed any issues in ejabberd, since it should all be using the latest version.

1 Like

WHile testing and trying to implement Voice calling Functions on ejabbered, this is what i discovered.

Adding this module, breaks ejabbered, with the error.

In /var/log/ejabberd/error.log was following error:

2022-04-03 19:44:18.255 [critical] <0.106.0>@ejabberd_app:start:71 Failed to start ejabberd application: Invalid value of option modules: unknown ejabberd module: mod_stun_disco. Did you mean mod_disco?

there seems to be an error with that module as desribed here

that was fixed in later versions of ejabbered
How to set up ejabberd video & voice calling / ProcessOne (process-one.net)

the error was fixed on ejabbered ejabberd 20.07

our ejabbered version is 20.03, is it possible to update to atleast latest version?

@stephdl was nethserver-ejabber-next released?

Status not released, I think we need to make the documentation iirc the verification has been made

1 Like

so, its documentation that was pending, but all was completed…

me and @mrmarkuz are facing weired errors and challenges and it seems to be version related. some bugs fixed in later versions…