app_rxfax and app_txfax are two Asterisk applications to send and receive faxes. They are simple interfaces to Steve Underwood’s spandsp library, which does the real work. Up to date versions may be obtained from http://sf.net/projects/agx-ast-addons.
Using svn to download is recommended as tarballs from Sourceforge repository are not in sync.
They consist of three files app_rxfax, app_txfax and apps_makefile.patch which you should put on your Asterisk‘s source code directory and apply the patch (which may or may not work according to the current state of Asterisk).
There’s an application called astfax that can use app_txfax to create a mail-to-fax gateway.
app_rxfax and app_txfax is distributed next to spandsp (but not in the same tarball).
AGX Extra Addons for Asterisk contains enhanced version of app_rxfax and app_txfax for 1.4.
Download it with : svn co https://agx-ast-addons.svn.sourceforge.net/svnroot/agx-ast-addons agx-ast-addons
Sending (txfax)
If the variable LOCALHEADERINFO has been set when txfax is run, the value of that variable will be used as the user defined part of the header text. The page number, date and time, and calling FAX ID will be filled in by the software to make a complete header line, of the kind produced by most FAX machines.
If the variable LOCALSTATIONID has been set when txfax is run, the value of that variable will be used to identify itself to the remote fax machine.
exten => _X.,1,SetVar(FAXFILE=/var/spool/asterisk/fax/mydocument.tif)
exten => _X.,2,SetVar(LOCALHEADERINFO=Company name and department)
exten => _X.,3,SetVar(LOCALSTATIONID=Company name)
exten => _X.,4,txfax(${FAXFILE}|caller)
Document format
When sending a fax you need to use a tiffg3 document, to convert a document to tiffg3 you can use ghostscript with this command:
If you can’t get Asterisk to recognize an incoming call as a fax, check the wiring of your jacks. Reversed wires in an RJ-11 jack prevented Asterisk from recognizing the fax polling tones and caused the server to dump the call into a regular extension instead of recognizing it as a fax
app_rxfax and app_txfax on Debian Lenny
For some reason the package asterisk-spandsp-plugins has been taken out in debian lenny. To build your own package the instructions are (thanks to Tzafir Cohen)
cd asterisk-spandsp-plugins
svn-buildpackage
That will do the trick
See also
- SpanDSP tutorial on asteriskguru
- spandsp
- astfax
- Asterisk fax
- AGX Extra Addons for Asterisk contains enhanced version of app_rxfax and app_txfax for 1.4