Using Berofix With Asterisk

by beroNet in Circuits > Computers

2670 Views, 3 Favorites, 0 Comments

Using Berofix With Asterisk

logo_sq2.JPG
This instruction assumes that you can reach the berofix card in your network.
The example uses a berofix card with one bf4S0 Lineinterface. 

Establish SIP Connection

logo_sq2.JPG
The first thing you have to do when you try to bring your berofix card up and running with the Asterisk, is to establish the SIP connection between them.
To do so simply add the following lines to the "/etc/asterisk/sip.conf" to create a new SIP friend/peer:

[berofix]
type=friend
secret=berofix
host=10.0.0.2
allow=all
canreinvite=no
context=from-sip



In the "/etc/asterisk/extensions.conf" you need to add a context "from-sip" like:

[from-sip]
exten => _X.,1,Playback(tt-monkeys)



So every call from berofix will be routed to Playback(tt-monkeys).
If you want to send calls to berofix you can simply use the following dial statement:

exten => _0X.,1,Dial(SIP/99${EXTEN:1}@berofix)
exten => _0X.,n,hangup



To make this work you need to reload the configs on the asterisk cli:

asterisk -rx "reload"

Setup BeroFix

logo_sq2.JPG
Now you need to setup these parameters also at the berofix site, and you should be able to make basic calls.

In the first step you should put your ISDN ports into groups.
By selecting the menupoint ISDN you can simply add a ISDN Port Group called “BRI” where you put all your 4 BRI ports in it.

After that you need to have a SIP entry to communicate with the Asterisk.
To do so click on the menupoint SIP+ → SIP and add a new SIP entry with the name “asterisk”, the Serveraddress “10.0.0.2”, User “berofix”, Secret “berofix”, the Type “Proxy” and default “enabled”. 

Dialplan: Rule 1

logo_sq2.JPG
After step 1 and 2 you need to go to the dialplan and add the following rules:

Rule 1
Direction: SIP-> ISDN
From ID: p:asterisk
To ID: g:BRI
Destination: 99(.*)
New Destination: \1
Source: (.*)
New Source: \1


The settings above means that every SIP Call starting with 99 is directly routed to the "BRI" group, the prefix “99” will be removed and the callerid is transported transparently. 

Dialplan: Rule 2

logo_sq2.JPG
Rule 2
Direction: ISDN-> SIP
From ID: g:BRI
To ID: p:asterisk
Destination: (.*)
New Destination: \1
Source: (.*)
New Source: \1

This setup means that every ISDN Call coming from the ISDN Ports of the "BRI" group are routed to Asterisk.

Activate!

logo_sq2.JPG
As last step you need to activate the configuration.
Do this by clicking on the "activate" icon.