I managed to have a TB box with Iaxmodem, Hylafax and Avantfax working perfectly.
So I wrote down what I did step by step.
Be only carefull that my box is a TrixBox-2.3.0.3 and there could be some differences if you run TrixBox-2-.2.4 expecially for what is related to upgrading PHP4 to PHP5.
I also troubled a lot to get it all working so I presume that any little difference on your box could break the system and could need adjustments.
So please don't use my step-by-step giude straight on your working box, but try it first on a spare one.
I really would hate to see people around searching for me with a knife between their teeth.
Forgive, moreover, the grammar and/or spellig mistakes that you will surely find, but English is not my mother language.
1) INSTALL POSTFIX INSTEAD OF SENDMAIL (much easier to configure)
But you can jamp this step if you already managed to get Sendmail working.
#rpm -e --nodeps sendmail
#yum install postfix
#vi /etc/postfix/main.cf
insert this line:
relayhost = mail.my_provider.com (use your smtp server)
check that all the other lines with "relayhost=xyz...." are commented out.
close an save /etc/postfix/main.cf
#service postifix start
2) INSTALL IAXMODEM AND HYLAFAX
#yum install ghostscript sharutils mgetty-voice
#ln -s /usr/share/fonts/default/ghostscript/ /usr/share/ghostscript/fonts
#yum install iaxmodem
#mkdir /var/log/iaxmodem
#touch /var/log/iaxmodem/iaxmodem-cfg.IAX
#vi /etc/iaxmodem/iaxmodem-cfg.ttyIAX
and this is my one:
device /dev/ttyIAX
owner uucp:uucp
mode 660
port 4570 (it should be 4569 but I already have other IAX Trunks on that port)
refresh 60 (you can leave 300 but you'll get nasty messages on"/var/log/asterisk/full")
server 127.0.0.1
peername 444 (this is the extension I created for fax in my TrixBox)
secret my_password
cidname S.CHIARA-BRESCIA (whatever name you want to be displayed on your sent faxes
cidnumber 0303542080 (whatever number you want to be displayed on your sent faxes)
codec alaw
COMMENT to "codec alaw": I'm in Italy and it works fine with this codec, it should be "ulaw" in the States I presume -- you can try "slinear" as well
Only don't forget to put the same codec in the IAX extension in your TrixBox -444 in my case described below.
Log into your FreePBX Control Pannel with your browser and create a new "IAX extenson"
Setup ---> Extensions ---> IAX2
Display Name: IaxModem
Extension Number: 444
secret my_password
notransfer yes
context from-internal
host dynamic
type friend
port 4570
qualify yes
disallow all
allow alaw
dial IAX2/444
accountcode
mailbox 444@device
Record Incoming: Never
Record Outgoing: Never
COMMENT: what I personally did at this point was disable TrixBox fax recognition and set up a SIP trunk pointed to my provider (Eutelia) with a telephone number that I use only for faxing.
Then I set up an InboundRoute "my_fax_number/any cid" pointing to extension 444. In this way when I get a fax on my fax line I get it without even hearing the telephone bells but if somebody sends me by mistake a fax on another line (one of the ones I use for voice) I can just transfer it on to extension 444.
Now download the latest binaries of "hylafax"
#cd /whre_you_put_your_download
#rpm -ivh hylafax-4.4.1-1rhel4.i386.rpm (could be a newer one by the time you do all this)
#faxsetup (answer yes or the default to everything except from "AreaCode" and: "do you want faxaddmodem to configure a modem[yes]": say "no" to this one)
#cd /var/spool/hylafax/etc
#touch xferfaxlog
#chown uucp:uucp xferfaxlog
#vi FaxDispatch (create it if it doesn't exists)
insert these two lines:
SENDTO=my_address@my_domain.com; # by default email to FaxMaster
FILETYPE=pdf; # in PDF format
close and save FaxDispatch
#chown uucp:uucp FaxDispatch
COMMENT: with FaxDispatch set in this way every fax that you recieve will be sent to your mail box. If it is enaugh for your needs: stop here, but you will have to send faxes manually with the command "sendfax" which is not very confortable. Therefore I also installed "AVANTFAX"
COMMENT: check the Hylafax config files: this is the "/var/spool/hylafax/etc/config.ttyIAX" that works for me. It could be different in other Nations:
CountryCode: 39
AreaCode: 030
FAXNumber: +39.030.2056784
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: etc/dialrules.europe
ServerTracing: 0xFFF
SessionTracing: 0xFFF
RecvFileMode: 0644
LogFileMode: 0644
DeviceMode: 0644
RingsBeforeAnswer: 2
SpeakerVolume: off
GettyArgs: "-h %l dx_%s"
LocalIdentifier: "S.CHIARA-BRESCIA"
TagLineFont: etc/lutRS18.pcf
TagLineFormat: "Ricevuto da %%l|%c|Pagina %%P di %%T"
MaxRecvPages: 200
#
#
# Modem-related stuff: should reflect modem command interface
# and hardware connection/cabling (e.g. flow control).
#
ModemType: Class1 # use this to supply a hint
#
# The modem is taken off-hook during initialization, and then
# placed back on-hook when done to prevent glare.
#
ModemResetCmds: "ATH1\nAT+VCID=1" # enables CallID display
ModemReadyCmds: ATH0
Class1AdaptRecvCmd: AT+FAR=1
Class1TMConnectDelay: 400 # counteract quick CONNECT response
Class1RMQueryCmd: "!24,48,72,96" # V.17 fast-train recv doesn't work well
CallIDPattern: "NMBR="
CallIDPattern: "NAME="
CallIDPattern: "ANID="
CallIDPattern: "NDID="
# Uncomment these if you really want them, but you probably don't.
#CallIDPattern: "DATE="
#CallIDPattern: "TIME="
#20060302 JDG - Fix for broken libtiff JBIG support in tiff2pdf
Class1JBIGSupport: no
COMMENT: and this is my "/var/spool/hylafax/etc/config":
LogFacility: daemon
CountryCode: 39
AreaCode: 030
LongDistancePrefix: 0
InternationalPrefix: 00
DialStringRules: dialrules.europe
ServerTracing: 1
Then to start Hylafax and Iaxmodem:
#vi /etc/inittab
add these 2 lines at the bottom:
t2:23:respawn:/usr/sbin/faxgetty ttyIAX
IAX:2345:respawn:/usr/sbin/iaxmodem iaxmodem-cfg.ttyIAX
COMMENT: if you follow my suggestion and start "iaxmodem" and "fax-getty" with "inittab" make sure that they are not run as services as well:
#setup
go to "services" and check that these two are switched off.
3)UPGRADE TO PHP5
#vi /etc/yum.repos.d/CentOS-Base.repo
Go to " and centosplus" and change "enable=0" to enable=1 (at line 55 in my file)
#yum upgrade php
and this is what happened on my system:
php i386 5.1.6-3.el4s1.7 centosplus 1.1 M
Installing for dependencies:
mysql-libs i386 5.0.48-1.el4.centos centosplus 1.8 M
mysqlclient14 i386 4.1.22-1.el4s1.1 centosplus 1.2 M
php-cli i386 5.1.6-3.el4s1.7 centosplus 2.0 M
php-common i386 5.1.6-3.el4s1.7 centosplus 135 k
php-pdo i386 5.1.6-3.el4s1.7 centosplus 219 k
Updating for dependencies:
mysql i386 5.0.27-1.el4.centos centosplus 3.3 M
mysql i386 5.0.48-1.el4.centos centosplus 2.7 M
mysql-devel i386 5.0.48-1.el4.centos centosplus 2.8 M
mysql-server i386 5.0.48-1.el4.centos centosplus 9.7 M
perl i386 4:5.8.8-4.el4s1 centosplus 11 M
perl-DBD-MySQL i386 3.0008-1.el4.centos centosplus 145 k
php-gd i386 5.1.6-3.el4s1.7 centosplus 102 k
php-imap i386 5.1.6-3.el4s1.7 centosplus 48 k
php-mbstring i386 5.1.6-3.el4s1.7 centosplus 969 k
php-mysql i386 5.1.6-3.el4s1.7 centosplus 77 k
php-pear noarch 1:1.4.11-1.el4s1.1 centosplus 345 k
php-snmp
#ln -s /usr/lib/php/modules/* /usr/lib/php4/
#yum install ImageMagick ghostscript libtiff netpbm-progs libungif sudo a2ps psutils expect php-pecl-Fileinfo php-devel
#pear upgrade-all
#pear install db mail mail_mime
#pear channel-update pear.php.net
#mysql_fix_privilege_tables --user=root --password=passw0rd
#chown -R asterisk:asterisk /var/lib/php/session
4) INSTALL AVANTFAX
DOWNLOAD AND UNTAR AVANTFAX
#cd /anywhere_you_untarred_the_sources/avantfax-2.2.6
#chown -R asterisk:asterisk avantfax
#mv avantfax /var/www/html/
#mysql -uroot -ppassw0rd
#mysql -uavantfax -pd58fe49 avantfax
#cd /var/www/html/avantfax/includes/
#cp -a local_config-example.php local_config.php
#vi local_config.php
and change "$dft_config_lang = "en";" to your language ("it" in my case)
#chmod -R 777 /var/www/html/avantfax/tmp
#chmod -R 777 /var/www/html/avantfax/faxes
#cd /var/spool/hylafax/bin
#mv faxrcvd faxrcvd.old
#mv notify notify.old
#ln -s /var/www/html/avantfax/includes/faxrcvd.php /var/spool/hylafax/bin/faxrcvd
#ln -s /var/www/html/avantfax/includes/notify.php /var/spool/hylafax/bin/notify
#mv /usr/bin/faxcover /usr/bin/faxcover.old
#ln -s /var/www/html/avantfax/includes/faxcover.php /usr/bin/faxcover
#/usr/sbin/faxadduser -a pwd asterisk
#/usr/sbin/faxdeluser localhost
#/usr/sbin/faxdeluser 127.0.0.1
#echo 127.0.0.1 >> /var/spool/hylafax/etc/hosts.hfaxd
#vi /etc/sudoers
and add the following line (all on one line):
asterisk ALL = NOPASSWD: /sbin/reboot, /sbin/halt, /usr/sbin/faxdeluser, /usr/sbin/faxadduser -u * -p * *
#vi /etc/crontab
and add the following 2 lines:
0 * * * * /var/www/html/avantfax/includes/phb.php
0 0 * * * /var/www/html/avantfax/includes/remold.php
#vi /etc/yum.repos.d/CentOS-Base.rep
Go to " and centosplus" and set back "enable=1" to enable=0 (always at line 55 in my file)
Reboot.
Now point your browser to:
"http://where_your_FreePBX_is/avantfax/admin"
and configure a user for AVANTFAX
and then to
"http://where_your_FreePBX_is/avantfax"
to login with the user you just created.
To make everything work I picked up a lot from things written by "GuardianiUS" and "rrisco", so let me thank them very much.
It works for me and I hope somebody can find it usefull.
If you want to see my Avantfax start page: "http://fax.ovsc.it:8080"
Giuliano
Member Since:
2006-12-21