Asterisk / FreePBX Anlaog Fax Behind Audiocodes MP112

Home » Asterisk Users » Asterisk / FreePBX Anlaog Fax Behind Audiocodes MP112
Asterisk Users No Comments

Hello,

At the moment we have a Swyx phone server. We would like to switch to a free asterisk PBX.

All phone extensions work as expected except the fax. This is a analog Fax behind a Audiocode MP-112 FXS.

I have create a extension for the MP112. The MP112 can register to asterisk. When I send a Fax to this number I hear a “Modem sound” but no fax is printing.

/etc/asterisk/extensions_additional.conf

exten => 518454,1,Set(__DIRECTION=INBOUND)
exten => 518454,n,Gosub(sub-record-check,s,1(in,${EXTEN},dontcare))
exten => 518454,n,Set(CHANNEL(tonezone)=de)
exten => 518454,n,Set(__FROM_DID=${EXTEN})
exten => 518454,n(did),Set(CDR(did)=${FROM_DID})
exten => 518454,n(callerid),ExecIf($[ “${CALLERID(name)}” = “” ]
?Set(CALLERID(name)=${CALLERID(num)}))
exten => 518454,n,Set(__MOHCLASS=)
exten => 518454,n,Set(__REVERSAL_REJECT=FALSE)
exten =>
518454,n,GotoIf($[“${REVERSAL_REJECT}”!=”TRUE”]?post-reverse-charge)
exten =>
518454,n,GotoIf($[“${CHANNEL(reversecharge)}”=”1”]?macro-hangupcall)
exten => 518454,n(post-reverse-charge),Noop()
exten => 518454,n,Set(__CALLINGNAMEPRES_SV=${CALLERID(name-pres)})
exten => 518454,n,Set(__CALLINGNUMPRES_SV=${CALLERID(num-pres)})
exten => 518454,n,Set(CALLERID(name-pres)=allowed_not_screened)
exten => 518454,n,Set(CALLERID(num-pres)=allowed_not_screened)
exten => 518454,n(did-cid-hook),Noop(CallerID Entry Point)
exten => 518454,n(dest-ext),Goto(ext-fax,84,1)

/etc/asterisk/extensions_additional.conf

[ext-fax]
include => ext-fax-custom exten => 84,1,Set(FAX_FOR=Fax_Analog (84))
exten => 84,n,Noop(Receiving Fax for: ${FAX_FOR}, From: ${CALLERID(all)})
exten => 84,n,Set(FAX_RX_USER=84)
exten => 84,n,Set(FAX_RX_EMAIL_LEN=30)
exten => 84,n(receivefax),Goto(s,receivefax)

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_ENCODE(${CALLERID(all)})}” –file
${ASTSPOOLDIR}/fax/${UNIQUEID}.tif –delete “${DELETE_AFTER_SEND}”)
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(${CALLERID(all)})}” –file
${ASTSPOOLDIR}/fax/${UNIQUEID}.tif –delete “${DELETE_AFTER_SEND}”)
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] ==–;

Why it does fax to2mail?
has someone a fax behind a audiocodes mp and would like to share the config?

best regards