So you want to send and receive faxes on your Asterisk system? This guide will show you how to set up faxing on your system. We assume that you understand the basics of the dialplan and basic asterisk configuration. Here are a few SRPM's that include the faxing capabilities: Spandsp 0.0.2pre26 Zaptel 1.2.6 Libpri 1.2.3 Asterisk 1.2.8 First you need to rebuild the packages. The order of installation is: spandsp, zaptel, libpri, asterisk. You'll want to go through the install process on each package individually in order. rpmbuild --rebuild This will place the rpm into the /usr/src/redhat/RPMS/ folder. Once that's complete, you have to install the package: rpm -Uvh /usr/src/redhat//* So for example, following these instructions, this is how we'd get spandsp installed on an i386 system: rpmbuild --rebuild spandsp-0.0.2-shsu.1_pre26.src.rpm sudo rpm -Uvh /usr/src/redhat/RPMS/i386/spandsp-0.0.2* Once you have those installed, you're ready to get faxing. Start up asterisk and make sure that the app_rxfax.so, as well as the fax detection program, module has loaded. Do this by doing asterisk -r show application RxFAX show application NVFaxDetect Once you're satisfied that the application has loaded, you need to add some fax detection to your dialplan. In the incoming (whatever context you have external calls come in on), add an NVFaxDetect(3). This is how ours looks: exten => _[46]XXXX,1,Answer exten => _[46]XXXX,2,Set(DIALED=${EXTEN}) exten => _[46]XXXX,3,NVFaxDetect(3) exten => _[46]XXXX,4,Macro(stdexten|${EXTEN}) Then we create a couple extensions and contexts to handle the jumps: exten => fax,1,Goto(fax|${DIALED}|1) exten => talk,1,Goto(${DIALED}|4) [fax] exten => _[46]XXXX,1,Answer exten => _[46]XXXX,2,Set(DIALED=${EXTEN}) exten => _[46]XXXX,3,Set(FILENAME=/tmp/${EXTEN}.tif) exten => _[46]XXXX,4,RxFAX(${FILENAME}) exten => _[46]XXXX,5,Hangup exten => h,1,Realtime(emaillookup|exten|${DIALED}|fax_) exten => h,2,System(/usr/local/bin/mailfax ${FILENAME} ${fax_email} ${CALLERID(num)} Here we've got a talk and a fax extension. Talk just sends it back to the next priority in the origianl extension, and fax drops it into the fax context to handle the faxing. In the fax context, we track what number was dialed with the DIALED variable, and we receive the fax. The emaillookup table can just be a table with exten => email mappings. The actual mailing of the fax is done with the 'h' extension. Here's t he script that we use: #!/bin/bash FAXFILE=$1 RECIPIENT=$2 FAXSENDER=$3 UDATE=`date +%s` DATE=`date +%F` MESSAGE="You have received a fax from $FAXSENDER on $DATE." tiff2pdf -p letter -o /tmp/$UDATE-$FAXSENDER.pdf $FAXFILE echo $MESSAGE | mutt -a /tmp/$UDATE-$FAXSENDER.pdf -s "Incoming Fax" $RECIPIENT This assumes that a person will only receive one fax at a time, and doesn't really check to make sure. This should cover the setup and use of incoming faxes, if you have any comments, let me know.