app_rxfax and app_txfax

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
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). For more directions consult which explains how to install spandsp and then app_rxfax and app_txfax.

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). The latest version is on inside the directory 'test-apps-asterisk-1.2' and 'test-apps-asterisk-1.4'.

AGX Extra Addons for Asterisk contains enhanced version of app_rxfax and app_txfax for 1.4.
Download it with : svn co 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:

/usr/bin/gs -q -sDEVICE=tiffg3 -sPAPERSIZE=a4 -r204x196 -dNOPAUSE -sOutputFile=/var/spool/asterisk/outgoing/mydocument.tif -- /var/spool/asterisk/outgoing/mydocument.pdf

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)

svn co svn:// asterisk-spandsp-plugins
cd asterisk-spandsp-plugins

That will do the trick

See also

Created by: pupeno, Last modification: Wed 17 of Feb, 2010 (03:00 UTC) by ajunge
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+