STUN is good when nothing helps to solve audio issue (for WEBrtc its the only method to work, browser can’t know local interface address). You tried all available optinos of NAT - and still no audio.
buy STUN only helps to solve RTP back IP address , sometime is not anough!
ICE ( is a combination using stun+trun services and IP gathering functions ) helps to proxy RTP via a tunnel (relay host ) , running on asterisk server.
important to have ICE running on asterisk for local calls, the google STUN helps only for external calls from asterisk to voip provider
And its not hard to setup it, I can say it even easy if you have done it once.
wget http://turnserver.open-sys.org/downloads/v4.5.1.1/turnserver-4.5.1.1.tar.gz && tar -xvzf turnserver-4.5.1.1.tar.gz && cd turnserver-4.5.1.1 && ./configure --prefix=/usr && make && make install
Config: /etc/turnserver.conf
listening-ip=[IPADDRESS]
relay-ip=[IPADDRESS]
listening-port=19302
;; Uncoment if you want to use turns or stuns ( encrypted ), and have domain with valid ssl
;;tls-listening-port=19303
;;cert=/etc/asterisk/keys/TLS.pem
;;pkey=/etc/asterisk/keys/privkey.pem
fingerprint
realm=[IPADDRESS]
server-name=[IPADDRESS]
lt-cred-mech
user=user1:pass123
user=user2:pass123
log-file=/var/log/coturn.log
no-stdout-log
start it using initd script:
#! /bin/sh
# /etc/init.d/$PROG
#
# chkconfig: 2345 90 60
# description: Stun/ Turnserver for telephony
# processname: turnserver
PROG=turnserver
# Some things that run always
touch /var/lock/
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting $PROG "
cat /etc/turnserver.conf 2>/dev/null |grep '^listen'
/usr/bin/turnserver -c /etc/turnserver.conf >/var/log/turnserver.log 2>&1 &
;;
stop)
echo "Stopping script $PROG"
killall -9 turnserver || echo "Failed to stop ${PROG} "
;;
*)
echo "Usage: /etc/init.d/$PROG {start|stop}"
exit 1
;;
esac
to run it when system starts:
chkconfig turnserverd on
service turnserverd start
on the client device (IPphone or softphone) just enbale using stun/turn and put user name with password - it will enable TURN rtp tunneling
If your asterisk under the NAT, and you want to make external calls to voip provider, you can setup ICE on some public hosted server, or, use google STUN :
In your rtp.conf file, /usr/asterisk/etc/asterisk/rtp.conf , you still
stunaddr=stun.l.google.com:19302
icesupport=true