As of version 1.2.4, the Astribank driver (xpp) is now part of Zaptel packages. However, Xorcom also maintains a development snapshot of the driver. The development snapshots are required for the newest modules and often contain fixes not available on the official code released by Digium Inc. (We update Digium as soon and as often as possible.)
You can download Zaptel from:
· http://ftp.digium.com/pub/zaptel/ - the Digium's official distribution
· http://updates.xorcom.com/astribank- may have some last-minute updates from Xorcom.
If you use the Astribank-BRI then you have to build the drivers according instructions described in topic “Building Astribank-BRI Driver from Source”.
In order to build the zaptel packages you have to have the following packages installed on your system:
· the kernel source package
· newt to build zttool
· libusb to build the Astribank firmware loader
If you run a kernel package from your distribution, the distribution will typically provide you a package with a partial compiled kernel tree. Please follow the instructions below that are depended on your Linux distribution in order to install the prerequisite packages.
To see what packages you need to install, run:
./build_tools/install_prereq test
To install them, run:
./build_tools/install_prereq install
This should work at least on Debian and on CentOS 4/5. Alternatively, use the following instructions to install the prerequisites:
Debian 4.0 (Etch)
apt-get install linux-headers-`uname -r` build-essential libnewt-dev libusb-dev
Debian 3.1 (Sarge)
apt-get install kernel-headers-`uname -r` build-essential libnewt-dev libusb-dev
RHEL4 / CentOS 4 / CentOS 5
1. Install the following non-kernel-related packages:
yum install -y gcc newt-devel libusb-devel
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
2. If the following command produces no error, skip the p.3 and go directly to topic "Step2. Build Zaptel".
ls /lib/modules/`uname -r`/build/.config
3. Check your kernel version.
uname -r | grep smp
If the above command produces any output, it means that you have a "Symmetric Multi-Processing" (SMP) kernel and you must run the command described in 3.1. Otherwise, you have to run the command described in 3.2 instead.
3.1 Install the SMP kernel development package:
yum install kernel-smp-devel-`uname -r`
3.2 Install the non-SMP kernel development package:
yum install kernel-devel-`uname -r`
If you have too old kernel version installed on your system, then it is possible that the corresponding kernel development package doesn't exist in the CentOS4 repository and then you will need to upgrade your kernel to a newer version.
In case of SMP kernel run:
yum install kernel-smp kernel-smp-devel
In case of regular kernel run:
yum install kernel kernel-devel
Reboot your computer once you have a new kernel installed.
4. By this point you have all prerequisites installed on your system and you can start the Zaptel building process.
For Zaptel 1.2
make make install # specific to the Astribank: make -C xpp/utils install make config
For zaptel 1.4 or later
./configure make make install make config
The Asterisk building process is not covered here. Ref. the README file in the Asterisk sources directory tree.
We suggest to use 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 FXO port. Calls incoming from a FXO 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 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
· Pick up a telephone connected to an FXS port and make sure that you hear the dial tone signal.
· Dial 200 to hear your extension number
· Dial that number from a telephone connected to another FXS port.
· Dial 203 for an echo test.
· Dial 9<NUMBER> to make outbound call through the first available FXO port.