Asterisk
What is Asterisk?
Asterisk is an open source framework for building communications applications. Asterisk turns an ordinary
computer into a communications server. Asterisk powers IP PBX systems, VoIP gateways, conference
servers and other custom solutions. It is used by small businesses, large businesses, call centers,
carriers and government agencies, worldwide. Asterisk is free and open source.
What do we have?
We have Asterisk v.16 on Acadsoc IM
Configurations :
For IM and asterisk connection
Modify or create an Asterisk HTTPS TLS server.
Create a PJSIP WebSocket transport.
Create PJSIP Endpoint, Asterisk Installation
You should have a working chan_pjsip based Asterisk installation to start with and for purposes of this
tutorial, it must be version 15.5 or higher. Either install Asterisk from your distribution's packages or,
preferably, install Asterisk from source. Either way, there are a few modules over and above the standard
ones that must be present for WebSockets and WebRTC to work:
res_crypto
res_http_websocket
res_pjsip_transport_websocket
codec_opus (optional but highly recommended for high quality audio)
AOR and Authentication objects that represent a WebRTC client
Certificates
Technically, a client can use WebRTC over an insecure WebSocket to connect to Asterisk. In practice
though, most browsers will require a TLS based WebSocket to be used. You can use self-signed
certificates to set up the Asterisk TLS server but getting browsers to accept them is tricky so if you're
able, it is highly recommend getting trusted certificates from an organization.
Configure Asterisk's built-in HTTP server
Configure PJSIP for WSS Transport
CONFIGURE ASTERISK SO IT WILL WORK WITH
VICIPHONE
Requirements:
Asterisk 13 or later (browsers stopped supporting Asterisk 11)
A Fully Qualified Domain Name for the server
A VALID SSL certificate from a VALID Certificate Authority like GoDaddy or LetsEncrypt for the
Fully Qualified Domain Name for the server. SELF SIGNED SSL CERTIFICATES DO NOT WORK!!!
Steps:
1. Edit /etc/asterisk/http.conf
2. Uncomment ‘enabled=yes’
3. Uncomment and change ‘bindaddr=0.0.0.0’
4. Uncomment ‘bindport=8088’
5. Uncomment ‘tlsenable=yes’
6. Uncomment ‘tlsbindaddr=0.0.0.0:8089’
7. Uncomment and change ‘tlscertfile’ to read: tlscertfile=/PATH/TO/YOUR/SSL/CERT/FILE
8. Uncomment and change ‘tlsprivatekey’ to read: tlsprivatekey=/PATH/TO/YOUR/SSL/KEY/FILE
9. Save /etc/asterisk/http.conf
10. Make sure that TCP port 8089 is open in the servers firewall.
11. Edit /etc/asterisk/modules.conf
12. Make sure that the res_http_websocket.so module is being loaded.
13. Reboot the server.
14. On the Linux CLI run this command: asterisk -rx ‘http show status’
15. Check the output from the above command to make sure it says “HTTPS Server Enabled and
Bound to 0.0.0.0:8089”