If you are going to use at least one Astribank-BRI in your system, then you have to follow the installation instructions described in this document. The instructions bellow allow you to compile and install both Astribank-BRI and Astribank-FXS/FXO drivers. Therefore, you don't need to perform actions described in document “Building Astribank-FXS/FXO Drivers from Source” if you are going to use analog Astribank devices along with Astribank-BRI.
In order to compile and install the Astribank-BRI drivers you have to install the BRIstuff package. The BRIstuff is a distribution for installing and/or patching Asterisk, Zaptel and libpri with several extra features written and maintained by Junghanns.NET Gmbh. Actually, the package consists of patches for Asterisk and its component along with some scripts. Please note that you have to use the BRIstuff packages from the Xorcom repository rather than the original packages from http://www.junghanns.net.
For Asterisk 1.2
wget http://updates.xorcom.com/astribank/bristuff/bristuff-current.tgz tar xvzf bristuff-current.tgz
For Asterisk 1.4
wget http://updates.xorcom.com/astribank/bristuff/1.4/bristuff-current.tgz tar xvzf bristuff-current.tgz
a) Make the newly created folder to be the current directory. Please note that the exact folder name depends on the package version and may differ than that is used in the example bellow.
cd bristuff-0.3.0-1y-j-xr2
b) Install the prerequisite packages. The script prereq.sh will do this job for your on Debian and CentOS.
./prereq.sh install
c) Carefully review the packages installation results. Make sure that you don't have a problem with Linux kernel headers installation. If you see that the Linux kernel headers are not installed then check your package management system (e.g., "yum", "apt", etc) configuration. Probably the Linux kernel related packages updates are disabled there.
d) If you are using CentOS 5 then you also have to install package fxload:
wget http://updates.xorcom.com/astribank/fxload/fxload-2002_04_11-5xr.i386.rpm rpm -i fxload-2002_04_11-5xr.i386.rpm
./install.sh
If you want just to repeat the build process, you should run ./compile.sh instead.
Note! The following command will write over your current Asterisk configuration! You should run it only if you have not installed Asterisk and Zaptel on your computer yet.
./config.sh
Connect your Astribank device(s) to the computer. After that we suggest using utility genzaptelconf that automatically detects the installed hardware and creates file /etc/asterisk/zapata-channels.conf and /etc/zaptel.conf where you can find the detected zaptel channels that you can use for extensions configuration:
genzaptelconf -svdM
If you want you can include the automatically generated zapata-channels.conf to your zapata.conf and after that just to configure extensions.conf accordingly.
echo '#include zapata-channels.conf' >>/etc/asterisk/zapata.conf
There is an example of /etc/asterisk/extensions.conf. In this example, user must dial 9 and the call destination number in order to make an outgoing call via BRI TE port. Calls incoming from the BRI TE port will be routed to Zap/1 channel.
[phones-zap]
; 6001 will dial to channel 1, 6020, to zaptel channel 20, etc.
exten => _6XXX,1,Dial(ZAP/${EXTEN:1})
; Useful for trunks debugging. Will potentially allow users to
; bypass context limitations.
;exten => _6XXX.,1,Dial(ZAP/${EXTEN:1:3}/${EXTEN:4})
[trunk]
; A number that begins with 9: dial it through a trunk
; (we put FXO channels and BRI TE channels in group 0).
; The leading 9 is stripped.
exten => _9.,1,Dial(Zap/g0/${EXTEN:1})
; dialing a number that begins with 81 will dial it through
; span 1, etc. The two leading digits are stripped.
; (Each digital span is also added to group 10+span number ).
exten => _8X.,1,Dial(Zap/g1${EXTEN:1:1}/${EXTEN:2})
[from-internal]
;The context of FXS ports: analog phones.
; They are allowed to dial to all other phones
include => phones-zap
; They are also allowed to call through the trunk:
include => trunk
; some simple tests:
include => astbank-test
[from-pstn]
; Calls from the PSTN enter here. Redirect calls to an IVR
; or a default extension in the s context here. In this case we
; redirect calls to Zaptel channel 1:
exten => s,1,Dial(Zap/1)
; Alternatively, the following will redirect you to the demo IVR
; from the sample extensions.conf of Asterisk:
include => demo
; An extra context with some simple tests
[astbank-test]
; 200: echo test
exten => 200,1,Answer
exten => 200,n,Wait(1)
exten => 200,n,Echo()
exten => 200,n,Hangup
; 203: say extension number. Will only work if caller ID
; is properly set in zapata.conf / zapata-channels.conf
exten => 203,1,Answer
exten => 203,n,Wait(1)
exten => 203,n,SayNumber(${CALLERID(num)})
exten => 203,n,Hangup
;Context for FXS auxiliary input ports.
[astbank-input]
exten => s,1,Set(ZAP_CHAN=${CUT(CHANNEL,-,1)})
exten => s,n,Set(ZAP_CHAN=${CUT(ZAP_CHAN,/,2)})
; 11 is the number of the first input port. At least in the sample
; configuration below.
;exten => s,n,Set(INPUT_NUM=$[${ZAP_CHAN}-11)])
; The sample below just logs the signal.
exten => s,n,NoOp(Got signal from Zaptel Channel ${ZAP_CHAN})
; Alternatively:
;exten => s,n,System(run something)
; No. We did not forget the context astbank-outputs. The FXS auxiliary output
; ports may only accept calls from the PBX. Therefore, they don't need a context
; of their own. But assigning them to a dedicated context makes
; 'zap show channels' in the CLI provide more useful outputs, though.
Run the following command to reload the configuration files:
asterisk -rx reload
Now you can check your installation:
· List you zaptel hardware with the command:
zaptel_hardware
· Review the currently configured zaptel channels by using command:
lszaptel
· Dial 9<NUMBER> to make outbound call through the first available BRI TE port.
· Make an inbound call via the BRI port.