Setup Websocket for Asterisk PBX (SIP / PJSIP stack)
- Upload a valid certificate to the server (not self signed)
- Setup /etc/asterisk/http.conf with the following:
[general]
enabled=no ; disable HTTP
tlsenable=yes
tlsbindaddr=0.0.0.0:8089
tlscertfile=/etc/ssl/certs/my.cert.pem - When using SIP stack
Setup /etc/asterisk/sip.conf with the following:
websocket_enabled=yes
When using PJSIP stack
Setup /etc/asterisk/sip.conf with the following:
websocket_enabled=no
- Add to /etc/asterisk/rtp.conf
stunaddr=stun.l.google.com:19302
icesupport=true
If behind NAT also add the private IP and public IP.
[ice_host_candidates]
192.168.1.100=> 12.12.12.12 - Restart asterisk
- Check websocket service in asterisk with the command:
asterisk -rx ‘http show status’
If you see the following, you are good and able to place and receive calls using a websocket connection.
Please take in mind to also adjust the firewall so that inbound traffic over ports 8089 is allowed and forwarded to you asterisk machine.
7. When users in Asterisk, make sure SRTP is on and the user is allowed to use WebRTC.