To make asterisk work with WebRTC client, ensure following modules are installed (will be easier if you compile from source code).
res_cryptores_http_websocketres_pjsip_transport_websocketcodec_opus(optional but highly recommended for high quality audio)
Certificates:
- using Letsencrypt
- Self signed certificate
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=yesbindaddr=0.0.0.0bindport=8088tlsenable=yestlsbindaddr=0.0.0.0:8089tlscertfile=/etc/asterisk/keys/asterisk.crttlsprivatekey=/etc/asterisk/keys/asterisk.key
Restart the asterisk