How to setup STUN+TURN server for VoiceCall and VideoCall feature of LIveAgent:

Centos 7:

[root@turn ~]# yum -y install make gcc gcc-c++ openssl-devel libevent libevent-devel wget
[root@turn ~]# mkdir /root/turn
[root@turn ~]# cd /root/turn
[root@turn turn]# wget https://github.com/coturn/coturn/archive/4.5.0.3.tar.gz
[root@turn turn]# tar -xvzf 4.5.0.3.tar.gz
[root@turn turn]# cd coturn-4.5.0.3 && ./configure
[root@turn turn]# cd coturn-4.5.0.3/
[root@turn coturn-4.5.0.3]# ./configure
[root@turn coturn-4.5.0.3]# make
[root@turn coturn-4.5.0.3]# make install


Upload turnserver config to /etc/turnserver.conf
- see attached turnserver.conf and replace following variables with your values:
  {{ publicIp }} - your sever publicIp
  {{ secret }} - generate some password that you will use later in LiveAgent Voice Call and Video Call configuration
  {{ maxBps }} - maximum bitrate that you allow for connections going through turn server (recommended: 128000)Upload SSL key for turnserver to /etc/turnserver.key
Upload SSL certificate for turnserver to /etc/turnserver.crt

Create turnserver service file /etc/systemd/system/turnserver.service

[Unit]
Description=turnserver Service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/turnserver -c /etc/turnserver.conf
Restart=on-abort


[Install]
WantedBy=multi-user.target

Start the turnserver service:

[root@turn ~]# systemctl start turnserver

Allow the ports:
 

[root@turn ~]# iptables -A INPUT -p tcp -m tcp --dport 3478 -j ACCEPT
[root@turn ~]# iptables -A INPUT -p udp -m udp --dport 3478 -j ACCEPT

[root@turn ~]# iptables -A INPUT -p tcp -m tcp --dport 5349 -j ACCEPT
[root@turn ~]# iptables -A INPUT -p udp -m udp --dport 5349 -j ACCEPT

 

Once you are done configuring the servers you need to configure them in your config.yml file like this:

webrtc:
  voice:
    stun-url: stun:example.com
    turn-url: turn:example.com
    password: pass
    ice-transport: all
  video:
    stun-url: stun:example.com
    turn-url: turn:example.com
    password: pass
    ice-transport: all
×