HylaFax Server Install and setup for connection to Asterisk PBX
Use vi editor or if you prefer it install nano…
1. Install CentOS 5. I normally have to use a cd so I install nothing but the base install. This takes one cd if you are installing CentOS 5. I usually run a yum update, disable selinux, and a number of other things after installation.
2. Yum install some of the required dependencies.
yum install gcc ghostscript sharutils glibc-headers glibc-devel kernel-headers autoconf zlib-devel gcc-c++ libjpeg-devel mgetty-voice libtiff-devel
3 Download the rest of the dependencies.
Download spandsp to /usr/src
cd /usr/src
wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.5.tgz
Download Iaxmodem
wget http://downloads.sourceforge.net/project/iaxmodem/iaxmodem/iaxmodem-1.2.0/iaxmodem-1.2.0.tar.gz
Download hylafax client and server
wget ftp://ftp.hylafax.org/binary/linux/redhat/6.0.4/hylafax-server-6.0.4-1rhel5.i386.rpm
wget ftp://ftp.hylafax.org/binary/linux/redhat/6.0.4/hylafax-client-6.0.4-1rhel5.i386.rpm
4 Extract archives
tar xvzf iaxmodem-1.2.0.tar.gz
tar xvzf spandsp-0.0.5.tgz
5 compile spandsp and iaxmodem
cd /usr/src/spandsp-0.0.5
./configure && make && make install
cd /usr/src/iaxmodem-1.2.0
cd lib/spandsp
./configure && make && make install
cd /usr/src/iaxmodem-1.2.0
./configure && make
cp iaxmodem /usr/sbin/
mkdir /etc/iaxmodem
6 Install Hylafax
cd /usr/src
rpm -Uvh hylafax-client-6.0.4-1rhel5.i386.rpm hylafax-server-6.0.4-1rhel5.i386.rpm
7 Configure the iaxmodems
mkdir /etc/iaxmodem
add one for each modem example iaxmodem-cfg.ttyIAX1 iaxmodem-cfg.ttyIAX2 iaxmodem-cfg.ttyIAX3
cp iaxmodem-cfg.ttyIAX /etc/iaxmodem/iaxmodem-cfg.ttyIAX1
vi /etc/iaxmodem/iaxmodem-cfg.ttyIAX1
Change the following for each modem. Each modem must have different device name
device /dev/ttyIAX1
server elastix server ip
peername iax extension on elastix server
secret iax extension secret
save it in vi by typing :wq
In my case I need like 15 modems to start so I have 15 iaxmodem-cfg.ttyIAX configuration files… For each one of my modems..
Now it would be much easier to go into virtual faxes in Elastix and do this but, I had no luck getting the functionality working that I needed in a timely manner. In this case is keeping all faxes separate per windows client user on a terminal server of 20 or more users.
cp iaxmodem.init.fedora /etc/init.d/iaxmodem
vi /etc/init.d/iaxmodem
change any lines with /usr/local/sbin/iaxmodem to /usr/sbin/iaxmodem
save it..
chmod 755 /etc/init.d/iaxmodem
mkdir /var/log/iaxmodem
start iaxmodem
/etc/init.d/iaxmodem start
vi /etc/rc.local
add
/etc/init.d/iaxmodem start
Save it..
7 Configure Hylafax
Run faxsetup by typing faxsetup in command prompt
Setup inittab
vi /etc/inittab
add this at end. Add for every modem you want..
# fax
fax0:2345:respawn:/usr/sbin/faxgetty ttyIAX1
Add fax user. Add for every modem you want..
faxadduser 5001 -p Password5001
groupadd 5001
look at /etc/group
get group 5001 group number
cat /etc/group
will look this 5001:x:500:
we are looking for the second number 500
open hosts.hfaxd
vi /var/spool/hylafax/etc/hosts.hfaxd
change
^5001@::ry7YQ7j76876
to
^5001@:500:ry7YQ7j76876
Save the file.
Edit FaxDispatch
vi /var/spool/hylafax/etc/FaxDispatch
add this to end of file
case "$DEVICE" in
ttyIAX1) sudo chgrp 5001 $FILE;;
visudo
Add line to bottom
uucp ALL=(ALL) NOPASSWD: ALL
This should change permissions so for the fax client I am using only the user will see it their faxes! Fax client here http://www.swt-online.de/hylafax/index_eng.html
I usually reboot the server now… then test it.
8. setup client and test server.