TIPS Hylafax not delivering to AvantFax automatically

anomaly0617

Member
Joined
Feb 9, 2012
Messages
50
Reaction score
11
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
50
Reaction score
11
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. :)
 

dicko

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

anomaly0617

Member
Joined
Feb 9, 2012
Messages
50
Reaction score
11
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
1,607
Reaction score
826
what does

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


return?
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
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.
Top