
Hi, Habr!
E-mail has long been the main way to exchange documents. But after I replaced the old Siemens and Panasas with Asterisk PBX in many organizations in my city, I was reluctant to refuse faxes (especially in budget organizations), and it’s understandable that this is faster and easier for an employee than messing with a scanner. Since they put the aster on them mainly as a result of state expansion and with a desire to save money, faxes for new employees also need to be virtualized. There shouldn't be any problems with receiving a fax to an e-mail, I had to break my head with a simple and free way of sending.
On the Internet, I found an easy way to send a fax through the FreePBX web interface. Easy to configure, works with a bang. For the active use of faxes in a large office is unlikely to work, but for a small office with little fax traffic or for beginners in aster or * nix - just right.
')
We have a virtual machine in a small office with Ubuntu 12.04 on board. Installed Asterisk 11 + FreePBX 2.11. Log in via ssh to the server and proceed.
1. Install the fax module. You can also use the spandsp module, there are no restrictions in it, Malamut reminds us, then you can skip this item
We register on
the Digium website , go to
the module page , click “Get 1 Free license”, place an order, wait for a letter with a code.
From here we download the utility for registering our module, put it in / tmp, mark the execution for the owner and start it.
cd /tmp wget http://downloads.digium.com/pub/register/x86-32/register chmod 500 register ./register
You will see a text menu with an invitation to enter:
Digium Product Registration - Version 3.0.5 Copyright (C) 2004-2007, Digium, Inc. Use the '-l' option to see license information for software included in this program. Please select a category 1 - Digium Products 2 - Cepstral Products 0 - Quit Your Choice:
Choose 1, then 9, enter the key that came in the mail, agree and fill in the data.
The module itself is taken
here , select the version for your server, pick up the link below, unpack and put res_fax_digium.so into your $ {ASTMODDIR}. For example, I have
cd /tmp wget http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-11.0/x86-64/res_fax_digium-11.0_1.3.1-generic_64.tar.gz tar -xvf res_fax_digium* cd res_fax_digium* cp res_fax_digium.so /usr/lib/asterisk/modules/
2. Download the files we need and extract them to a temporary directory.
cd /tmp && wget http://faxgui-ari-module.googlecode.com/files/faxgui-ari-module.tar.gz && tar xvf faxgui-ari-module.tar.gz
3. Copy everything to its place and set the rights.
cp faxgui-ari-module/sendfax.module /var/www/recordings/modules/
3. Create a context for outgoing faxes in the /etc/asterisk/extensions_custom.conf.
file /etc/asterisk/extensions_custom.conf.
[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
3. Restart and check.
amportal restart
We go to the User Panel of our server,
ip_aster / recordings , enter under any user, enter the password from the voice mail. The item Send Fax appeared on the left. We check sending.

For the convenience and speed of user training, I noted the algorithm for sending numbers, so much clearer.
That's all, I hope my post has helped someone with setting up a VoIP server.
In the future I plan to regularly describe such small and delicate moments with customization.
When writing the article materials were used:
hiousi.tumblr.com/post/2745684940/a-freepbx-ari-module-to-send-fax-from-the-user-portaltrentdev.blogspot.ru/2013/04/send-fax-using-asteriskfreepbx-with.htmlwww.digium.com/en/products/software/fax-for-asteriskwiki.freepbx.org/display/ST/Faxing+and+T38Small additionNow I set up sending the client according to my manual, I remembered a few more moments.
1. To support PDF install ghostscript package
aptitude install ghostscript
2. Do not forget about options in sip.conf, or in the web interface
t38pt_udptl=yes,redundancy,maxdatagram=400 faxdetect=no
3. When checking, see the license in the CLI
fax show licenses
Do not register multiple keys for 1 box, fraught with further invalidity