TUTORIAL HylaFAX / AvantFax for PIAF! - Parts 1-4

There are indeed email - to -fax provisions available, plus a new method of doing inbound DID routing has been brought to my attention. I hope to have these new procedures documented here in the next few days.

-tshif

Tony,

Any updates on getting the email to fax functionality?

TIA
 
Oh Carlos - I 'm so far behind on this (and other) project! I apologize, but as of right this moment - its not even on my schedule. :cryin:

I think if you read through some of these recent posts in this thread that possibly others had written about ways this may be done. Maybe one of them can help you.

I do hope to get back to this - it owuld still be a very cool ability to have.
 
Can we have the latest documents/scripts on this one? I really like to install it. Another question, I do have the bundled fax working for my PIAF. Is there a conflict after I install this one?
 
As far as the latest - everything I have is posted in this thread. Have at. If there is something newer - let us know how you make out with it!

You didnt mention which PBXIAF youhave, so I dont know which fax you have running. I have not done any testing beyond what is documented in this thread.
 
I have the google voice edition. Just installed a week ago. Before I was using the Dell's edition orgasmastron. I know your post on hylafax at the beginning of the thread, and also in the middle of the thread which repeated 2 out of the 4. Which ones I should use?
 
Tony,

I know how that is...it's been almost a year since I last looked at this.

I just revisited this and see that Hylafax seems to have a few things to process the pdf's and attachments now, but wondering if the email mangling is still an issue. We're trying to get the email to fax, as using the hylafax clients requires touching too many desktops, and most of our clients run in terminal server environments.
 
I see that hylafax-6.0.3-1 is now out, maybe it is time to revisit the script.

Joe
 
I updated the script for hylafax 4.4.5 and for centos 5.3/5.4

Code:
#!/bin/sh
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

#Joe Roper 12.02.2009
# Updated by Claudio Pizzillo 28.10.2009
# Based on a script written by Phone User
#http://pbxinaflash.com/community/threads/hylafax.3093/?t=3093

#Install Fax

clear
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "This script assumes you have not changed the default asteriskuser password For MySQL"
echo "If you have, e.g. if you use PBX-Management, press CTRL-C to exit"
echo "Then change the MySQL asterisk password in the script to suit your installation."
echo " "
echo "If IAXModem/Hylafax/Avantfax is already installed, then you"
echo "should inspect and modify this script, or your installation before executing it."
echo " "
echo "When prompted, go with the defaults - they should be changed via Webmin later "
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
read -p "Press any key to continue or ctrl-C to exit"

#Change passw0rd below for your MySQL asteriskuser password if you have changed it from the default.
MYSQLASTERISKUSERPASSWORD=amp109


LOAD_LOC=/var/pbx_load/

cd $LOAD_LOC

# install some dependencies
yum -y install ghostscript ghostscript-fonts sharutils

wget ftp://ftp.hylafax.org/binary/linux/redhat/RPMS/i386/hylafax-4.4.5-1rhel5.i386.rpm
wget http://downloads.sourceforge.net/project/iaxmodem/iaxmodem/iaxmodem-1.2.0/iaxmodem-1.2.0.tar.gz?use_mirror=surfnet
wget http://www.fonicaprojects.com/downloads/extras/avantfax.tar.gz
wget http://www.fonicaprojects.com/downloads/extras/ico_fax.png
wget http://www.tecchio.net/webmin/hylafax/hylafax_mod-1.8.2.wbm.gz

#Install Hylafax first so that the directories are in place
rpm -Uvh $LOAD_LOC/hylafax-4.4.5-1rhel5.i386.rpm


#INstall IAXMODEMS 0->3

cd /usr/src
tar zxfv $LOAD_LOC/iaxmodem-1.2.0.tar.gz
cd iaxmodem-1.2.0
./configure
make
mkdir /etc/iaxmodem/

mkdir /var/log/iaxmodem
touch /var/log/iaxmodem/iaxmodem.log

COUNT=0
while [ $COUNT -lt 4 ]; do
       echo "Number = $COUNT"
       touch /etc/iaxmodem/iaxmodem-cfg.ttyIAX$COUNT
    touch /var/log/iaxmodem/iaxmodem-cfg.ttyIAX$COUNT
       echo "
device /dev/ttyIAX$COUNT
owner uucp:uucp
mode 660
port 457$COUNT
refresh 300
server 127.0.0.1
peername iax-fax$COUNT
secret 1234
cidname Fonica PABX
cidnumber [URL="ada://+0000000000"][URL="ada://+0000000000"]+0000000000[/URL][/URL]$COUNT
codec ulaw
" > /etc/iaxmodem/iaxmodem-cfg.ttyIAX$COUNT

#Setup IAX Registrations
echo "
[iax-fax$COUNT]
type=friend
host=127.0.0.1
port=457$COUNT
context=from-internal
disallow=all
allow=ulaw
jitterbuffer=no
qualify=yes
requirecalltoken=no
secret=1234
" >> /etc/asterisk/iax_custom.conf

#Setup Hylafax Modems
cp /usr/src/iaxmodem-1.2.0/config.ttyIAX /var/spool/hylafax/etc/config.ttyIAX$COUNT

echo "
S$COUNT:345:respawn:faxgetty /dev/ttyIAX$COUNT
" >> /etc/inittab


COUNT=$((COUNT + 1))
done

chown -R uucp:uucp /etc/iaxmodem/
chown uucp:uucp /var/spool/hylafax/etc/config.ttyIAX*


touch /etc/logrotate.d/iaxmodem
echo "
/var/log/iaxmodem/*.log {
    notifempty
    missingok
    postrotate
        /bin/kill -HUP `cat /var/run/iaxmodem.pid` || true
    endscript
}
" > /etc/logrotate.d/iaxmodem


cp iaxmodem /usr/sbin/iaxmodem
cp iaxmodem.init.fedora /etc/rc.d/init.d/iaxmodem
sed -i 's/\/usr\/local\/sbin\/iaxmodem/\/usr\/sbin\/iaxmodem/g'  /etc/rc.d/init.d/iaxmodem
chmod 0755 /etc/rc.d/init.d/iaxmodem
chkconfig --add iaxmodem
chkconfig iaxmodem on
/etc/init.d/iaxmodem start



#Configure Hylafax
touch /var/spool/hylafax/etc/FaxDispatch
echo "
case "$DEVICE" in
   ttyIAX0) [email protected]; FILETYPE=pdf;; # all faxes received on ttyIAX0
   ttyIAX1) [email protected]; FILETYPE=pdf;; # all faxes received on ttyIAX1
   ttyIAX2) [email protected]; FILETYPE=pdf;; # all faxes received on ttyIAX2
   ttyIAX3) [email protected]; FILETYPE=pdf;; # all faxes received on ttyIAX3
esac
" > /var/spool/hylafax/etc/FaxDispatch

chown uucp:uucp /var/spool/hylafax/etc/FaxDispatch

# Set up Dial Plan

echo "
[custom-fax-iaxmodem]
exten => s,1,Dial(IAX2/iax-fax0/\${EXTEN})
exten => s,n,Dial(IAX2/iax-fax1/\${EXTEN})
exten => s,n,Dial(IAX2/iax-fax2/\${EXTEN})
exten => s,n,Dial(IAX2/iax-fax3/\${EXTEN})
exten => s,n,Busy
exten => s,n,Hangup
" >> /etc/asterisk/extensions_custom.conf


RESULT=`/usr/bin/mysql -uasteriskuser -p$MYSQLASTERISKUSERPASSWORD <<SQL

use asterisk
INSERT INTO custom_destinations
    (custom_dest, description, notes)
    VALUES ('custom-fax-iaxmodem,s,1', 'Fax (Hylafax)', '');
quit
SQL`


faxsetup


#Install Avantfax

cd /usr/src
tar zxfv $LOAD_LOC/avantfax.tar.gz
cd avantfax-3.1.6
./rh-install.sh

rm -rf /etc/httpd/conf.d/avantfax.conf

# Add a menu item to kennon soft interface
#copy in the picture
cp $LOAD_LOC/ico_fax.png /var/www/html/welcome/ico_fax.png
sed -i '/asteridex/ i\1,Fax,./avantfax,Avantfax,ico_fax.png' /var/www/html/welcome/.htindex.cfg

service httpd restart

asterisk -rx "module reload"

#chmod -x install-fax.sh

echo " "
echo " "
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "IAXModem/Hylafax/Avantfax installation complete"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo " "
echo "Avantfax is covered by its own security, the credentials are admin / password"
echo "You will be prompted to change the root password, then you can add other users"
echo " "
echo "Point a DID at the custom destination, FAX (Hylafax) which has been created for"
echo "you in FreePBX. Outbound faxing will go out via the normal trunks"
echo " "
echo "nv-faxdetect has not been added in this install, so DID cannot be shared between"
echo "extensions and faxes"
echo " "
echo "A Hylafax webmin module has been placed in $LOAD_LOC/hylafax_mod-1.8.2.wbm.gz"
echo "This is added via Webmin | Webmin Configuration | Webmin Modules | From Local File"
echo " "
echo "Please reboot as soon as you can to bring the fax online."

P.S.on asterisk 1.6 need also to install the Freepbx module IAX settings and add in "other advanced setting" requirecalltoken=no
 
Last edited by a moderator:
Joe - if you get a chance to revisit the script, try it under proxmox. My install fails every time at the cups install using the 64-bit container. It installs fine into a KVM. That is so far my only complaint with proxmox.

I can report great success faxing via voip.ms. So far all of my faxes have gone through. However, for the most part all of my faxes go to large companies who are probably using computer based fax systems. In addition, my pbx system is housed at my isp on his backbone so I have very good throughput and a very steady data and ping rate to voip.ms from their shop. I have heard good things about gafachi and will be trying their trunks for faxing as well.
 
Hi

The avantfax install script - written by advantfax, installs a load of dependencies, I suspect that to be the problem, as my script does not install cups, the avantfax script it calls does.

As it happens, I have to work on this for one of my deployments today and tomorrow. I will report back

Joe
 
Joe reports that he has found the fix this morning. I'm sure he'll have more details soon. Before running the install script, issue the following commands on your Proxmox OpenVZ container:
Code:
yum remove cups
yum install cups
 
Hi

Since I reported that to Ward, the installation still did not go smoothly, so there was more stuff to fix.

It maybe that something got corrupted in the creation of the image, so second release may be in order.

This has been a nightmare to track down, especially as my own versions worked correctly - I've spent half the day on this.

Anyway, here's the fix, it's brevity belies the amount of work that went into sorting it out.

Code:
yum -y remove cups
yum -y install cups
yum -y upgrade glibc 

wget http://www.fonicaprojects.com/downloads/piaf/piaf-hylafax.sh
chmod +x piaf-hylafax.sh
./piaf-hylafax.sh
 
Many thanks for taking the time with this Joe... I've had some success with this on Proxmox but I'm getting the following error notice sent to me by email from Avantfax when I try to send a fax:

:-( Problem sending the fax.: format failed

I'm using a SIP trunk to try and send this out and I'm just using from-internal context, but guessing from the error it's not even getting as far as trying to dial out at the moment, it's something to do with converting the PDF to the right format for sending, maybe something to do with ghostscript from the digging I've done on the Hylafax forum? Receiving a fax is working great btw.

I'd never actually tried this script until now, so I also tried it on a standalone PIAF server this morning with PIAF 1.4 / 32bit using same settings and all works great, inbound and outbound... So it's down to something on Proxmox and/or 64 bit install is my guess, but as I don't know enough to go much further any guidance would be great.

Cheers for all your time taken with this already :)
 
Hi

Given that I believe that there appears to be issues with the Piaf image, I am of a mind to leave this until Ward re-rolls us a new image.

However, I will test on a hand built image built from similar components to see if there is any intrinsic problem with Hylafax on proxmox.

Joe
 
Cheers Joe for quick reply... I will await your further thoughts before trying anything further myself...

Ant
 
Problem with Install script this morning

I was setting up the hylafax/avantfax duo this morning on the new 1.6 version and the script stops because the website for downloading the webmin module is offline. I found the file on mediafire here: http://download398.mediafire.com/03ezzlnam9gg/bmybtjkhude/hylafax_mod-1.8.2.wbm.gz
and manually uploaded it to the machine /var/pbx_load directory. I then edited out all the entries previous to that line in the script and reran it. Install seems fine.
 
Hi

I've pulled a copy of the webmin module onto the Fonicaprojects server, and adjusted the script as required.

Joe
 
Let me know, and we can look at an update.

If you take the script and modify it, can you annotate your changes, then they are easy to incorporate into a new script.

Joe
 

Members online

Forum statistics

Threads
26,696
Messages
174,453
Members
20,266
Latest member
ro-fi
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top