Last edited: 29 March 2007
Make sure you have the latest version of install-ZAPHFC
The version of install-ZAPHFC that ships with TB is old and does not have TB specific code. When you run it for the first time download the new version then exit the script. Then re-run the updated script. If you want to download the script manually, you can get it from here.
You may find these provide some background information.... one, two, three and four
If you have other zap hardware get this running before running install-ZAPHFC. This may require that you leave the HFC hardware out of your system for the initial build (only seen on multi-port cards).
I've added code to install-ZAPHFC (from version 1.1.1.0) which should allow you to run the script on TB without needing any preparation.
Before you run install-ZAPHFC You would still benefit from:
- - Stopping asterisk (amportal stop)
- - stopping zaptel (service zaptel stop)
- - editing /etc/sysconfig/zaptel and comment out all the lines except for those cards you have.
If you have no other zaptel hardware then uncomment the dummy entry.
Then run install-ZAPHFC
If things don't start correctly:
- - Review the log file that is created during the build. You will find this saved as /etc/asterisk/install-zaphfc.log
- - Check that the contents of /etc/asterisk/zapata-BRI-HFC.conf are correct for your telco/country.
- - Check your cards are online before running around after a software/config issue.
Run the following from a command prompt:
for PROC in `ls -1 /proc/zaptel/`;do cat /proc/zaptel/$PROC|head -n 1;done
You should see all of the ISDN ports you have connected showing "ACTIVATED".
If they don't check:
- - Your ISDN service is live
- - You have connected the right ports from your card to your NTE.
- - You have the right cables. Usually straight through on pins 3,4,5,6 for TE mode (a regular cat 5 cable will do) and cross-over cable for NT mode (a cross-over cat 5 cable WILL NOT do) .
Other Notes:
If you are using more than one single port HFC card, it appears safest to build with the Florz's patch especially if you see "empty HDLC frame or bad CRC received " in your logs.
This will mean you will be rolled back to a much earlier version of Asterisk. The safest being to use the tested Florz's build. Note: Florz' has not updated his patch for bristuff-0.3.0 in nearly a year. Please think very carefully before using it. Do not expect it to work well (if at all) with newer versions of zaptel (post 1.2.5).
I've not had any issues that I have not been able to resolve with Tribox and this script. And those issues I have found, or have been reported to me, I've included into the script. If you can't get things stable with Trixbox, then maybe consider using a version of AAH. If you are having a really hard time getting your cards to work then start with AAH 2.8 and build forward.
Add channels to FOP:
While you can use the ISDN ZAP channels in FreePBX without issue, FreePBX does not yet write these channels into the FOP configuration files. To do so edit /var/www/html/panel/op_buttons_custom.cfg and add the following section to it:
[Zap/x]
Position=z
Label="Zap x"
Extension=-1
Icon=3
Panel_Context=default
[Zap/y]
Position=z+1
Label="Zap y"
Extension=-1
Icon=3
Panel_Context=default
Where x & y are the channel numbers for your ISDN card and z is the position number (refer to /var/www/html/panel/op_buttons_additional.cfg). Restart Asterisk (amportal restart) to make the changes effective.
An example log file:
STARTED: Running ./install-ZAPHFC version 1.2.0.2 (5 December 2006) from /etc/asterisk/ on Tue Dec 5 22:50:41 GMT 2006Command line:
HFC-PCI Card: 1 HFC-PCI (1397:2bd0) cards found
Asterisk: Found 1.2.13 installed.
Asterisk: Building Asterisk 1.2.13
BRIstuff: Patching with bristuff-0.3.0-PRE-1w
Shutdown: Asterisk shutdown.Kernel version: 2.6.9-34.0.2.EL
Kernel directory: 2.6.9-34.0.2.EL-i686
Modules directory: /lib/modules/2.6.9-34.0.2.EL/extra
Link linux: lrwxrwxrwx 1 root 37 Dec 5 22:50 /usr/src/linux -> /usr/src/kernels/2.6.9-34.0.2.EL-i686
Link linux-2.6: lrwxrwxrwx 1 root 37 Dec 5 22:50 /usr/src/linux-2.6 -> /usr/src/kernels/2.6.9-34.0.2.EL-i686
Bristuff tar: Found. Not downloading
Bristuff dir: Previous install found. Removing.
Junghanns script: Running 22:50:53
Junghanns script: Finished 22:51:17
Zaptel build: -rw-r--r-- 1 root root 473987 Dec 5 22:51 zaptel.ko
Libpri build: lrwxrwxrwx 1 root root 13 Dec 5 22:52 libpri.so -> libpri.so.1.0
Zaphfc build: -rw-r--r-- 1 root root 133664 Dec 5 22:52 zaphfc.ko
Asterisk build: -rwxr-xr-x 1 root root 5698613 Dec 5 22:53 asterisk
modprobe.conf: Removing old zaphfc entry
modprobe.conf: Adding zaphfc entry
modprobe.conf: install zaphfc /sbin/modprobe --ignore-install zaphfc modes=0 && /sbin/ztcfg
sysconfig/zaptel: MODULES="$MODULES zaphfc" # HFC ISDN module
sysconfig/zaptel: #MODULES="$MODULES ztdummy" # UHCI USB Zaptel Timing Only Interfaceproc: ZTHFC found in /proc/zaptel/3
Span 3: ZTHFC1 "HFC-S PCI A ISDN card 0 [TE] layer 1 ACTIVATED (F7)" AMI/CCS
zaptel.conf: Card 1 appears to be in /etc/zaptel.conf already.
zapata: zapata-BRI-HFC.conf include statement appears in /etc/asterisk/zapata.conf config.FINISHED: Running ./zaphfc in /root/scripts on Tue Dec 5 22:55:33 GMT 2006
Command line help:
[root@pbx asterisk]# install-ZAPHFC -hinstall-ZAPHFC:
- Install BRIstuff support.
- Builds zaphfc and configures one, or more, single port HFC cards.
- Builds qozap and configures a 4 port or an 8 port HFC card.
usage:
- zaphfc [-a
|-l ] [-B |-C ] [-R ] [-m 1|0[1|0[1|0[1|0]]] ] [-f t|u [-t 1|2|3|4] [-s 1|0[1|0[1|0[1|0]]]] ] - zaphfc -h
- zaphfc -V
Options:
- -a
: The version of Asterisk you want to patch with BRIstuff (e.g. 1.2.1)
The default is to use the version number from the currently installed Asterisk.- -B Build only. Will disable the configuration module*.
- -C Configure only. Will disable the build module*.
* if you specify both B & C options the last occurrence on the command line takes presidence
- -f Apply Florz's patch (http://zaphfc.florz.dyndns.org/). (Default no)
t (tested) the last tested patch will be applied (this may use an earlier * to do so).
u (un-tested) patch the latest version of BRIstuff (CAUTION).- -h This help screen
- -l List the versions of Asterisk that you can build BRIstuff for.
- -m Set the NT/TE mode for each card.
Use 1 for NT mode and 0 for TE mode.Specify one or more cards with card 1 as the rightmost digit. Examples:
-m 1 Card 1 in NT mode.
-m 10 Card 2 NT mode card 1 TE mode.
-m 11 Cards 2 & 1 in NT mode.
-m 1100 Cards 4 & 3 in NT mode cards 2 & 1 in TE mode.- -R Re-write zapata-BRI-HFC.conf.
- -s Set the Slave/Master mode for each card.
Use 1 for Slave mode and 0 for Master mode. Only when built with Florz's patch.Specify one or more cards with card 1 as the rightmost digit. Examples:
-s 1 Card 1 in Slave mode. (Assumes you have more than one card).
-s 10 Card 2 in Slave mode card 1 in Master mode.
-s 110 Cards 3 & 2 in Slave mode card 1 in Master mode.
-s 1110 Cards 4, 3 & 2 in Slave mode card 1 in Master mode.- -t Specify which card will be the timer_card. (Default 1). Only when built with Florz's patch.
- -V Print script version number and exit.
Member Since:
2006-05-31