Asterisk@home with HFC isdn card
April 10th, 2006
Our first Asterisk experience was good and few days ago i decided to update our installation on AMD machine with single HFC ISDN card. Surfing the web i found a new interesting project on sourceforge called Asterix@Home: a CentOs distribution with asterisk, zap, amp and everything else you need to set up a dedicaded, professional and free PBX. This is our installation experience, some goals are changed to the previous version. Hardware is unchanged.
Keep in mind: this is my own experience you follow these howto at your own risk!
Our goals:
- Connect 5 Phones together with their own extension
- Route incoming calls to selected extension.
- Manage our 2-lines ISDN
- Avoid expensive hardware or software
- Integrate personal voicemail
Hardware setup
- A rackmount Machine with AMD Athlon Xp 1800, 512 Mb Ram, Asus A7V880 Motherboard with integrated lan, a 15 Gb ST HDD, a vintage video card, 52x Lg Cd-Rom, and floppy drive. (A sort of recycled machine)
- This Digicom ISDN HFC Card
- 5 GrandStream Budgetone 100
Software Setup
- Asterisk@home 2.7 (CentOS 4.3 with 2.6.9 Kernel)
- Working internet connection
# # # # # # I. OS INSTALLATION # # # # # #
Download A@H from a mirror, burn disks, insert it into your machine and set your bios to boot from CDROM. Press enter for boot and go grab a snack, The installer will install linux distribution, reboot and compile asterisk.
Pay Attention, this installation will erase all data on your hard drive.!
After several minuts your sistem will’be ready to login. enter as root using “password” as password.
Type setup on command line and set keyboard, timezone and network in order to fit your system. Enter in system services and unselect zaptel (this will prevent zaptel start at boot).
Exit back to command line and restart network interface with
service network restart
For obvious security reasons change root password with your favorite
passwd
Now launch a system update
yum updatereb
This will update your system’s packages including kernel (in this case to kenel 2.6.9-34.EL)
Reboot your sistem with
reboot
First Step is over
# # # # # # II. Recompile Softwares # # # # # #
Unfortunately A@H package don’t have isdn hfc card built-in support so we need zaphfc driver from bristuff package and Florz patch.
Stop asterisk, and fop server with:
amportal stop
Go to sources directory and download bristuff
cd /usr/src
wget http://www.junghanns.net/downloads/bristuff-0.3.0-PRE-1l.tar.gz
tar -zxvf bristuff-0.3.0-PRE-1l.tar.gz
Enter uncompressed directory and launch download script, it will download asterisk zaptel etc. from Junghanns website
cd bristuff-0.3.0-PRE-1l
./download.sh
Make sure your /usr/src directory contains symbolic links to current kernel source.
verify your current kernel:
[root@asterisk1 ~]# uname -r
2.6.9-34.EL
Verify symbolic links destination:
[root@asterisk1 ~]# ls /usr/src/ -la
lrwxrwxrwx 1 root root 33 Apr 10 2006 linux -> /usr/src/kernels/2.6.9-22.EL-i686
lrwxrwxrwx 1 root root 33 Apr 10 2006 linux-2.6 -> /usr/src/kernels/2.6.9-22.EL-i686
Replace link with your current kernel source (in this case 2.6.9-34.EL)
rm /usr/src/linux /usr/src/linux-2.6
ln -s /usr/src/kernels/2.6.9-34.EL-i686/ /usr/src/linux
ln -s /usr/src/kernels/2.6.9-34.EL-i686/ /usr/src/linux-2.6
Now, to avoid zaptel compilation erros we need to change a line in kernel sources (spinlock.h), as explained in this bug entry on digium website.
vi /usr/src/kernels/2.6.9-34.EL-i686/include/linux/spinlock.h
At line 407 you'll find something like this:
#define DEFINE_RWLOCK(x) rw_lock_t x = RW_LOCK_UNLOCKED
Change it as follow
#define DEFINE_RWLOCK(x) rwlock_t x = RW_LOCK_UNLOCKED
(you have only to delete underscore "_" on rwlock.)
Save and exit
Now we're going to compile zaptel:
cd /usr/src/bristuff-0.3.0-PRE-1f/zaptel-1.2.3
make clean
make
make install
cd ..
Now we're going to compile libpri
cd /usr/src/bristuff-0.3.0-PRE-1l/libpri-1.2.2
make clean
make
make install
cd ..
Now compile zaphfc
cd /usr/src/bristuff-0.3.0-PRE-1l/zaphfc/
make clean
make
cp zaptel.conf /etc/zaptel.conf
Answer yes to overvrite existent zaptel.conf file
Now we need to configure system in order to set up zaphfc module on boot. This step is a workaround, if you know a better way to do this, let me know.
Open /etc/rc.d/rc.local in your favorite text editor
vi /etc/rc.d/rc.local
Add these lines after comments:
modprobe zaptel
insmod /usr/src/bristuff-0.3.0-PRE-1l/zaphfc/zaphfc.ko
sleep 10
ztcfg -vv
Now you need to configure zapata.conf to fit your requirements (vi /etc/asterisk/zapata.conf). Check Voip.info.org for information and samples. This is our zapata configuration for italian ISDN:
;
; SOOLID ZAPATA CONFIGURATION
;
[channels]
language=it
switchtype=euroisdn
pridialplan=local
prilocaldialplan=local
signalling = bri_cpe_ptmp
rxwink=300
usecallerid=yes
callwaiting=yes
hidecallerid=no
usecallingpres=yes
threewaycalling=yes
callwaitingcallerid=yes
transfer=yes
cancallforward=yes
echocancel=yes
callreturn=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
nationalprefix = 0
internationalprefix = 00
faxdetect=incoming
group=0
callgroup=1
pickupgroup=1
immediate=yes
context=from-pstn
channel => 1-2
Finally we have to recompile asterisk.
cd /usr/src/bristuff-0.3.0-PRE-1l/asterisk-1.2.4
make clean
make
make install
Done, now reboot your box, we're going to set up our PBX.
# # # # # # III. Asterisk Configuration # # # # # #
At this point you should have a rebooted linux machine with asterisk running both connected to lan and isdn, one or more ip Phones connected to your local network and a computer with an opened web browser.
Insert news password when prompted.Now open your web browser and point to your machine (in my case http://192.168.0.8 ) and click on the last link "Asterisk Management Portal (AMP)" Insert maint a username and password as password.
[Writing In Progress, sorry]
Login again on your asterisk machine and change all default password with your favorite by running these command:
passwd-amp
passwd-maint
passwd-meetme
# # # # # # IV. About this guide # # # # # #
To do's
- Add Digital Receptionist configuration
Reference
Some guides/howto/forum post that help me to write this guide
- Asterisk Homepage
- Asterisk@Home Homepage
- Bristuff Homepage
- Florz Homepage
- Some posts on NGI forum
- Digium Bugtraq
- Some usefull howto
Credits / Copyright
Written by Alberto Alberti
Released on 09/04/06 / - Last Update on 10/04/06
Original, updated, version can be found on blog.soolid.it
Licensed under Creative Commons License.
Leave a Reply