HylaFax Server Install with iaxmodem

I hope this is useful to somebody it can sure be done differently.
This is basically what I did after banging my head for months trying to get faxing separated per client on a windows pc... I use vi editor 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.
Code:
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
Code:
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
Code:
tar xvzf iaxmodem-1.2.0.tar.gz
tar xvzf spandsp-0.0.5.tgz
5 compile spandsp and iaxmodem
Code:
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
Code:
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
Code:
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 PBX
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.
Code:
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
Code:
faxsetup
Setup inittab
Code:
vi /etc/inittab
add this at end. Add for every modem you want..
Code:
# fax
fax0:2345:respawn:/usr/sbin/faxgetty ttyIAX1
Add fax user. Add for every modem you want..
Code:
faxadduser 5001 -p  Password5001
useradd 5001
look at /etc/group
get group 5001 group number
Code:
cat /etc/group
will look this
Code:
5001:x:500:
we are looking for the second number 500
open hosts.hfaxd
Code:
vi /var/spool/hylafax/etc/hosts.hfaxd
change
Code:
^5001@::ry7YQ7j76876
to
Code:
^5001@:500:ry7YQ7j76876
Save the file.

Edit FaxDispatch
Code:
vi /var/spool/hylafax/etc/FaxDispatch
add this to end of file
Code:
 case "$DEVICE" in
ttyIAX1) sudo chgrp 5001 $FILE;;
esac
Code:
visudo
Add line to bottom
Code:
Defaults:uucp !requiretty
uucp    ALL=(root) NOPASSWD: /bin/chgrp
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. You need to edit the mod.dll in the user profile in Windows. You put the uuid in the mod.dll file.