Setup Websocket for Asterisk PBX (SIP / PJSIP stack)

  1. Upload a valid certificate to the server (not self signed)
  2. 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
  3. 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

  1. 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
  2. Restart asterisk
  3. 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.

Need help? We can do this for you. Order the “Websocket installation service for Asterisk” and we help you out!


This will close in 0 seconds