Toggle navigation

Installatie en opzet

Asterisk server installeren


Voordat u Asterisk installeert moet u de volgende afhankelijkheden installeren:

  • wget
  • gcc
  • g++
  • ncurses-devel
  • libxml2-devel
  • sqlite-devel
  • libsrtp-devel
  • libuuid-devel
  • openssl-devel
  • pkg-config

Om libsrtp te installeren volgt u onderstaande instructies:

cd /usr/local/src/
tar zxvf srtp-1.4.2.tgz
cd /usr/local/src/srtp
./configure CFLAGS=-fPIC --prefix=/usr/local/lib
make && make install

You also need to install PJSIP, you can download the source here. Once the source directory is extracted:

  • Wijzig naar de pjproject map:

# cd pjproject
  • run:
# ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG'
  • Bouw en installeer pjproject:

# make dep
# make
# make install
  • Update gedeelde library links:

# ldconfig
  • Verifieer dat pjproject geïnstalleerd is:

# ldconfig -p | grep pj
  • Het resultaat zou moeten zijn: (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/ (libc6,x86-64) => /usr/lib/


tar zxvf asterisk*
  • Geef de Asterisk map in:

cd ./asterisk*
  • Voer het Asterisk configuratie script uit:

./configure --with-pjproject --with-ssl --with-srtp
  • Run the Asterisk menuselect tool:
make menuselect
  • 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.
  • Compileer en installeer Asterisk:

make && make install
  • 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'.

DTLS certificaten

  • Hierna moet u de DTLS certificaten opzetten.

mkdir /etc/asterisk/keys
  • Geef de Asterisk scripts map in:

cd /asterisk*/contrib/scripts
  • Create the DTLS certificates (replace with your ip address or dns name, replace My Super Company with your company name):
./ast_tls_cert -C -O "My Super Company" -d /etc/asterisk/keys

Configureer 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:

bindaddr= ; Replace this with your IP address
bindport=8088 ; Replace this with the port you want to listen on

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:

realm= ; Replace this with your IP address
udpbindaddr= ; Replace this with your IP address

[1060] ; This will be WebRTC client
username=1060 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=password ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS

In de sip.conf en rtp.conf bestanden moet u ook de volgende lijnen toevoegen of uit commentaar halen:

icesupport = true
stunaddr =

Stel als laatste extensions.conf in:

exten => 1060,1,Dial(SIP/1060) ; Dialing 1060 will call the SIP client registered to 1060

Configureer Odoo VOIP

De configuratie moet in Odoo gedaan worden onder de gebruikersvoorkeuren.

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:// The part "" needs to be the same as the IP defined previously and the "8088" is the port you defined in the http.conf file.