Hylafax+ & Iaxmodem & Trixbox HOWTO

kspare
Posts: 673
Member Since:
2007-02-16

If someone wants to add this to the wiki, be my guest, I cleaned up my instructions a bit more from the previous post I made.

Some of the changes that made this work better, is that I'm no longer using hylafax, i'm using hylafax+ there is a huge difference in that hylafax is no longer being developed, where as hylafax+ is.

So for anyone who follows this tutorial, if you are prone to doing yum updates you must exclude hylafax because the box may try to over write hylafax+

If you find there are newer versions of iaxmodem or hylafax+ you can easily substitute in those versions as well.

I have two systems running 8 modems on T1s that run quite busy, as well as many customers running a single modem with not so busy faxes and 100% success rates.

I hope this helps some people out!

cd /usr/src
wget http://packages.sw.be/hylafax/hylafax-5.2.5-1.el5.rf.i386.rpm
rpm -i hylafax-5.2.5-1.el5.rf.i386.rpm

yum -y install ghostscript sharutils mgetty-voice iaxmodem gcc* make

cd /usr/src
wget http://voxel.dl.sourceforge.net/sourceforge/iaxmodem/iaxmodem-1.1...
tar zxvf iaxmodem-1.1.1.tar.gz
cd iaxmodem-1.1.1
./build static

cd /usr/sbin
mv iaxmodem iaxmodemold
cp /usr/src/iaxmodem-1.1.1/iaxmodem iaxmodem

ln -s /usr/share/fonts/default/ghostscript/ /usr/share/ghostscript/fonts

Configure Asterisk Extension

Extension Number: 9001 (I start and 9001 and go up to as many ext's as I need. I install 8 modems by default on a new system)
Display Name: Digital Modem 1
Record Incoming: Never
Record Outgoing: Never
Secret: customerphone

Configure IAXModem

Edit Config Files

device /dev/ttyIAX1 (edit each file to reflect the device, IE. ttyIAX1 would go in iaxmodem-cfg.ttyIAX1 etc
owner uucp:uucp
mode 660
port 4570
refresh 300
server 127.0.0.1
peername iaxmodem (change this to 9001, 9002 etc
secret custphone (iax2 password you used when you created the ext)
cidname KSP Technology (Customer name)
cidnumber 306-555-1212 (Customer fax number)
codec slinear (leave this, don't change to ulaw or anything else)

cd /etc/iaxmodem
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX1
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX2
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX3
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX4
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX5
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX6
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX7
cp iaxmodem-cfg.ttyIAX iaxmodem-cfg.ttyIAX8
 
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX1
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX2
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX3
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX4
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX5
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX6
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX7
nano /etc/iaxmodem/iaxmodem-cfg.ttyIAX8

Setup Logs
make sure it can log properly:
 
mkdir /var/log/iaxmodem
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX1
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX2
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX3
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX4
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX5
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX6
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX7
touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX8

Add faxgetty to /etc/inittab
These correspond to the device lines in the /etc/iaxmodem/* config files. (see previous step, above), I put these at the very bottom:
nano /etc/inittab

t0:23:respawn:/usr/sbin/faxgetty ttyIAX1
t1:23:respawn:/usr/sbin/faxgetty ttyIAX2
t2:23:respawn:/usr/sbin/faxgetty ttyIAX3
t3:23:respawn:/usr/sbin/faxgetty ttyIAX4
t4:23:respawn:/usr/sbin/faxgetty ttyIAX5
t5:23:respawn:/usr/sbin/faxgetty ttyIAX6
t6:23:respawn:/usr/sbin/faxgetty ttyIAX7
t7:23:respawn:/usr/sbin/faxgetty ttyIAX8

cd /var/spool/hylafax/etc
touch xferfaxlog
chown uucp:uucp xferfaxlog

edit fax dispatch to control where the faxes are emailed to:

SENDTO=faxes@customer.ca; # by default email to FaxMaster
FILETYPE=pdf; # in PDF format

## and/or by device
#case "$DEVICE" in
# ttyS1) SENDTO=john;; # all faxes received on ttyS1
# ttyLT0) SENDTO=mary@home;; # all faxes received on ttyLT0
#esac

You can also edit it to forward faxes based on the device.

nano FaxDispatch

Now edit the hylafax iax settings. You only need to edit the top to reflex your fax numbers. You only need to edit the base file and copy it out 8 times.

CountryCode: 1
AreaCode: 306
FAXNumber: +1.306.555.1212
LongDistancePrefix: 1
InternationalPrefix: 011
DialStringRules: etc/dialrules
ServerTracing: 0xFFF
SessionTracing: 0xFFF
RecvFileMode: 0600
LogFileMode: 0600
DeviceMode: 0600
RingsBeforeAnswer: 1
SpeakerVolume: off
GettyArgs: "-h %l dx_%s"
LocalIdentifier: "Your Customer"
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "From %%l|%c|Page %%P of %%T"
MaxRecvPages: 200
 

cd /var/spool/hylafax/etc
nano config.ttyIAX

cp config.ttyIAX config.ttyIAX1
cp config.ttyIAX config.ttyIAX2
cp config.ttyIAX config.ttyIAX3
cp config.ttyIAX config.ttyIAX4
cp config.ttyIAX config.ttyIAX5
cp config.ttyIAX config.ttyIAX6
cp config.ttyIAX config.ttyIAX7
cp config.ttyIAX config.ttyIAX8

chown uucp:uucp config.ttyIAX1
chown uucp:uucp config.ttyIAX2
chown uucp:uucp config.ttyIAX3
chown uucp:uucp config.ttyIAX4
chown uucp:uucp config.ttyIAX5
chown uucp:uucp config.ttyIAX6
chown uucp:uucp config.ttyIAX7
chown uucp:uucp config.ttyIAX8

chkconfig iaxmodem on

Modify how faxes are sent.

nano /var/spool/hylafax/bin/faxrcvd

INFO=$SBIN/faxinfo
FAX2PS=$TIFFBIN/fax2ps
TIFF2PS=tiff2ps
TOADDR=support@yourcompany.com (address errors are sent to)
FROMADDR=fax@yourcompany.com (address faxes appear to come from
TIFFINFO=tiffinfo
NOTIFY_FAXMASTER=errors

/usr/sbin/faxsetup

Finish Up

Start Up IAXModem:
 
service iaxmodem start

Start Up Faxgetty

telinit q

tail -f /var/log/messages

Verify E-Mail Traffic
You can also check the sendmail log to verify that emails are being sent as expected:
 
tail -f /var/log/maillog

 
recvstats - will display some fax stats



gonzogg2
Posts: 31
Member Since:
2008-04-07
Kspare, thank you for this

Kspare, thank you for this how to. I am following step by step but I don't understand what you mean when you say:

Edit Config Files

device /dev/ttyIAX1 (edit each file to reflect the device, IE. ttyIAX1 would go in iaxmodem-cfg.ttyIAX1 etc

This is the error I am getting:

FaxGetty[3023]: /dev/ttyIAX1: Can not open modem (No such file or directory)
FaxGetty[3024]: /dev/ttyIAX3: Can not open modem (No such file or directory)
FaxGetty[3025]: /dev/ttyIAX2: Can not open modem (No such file or directory)

Thanks, any help will be appreciated



kspare
Posts: 673
Member Since:
2007-02-16
I've actually abandoned

I've actually abandoned this. Elastix has integrated hylafax so nicely i'm just using that. I'd suggest taking a look at it. it's quite slick



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.