To make asterisk work with WebRTC client, ensure following modules are installed (will be easier if you compile from source code).

  • res_crypto
  • res_http_websocket
  • res_pjsip_transport_websocket
  • codec_opus (optional but highly recommended for high quality audio)

Certificates:

Asterisk have utility script ast_tls_cert in contrib/scripts source directory.

sudo mkdir /etc/asterisk/keys

sudo contrib/scripts/ast_tls_cert -C pbx.iolib.link -O "iolib" -b 2048 -d /etc/asterisk/keys

Check the certificates

ubuntu@bw:/usr/src/asterisk-18$ sudo ls /etc/asterisk/keys
asterisk.crt asterisk.csr asterisk.key asterisk.pem ca.cfg ca.crt ca.key tmp.cfg

To communicate with Web Socket client, asterisk has build in HTTP Server which stored in /etc/asterisk/http.conf

[general] enabled=yes bindaddr=0.0.0.0 bindport=8088 tlsenable=yes tlsbindaddr=0.0.0.0:8089 tlscertfile=/etc/asterisk/keys/asterisk.crt tlsprivatekey=/etc/asterisk/keys/asterisk.key

Restart the asterisk

 

Leave a Reply

Your email address will not be published. Required fields are marked *