Installing Asterisk server
Before installing Asterisk you need to install the following dependencies:
In order to install libsrtp, follow the instructions below:
You also need to install PJSIP, you can download the source here. Once the source directory is extracted:
- Change to the pjproject source directory:
- Build and install pjproject:
- Update shared library links:
- Verify that pjproject is installed:
- The result should be:
- In order to install Asterisk 13.7.0, you can download the source directly there.
- Extract Asterisk:
- Enter the Asterisk directory:
- Run the Asterisk configure script:
- Run the Asterisk menuselect tool:
- In the menuselect, go to the resources option and ensure that res_srtp is enabled. If there are 3 x’s next to res_srtp, there is a problem with the srtp library and you must reinstall it. Save the configuration (press x). You should also see stars in front of the res_pjsip lines.
- Compile and install Asterisk:
- If you need the sample configs you can run 'make samples' to install the sample configs. If you need to install the Asterisk startup script you can run 'make config'.
- After you need to setup the DTLS certificates.
- Enter the Asterisk scripts directory:
- Create the DTLS certificates (replace pbx.mycompany.com with your ip address or dns name, replace My Super Company with your company name):
Configure Asterisk server
For WebRTC, a lot of the settings that are needed MUST be in the peer settings. The global settings do not flow down into the peer settings very well. By default, Asterisk config files are located in /etc/asterisk/. Start by editing http.conf and make sure that the following lines are uncommented:
Next, edit sip.conf. The WebRTC peer requires encryption, avpf, and icesupport to be enabled. In most cases, directmedia should be disabled. Also under the WebRTC client, the transport needs to be listed as ‘ws’ to allow websocket connections. All of these config lines should be under the peer itself; setting these config lines globally might not work:
In the sip.conf and rtp.conf files you also need to add or uncomment the lines:
Lastly, set up extensions.conf:
Configure Odoo VOIP
In Odoo, the configuration should be done in the user's preferences.
The SIP Login/Browser's Extension is the number you configured previously in the sip.conf file. In our example, 1060. The SIP Password is the secret you chose in the sip.conf file. The extension of your office's phone is not a required field but it is used if you want to transfer your call from Odoo to an external phone also configured in the sip.conf file.
The configuration should also be done in the sale settings under the title "PBX Configuration". You need to put the IP you define in the http.conf file and the WebSocket should be: ws://127.0.0.1:8088/ws. The part "127.0.0.1" needs to be the same as the IP defined previously and the "8088" is the port you defined in the http.conf file.