PIONEERS Faxing with Incredible PBX 2027

I had some references to fax handling in my extensions_custom.conf file. Once I commented those out, the inbound faxing works as expected. That's the only functionality I've actually wanted since for out-faxing, I have a multifunction printer/fax. I prefer to receive a fax in email to dealing with a piece of paper.
Which inbound faxing solution are you using?? We're not seeing this with the Incredible PBX 2027 approach documented above.
 
I think the issue is my own. I usually transfer my extensions_custom.conf file from system to system and this file has morphed year over year as I try things out. I was using the Avantfax solution before but tried Bill Simon's approach and things in the extensions_custom.conf file got in the way. Either solution works now that I got the garbage out of my config file. These are things I had to comment out because any reference to the iaxmodem seemed to override having the native spandsp things kick in with FreePBX.

Code:
#[ext-did-custom]
#exten => fax,1,Noop(Fax detected!)
#exten => fax,2,Goto(custom-fax-iaxmodem,s,1)

#[ext-local](+)
#exten => fax,1,Noop(Fax detected!)
#exten => fax,2,Goto(custom-fax-iaxmodem,s,1)

#[followme-sub](+)
#exten => fax,1,Noop(Fax detected!)
#exten => fax,2,Goto(custom-fax-iaxmodem,s,1)
 
I think the issue is my own. I usually transfer my extensions_custom.conf file from system to system and this file has morphed year over year as I try things out. I was using the Avantfax solution before but tried Bill Simon's approach and things in the extensions_custom.conf file got in the way. Either solution works now that I got the garbage out of my config file. These are things I had to comment out because any reference to the iaxmodem seemed to override having the native spandsp things kick in with FreePBX.

Code:
#[ext-did-custom]
#exten => fax,1,Noop(Fax detected!)
#exten => fax,2,Goto(custom-fax-iaxmodem,s,1)

#[ext-local](+)
#exten => fax,1,Noop(Fax detected!)
#exten => fax,2,Goto(custom-fax-iaxmodem,s,1)

#[followme-sub](+)
#exten => fax,1,Noop(Fax detected!)
#exten => fax,2,Goto(custom-fax-iaxmodem,s,1)
FYI, the only way to comment in dialplan (and most conf files) is with the semi-colon. # actually means other things.
 
Our new update still uses the custom-fax-iaxmodem context. We just changed the contents so we didn't have to modify FreePBX's Fax (HylaFax) Custom Destination, kludgy for sure.
 
Our new update still uses the custom-fax-iaxmodem context. We just changed the contents so we didn't have to modify FreePBX's Fax (HylaFax) Custom Destination, kludgy for sure.
What makes you think FreePBX uses HylaFax?
 
Because that's what they've been using for over 10 years ??
For the incoming fax that is included? This sure doesn't look like HylaFax to me. Looks like ReceiveFax and a script to send to via email/convert to pdf.

Code:
exten => s,1,Macro(user-callerid,)
exten => s,n,Noop(Receiving Fax for: ${FAX_FOR} , From: ${CALLERID(all)})
exten => s,n(receivefax),StopPlaytones
exten => s,n,ReceiveFAX(${ASTSPOOLDIR}/fax/${UNIQUEID}.tif,f)
exten => s,n,ExecIf($["${FAXSTATUS:0:6}"="FAILED" && "${FAXERROR}"!="INIT_ERROR"]?Set(FAXSTATUS="FAILED: error: ${FAXERROR} statusstr: ${FAXOPT(statusstr)}"))
exten => s,n,Hangup

exten => h,1,GotoIf($[${STAT(e,${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)} = 0]?failed)
exten => h,n(delete_opt),Set(DELETE_AFTER_SEND=true)
exten => h,n(process),GotoIf($[ "${FAX_RX_EMAIL_LEN}" = "0" | "${FAX_RX_EMAIL_LEN}" = "" ]?noemail)
exten => h,n(sendfax),System(${AMPBIN}/fax2mail.php --remotestationid "${FAXOPT(remotestationid)}" --user "${FAX_RX_USER}" --dest "${FROM_DID}" --callerid "${BASE64_E$
exten => h,n(end),Macro(hangupcall,)
exten => h,n(noemail),Noop(ERROR: No Email Address to send FAX: status: [${FAXSTATUS}],  From: [${CALLERID(all)}], trying system fax destination)
exten => h,n,GotoIf($[ "${FAX_RX_EMAIL}" = "" ]?delfax)
exten => h,n,System(${AMPBIN}/fax2mail.php --remotestationid "${FAXOPT(remotestationid)}" --sendto "${FAX_RX_EMAIL}" --dest "${FROM_DID}" --callerid "${BASE64_ENCODE($
exten => h,n,Macro(hangupcall,)
exten => h,n(delfax),System(${AMPBIN}/fax2mail.php --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif --delete "${DELETE_AFTER_SEND}")
exten => h,n,Macro(hangupcall,)
exten => h,process+101(failed),Noop(FAX ${FAXSTATUS} for: ${FAX_FOR} , From: ${CALLERID(all)})
exten => h,n,Macro(hangupcall,)


;--== end of [ext-fax] ==--;

With faxpro and being able to send faxes, the Asterisk SendFax application is used:

Code:
[send-fax]
exten => s,1,Noop(Sending fax from ${AMPUSER} to ${TO})
exten => s,n(send),System(${ASTVARLIBDIR}/bin/faxpro_helper.php --faxid="${faxid}" --stationid="${FAXOPT(localstationid)}" --status="In Progress" --channel="${CHANNEL$
exten => s,n,SendFAX(${file},zf)


exten => h,1(failed),System(${ASTVARLIBDIR}/bin/faxpro_helper.php --faxid="${faxid}" --stationid="${FAXOPT(localstationid)}" --status="${FAXOPT(statusstr)}" --action=$


;--== end of [send-fax] ==--;


I've installed non-distro FreePBX systems and never once have I had to install hylafax to have working incoming faxes and fax-to-email.
 
What makes you think FreePBX uses HylaFax?
Let me put it in BIGGER LETTERS for you...

We just changed the contents so we didn't have to modify FreePBX's Fax (HylaFax) Custom Destination, kludgy for sure.
 
Let me put it in BIGGER LETTERS for you...

We just changed the contents so we didn't have to modify FreePBX's Fax (HylaFax) Custom Destination, kludgy for sure.
Uhm FreePBX doesnt use Hylafax. Doesnt matter how big you make the letters.
 
@Samot: We used to use HylaFax. We don't any more. We kept the context names because it simplified installing the new solution. The only thing left of HylaFax is the context name. Get it now??
 
@Samot: We used to use HylaFax. We don't any more. We kept the context names because it simplified installing the new solution. The only thing left of HylaFax is the context name. Get it now??
Ahh, so IncrediblePBX used it not FreePBX. So when I asked why you thought FreePBX used it, the answer is "They don't we added it for IPBX". So yeah, I totally get that IncrediblePBX used HylaFax but that's not what you said. You kept insisting FreePBX does. Which is incorrect.
 
If you have already completed the tutorial to install Incoming Fax Functionality with Incredible PBX 2027, then you're ready to take Outbound Faxing for a spin.

You'll probably need to do this from another server (also configured for Incoming Fax functionality).

For the time being, you'll need a PDF file (single or multiple pages) as your document to be faxed.
Include your own Fax Cover Sheet as first page of the PDF file, if desired.

Step 1: Install GhostScript on your server: apt install ghostscript -y

Step 2: In the /root folder, create a sendfax.call file that looks like this and chmod 777 the file:
Code:
channel: SIP/voipms/18436060444
callerid: "Incredible Fax" <8431234567>
application: SendFax
data: /tmp/sample.tif
setvar: FAXID=20230224
setvar: FAXOPT(ecm)=yes
setvar: FAXOPT(minrate)=2400
setvar: FAXOPT(maxrate)=9600
setvar: FAXOPT(headerinfo)=Fax from Incredible Fax: 843-123-4567
setvar: FAXOPT(localstationid=1-843-123-4567)
archive: Yes
where...
channel is your outbound trunk with the fax number to be dialed
callerid is your trunk's actual CallerID
data is your tiff document converted from the PDF file
FAXID is today's date
headerinfo goes at the top of the faxed page(s)
localstationid is the CallerID of the sending fax number

NOTE: Be sure to specify this CallerID in your Trunk setup or outbound calls will fail.
The following command will list available Trunks that have CallerID correctly set:
Code:
mysql -u root -ppassw0rd asterisk -e "select channelid from trunks where disabled='off' and outcid <> ' '  order by trunkid"

Step 3: In /tmp folder, copy your PDF file to be faxed and name it /tmp/sample.pdf

Step 4: Issue the following commands to convert the PDF file to a TIFF file:
Code:
rm /tmp/sample.tif
gs -o /tmp/sample.tif -sDEVICE=tiffg4 /tmp/sample.pdf
chown asterisk:asterisk /tmp/sample.tif

Step 5: Issue the following commands to send the fax using the Trunk and Destination in first line of Step 2:
Code:
cp -ap /root/sendfax.call /tmp/cf
mv /tmp/cf /var/spool/asterisk/outgoing/

On the receiving Incredible PBX 2027 server, it should answer the call and route the call to
custom-fax-iaxmodem,s,1 for processing and email delivery of the incoming fax.

Once the call completes, you can check the success of the fax transmission on sending server:
Code:
date -d @`cat /var/spool/asterisk/outgoing_done/cf | grep StartRetry | cut -f 2 -d "(" | cut -f 1 -d ")"` \
&& cat /var/spool/asterisk/outgoing_done/cf | grep Status
 
Last edited:
Outbound Faxing Script

We've compressed all of the above steps into an easy-to-use sendfax.sh script. To install and run it:
Code:
cd /root
wget http://incrediblepbx.com/sendfax2027.tar.gz
tar zxvf sendfax2027.tar.gz
rm -f sendfax2027.tar.gz
./sendfax.sh
 
Last edited:

Forum statistics

Threads
26,825
Messages
175,326
Members
20,377
Latest member
fulyalizm
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top