TIPS Hylafax not delivering to AvantFax automatically

anomaly0617

Member
Joined
Feb 9, 2012
Messages
42
Reaction score
10
Location
Dayton, OH
Hi all!,

I've got a PBX In A Flash Server with IncrediblePBX running. Here's the versions straight off the status screen at the console:

CentOS v7 x64
Asterisk 13.20.0
Incredible 13.0.120.10

On this particular server, I have two IAX extensions that accept faxes from the outside world on dedicated fax DIDs. Problem is, the faxes are arriving and are in the hylafax spool, but they are not being delivered on to AvantFax for the end-users to see.

If I open the log files individually at /var/spool/hylafax/log I can read through the logs and nothing looks amiss. At the bottom of each log file is the command:

bin/faxrcvd.php 'recvq/fax000000175.tif' 'ttyIAX0' '000000202' '' '12345678901' 'ABC COMPANY' '<NONE>' 's'

...and if I go to /var/spool/hylafax and run this command, it will convert the Multi-page TIF into a PDF and deposit the resulting file into Avantfax, and email out the fax to the internal parties that receive them.

This is an air-gapped PBX, so there's no direct internet connection to it unless I walk in the server room and plug in that interface. This means that I was comfortable trying a few things, like

1. running a sudo chmod -R 777 and sudo chown -R asterisk:asterisk on / var / www / avantfax, since anything that has a login on the server can access these files. The end users can only get to them through an internal network and there's no gateway there to worry about. This produced no noticeable result when I sent a test fax in from another location, so I moved the permissions back to 755.

2. running a sudo chmod -R 777 on / var / spool / hylafax. This is owned by uucp:uucp, which makes me think that's the user account running hylafax, but I'd like to get confirmation of that before I dork around too much more with ownership and permissions on this production PBX. Again, the 777 produced no noticeable result when I sent a test fax, so I moved it back to 755 as well. This folder is still owned by uucp.

So, I'm out of ideas. Anyone have some ideas on this? I know hylafax and avantfax are not supported or maintained by the IncrediblePBX staff, but I looked directly for a hylafax forum and didn't find one.

Thanks (in advance!),
Paul
 
Last edited:

anomaly0617

Member
Joined
Feb 9, 2012
Messages
42
Reaction score
10
Location
Dayton, OH
I ended up writing a solution to this.

Filename is called /var/spool/hylafax/faxprocessor.sh
Bash:
#!/bin/bash

cd /var/spool/hylafax/log
faxfile=$(ls -Art c*| tail -n 1)
if [ ${#faxfile} -gt 0 ]
then
   echo $faxfile Found.
   faxline=$(less $faxfile | grep faxrcvd)
   if [ ${#faxline} -gt 0 ]
   then
      faxcmd=${faxline:39:999}
      cd /var/spool/hylafax
      eval $faxcmd
   else
      echo $faxfile Contains no command to be processed
   fi
   mv /var/spool/hylafax/log/$faxfile /var/spool/hylafax/log/processed.$faxfile
fi
Be sure to chmod a+x the file:
Bash:
chmod a+x /var/spool/hylafax/faxprocessor.sh
Then put it into crontab so it runs once a minute:
Bash:
crontab -e
Inside the editor, add this line:
Bash:
* * * * * /var/spool/hylafax/faxprocessor.sh > /dev/null 2>&1
The default editor for my distro is vi, so when you get into crontab, press i to insert new text. Put the line above on a new line, and then type :wq to write the file (save it) and quit.

Another common default editor is nano. If you're in nano, paste the line into a new line, then press CTRL-X and then press Y and Enter.

This comes with no warranty whatsoever. It's free for anyone's use and if it melts down your entire server room, well, that stinks for you. On the other hand, if this delivers faxes to people within a minute of receiving them and keeps your boss from screaming at your daily, well, you're welcome. :)
 
  • Like
Reactions: wardmundy

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
675
Reaction score
251
Avantfax also maintains a mysql log, compare your hylafax logs against the SysLog table in avantfax database
 

anomaly0617

Member
Joined
Feb 9, 2012
Messages
42
Reaction score
10
Location
Dayton, OH
Yep, been into both Hylafax logs and Avantfax logs (in GUI and in MySQL). It does not give any information about the success or failure of conversion of a TIF into PDF and notification. :-/
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
675
Reaction score
251
what does

mysql -ppasswqord avantfax -e "select * from SysLog where `logtext` like '%tiff2pdf%'"


return?
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,520
Messages
138,557
Members
14,644
Latest member
goseph