3 years ago
A FreePBX ARI module to send fax from the User Portal

Hylafax is a very good fax server, but at our little office we are sending less and less faxes. Now Hylafax is a little bit “overscaled” for us. I’ve decided to remove it and look for Asterisk/Freepbx to do the job of sending faxes.

Receiving faxes with Asterisk is very easy. Digium Free For Fax (FFA) comes free for that. Download it from the Digium Store. Get a free license, and install. This page will give you all informations you need to make it work. Install the Fax module for Freepbx it will help you much for the settings.

Sending faxes is little more tricky. Recluse wrote a Wep Fax for Asterisk that works alone with FFA and Asterisk. I re-wrote his script to make a ARI module for FreePBX so users can access the page via the User Portal.

Simply go to your User Portal Page, something like http://your_asterisk_server/recordings Click on “Send fax”, and fill the form : fax header, your local fax number, your email for report, the destination number (yes, please). Attach a PDF or TIFF file. Click on SendFax. After a short time you will receive by email a report about success or failure.

  • Download webfax-ari-module.tar.gz Extract it somewhere
  • Copy sendfax.module to /%AMPROOT%/recordings/modules/sendfax.module
  • Copy sendfaxnotify.php to ${ASTVARLIBDIR}/bin/sendfaxnotify.php
  • Change the two files to be owned by the user running Asterisk.
Create the following context in /etc/asterisk/extensions_custom.conf and reload asterisk :
[outboundfax]
exten => s,1,Set(FAXOPT(filename)=${FAXFILE})
exten => s,n,Set(FAXOPT(ecm)=yes)
exten => s,n,Set(FAXOPT(headerinfo)=${FAXHEADER})
exten => s,n,Set(FAXOPT(localstationid)=${LOCALID})
exten => s,n,Set(FAXOPT(maxrate)=14400)
exten => s,n,Set(FAXOPT(minrate)=2400)
exten => s,n,SendFAX(${FAXFILE},d)
exten => s,n,System(${ASTVARLIBDIR}/bin/sendfaxnotify.php INIT "${EMAIL}" "${DESTINATION}" "${TIMESTAMP}" "NO_STATUS" "NO_PAGES")
exten => h,1,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})
exten => h,n,NoOp(FaxStatus : ${FAXSTATUS})
exten => h,n,NoOp(FaxStatusString : ${FAXSTATUSSTRING})
exten => h,n,NoOp(FaxError : ${FAXERROR})
exten => h,n,NoOp(RemoteStationID : ${REMOTESTATIONID})
exten => h,n,NoOp(FaxPages : ${FAXPAGES})
exten => h,n,NoOp(FaxBitRate : ${FAXBITRATE})
exten => h,n,NoOp(FaxResolution : ${FAXRESOLUTION})
exten => h,n,System(${ASTVARLIBDIR}/bin/sendfaxnotify.php NOTIFY "${EMAIL}" "${DESTINATION}" "${TIMESTAMP}" "${FAXSTATUSSTRING}" "${FAXPAGES}")
; end of outboundfax context
Your comments are very welcome.
  1. hiousi posted this

Not the original Random Daze theme by Polaraul