Integrating Fax for Asterisk in Asterisk 11

Muirhead_fax_machineAs much as we may hate it, there are still some transactions that require fax. Fax is an old archaic dinosaur technology but… the reality is that fax usage is everywhere… and probably will be for quite some time for no other reason than the complete and utter simplicity of fax usage!

In a rather smart move on Digium’s part, they’ve also rolled out Free Fax For Asterisk (FFA) where you can get a free 1-channel license for an Asterisk installation. This will suffice to fax small offices need.

In this post I’ll show you how to install and configure FFA in Asterisk 11.

Step 1 – Get the Fax for Asterisk Software License.
To get the Fax for Asterisk software, go to the Digium Store (see linkografia): once purchased you will receive your license via email and all the instruction about the installation.

Att.: If you will only need to support 1 simultaneous fax session you may be interested in the Free FFA License: Digium provides this license at no cost, limited one per installation of Asterisk. If you will need additional simultaneous fax sessions you have to buy other licenses: the cost is relatively cheap.

Step 2 – Install the Fax for Asterisk Software
I won’t write anything about the installation because the instructions you will receive via activation-email are very detailed.

Step 3 – Make a dial plan
Here’s an example for sending and receiving fax.

[inbound-fax]
exten => s,1,NoOp(FAX RECEIVED from ${CALLERID(num)} ${STRFTIME(${EPOCH},,%c)} ****)
exten => s,n,Set(FILENAME=fax-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => s,n,Set(FAXFILE=${FILENAME}.tif)
exten => s,n,Set(FAXOPT(ecm)=yes)
exten => s,n,Set(FAXOPT(localstationid)=01042064013)
exten => s,n,Set(FAXOPT(maxrate)=14400)
exten => s,n,Set(FAXOPT(minrate)=2400)
exten => s,n,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})
exten => s,n,NoOp(FAXOPT(headerinfo) : ${FAXOPT(headerinfo)})
exten => s,n,NoOp(**Receiving Fax : ${FAXFILE}**)
exten => s,n,ReceiveFAX(/tmp/${FAXFILE})
exten => s,n,Hangup()
exten => h,1,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})

[send-fax]
exten => sendfax,1,NoOp(Sending a fax)
exten => sendfax,n,Set(FAXOPT(filename)=${FAXFILE})
exten => sendfax,n,Set(FAXOPT(ecm)=yes)
exten => sendfax,n,Set(FAXOPT(headerinfo)=Inform.Pressapochista +3901042064013)
exten => sendfax,n,Set(FAXOPT(localstationid)=003901042064013)
exten => sendfax,n,Set(FAXOPT(maxrate)=14400)
exten => sendfax,n,Set(FAXOPT(minrate)=2400)
exten => sendfax,n,SendFAX(/tmp/${FAXFILE},d)
exten => h,1,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})

To receive simple point an incoming number to inbound-fax,s,1: faxes will be saved to /tmp in tiff format.

To transmit create a call file and put it in /var/spool/asterisk/outgoing.

channel: SIP/1110/
Context: send-fax
Extension: sendfax
Priority: 1
Set: FAXFILE=/tmp/
Set: FaxID=003901042064013

Att.: SIP/1110 is the SIP trunk. It is very important to specify directly a SIP channel here, and not Local channel, otherwise it is possible that you will have some issues using T38 protocol (Asterisk reply to a T38 offer complaining with “SIP/2.0 488 Not acceptable here”).

Linkografia
Digium Fax For Asterisk