I am trying to write a front-end for sending faxes in PHP. I want to know how can I get the status of a fax job.
When the user sent a fax, how can I report the status of the job to the user ? In case when the destination line was busy, unreachable, etc.
Is there any log file or a command that contains the status of a specific fax job which is transfer-able to the front-end ? So I can report back the success/failed message to user.
I know about faxstat -d
, but it's a report for all jobs and i can't fetch that on php side.
As you can see the format of output is not something that can be parsed easily.
Just for reference, here is the list of all status codes.
I had a look at Hylafax's documentation but couldn't find anything on how to trace a job status.
Sure you can. You have a couple options: system and exec.
Use one of those to run the faxstat command in combination with grep, and you should be able to get the data you want. Alternatively, suck in all of faxstat's output into a php variable, and then parse out the data you're looking for.
The file in
/var/spool/hylafax/doneq/q$job_id
, where$job_id
is your job #, is more descriptive. See here: http://hylafax.sourceforge.net/man/doneq.php