Custom Fax Inbound Route

hi,
setting up freepbx in an lxc is working fine, so I am trying to get a step further to fit my requirements.
I have several inbound routes, but one especially necessary for fax.
The special requirement: Faxes must not be forwarded by mail, but be stored in the filesystem.

I thought of configuring an inbound route without a real target and handle fax receival by extensions_custom.conf

Would that be possible?

kind regards,
astrakid

Try to modify the context of fax, look my example in extensions_additional.conf

[ext-fax]
exten => 8000,1,Set(FAX_FOR=Fax (8000))
exten => 8000,n,Noop(Receiving Fax for: ${FAX_FOR}, From: ${CALLERID(all)})
exten => 8000,n,Set(FAX_ATTACH_FORMAT=pdf)
exten => 8000,n,Set([email protected])
exten => 8000,n(receivefax),Goto(s,receivefax)

exten => s,1,Macro(user-callerid,)
exten => s,n,Noop(Receiving Fax for: ${FAX_RX_EMAIL} , 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(process),GotoIf($[${LEN(${FAX_RX_EMAIL})} = 0]?noemail)
exten => h,n(delete_opt),Set(DELETE_AFTER_SEND=true)
exten => h,n,System(${ASTVARLIBDIR}/bin/fax2mail.php --to "${FAX_RX_EMAIL}" --dest "${FROM_DID}" --callerid '${STRREPLACE(CALLERID(all),',\\')}' --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif --exten "${FAX_FOR}" --delete "${DELETE_AFTER_SEND}" --attachformat "${FAX_ATTACH_FORMAT}")
exten => h,n(end),Macro(hangupcall,)
exten => h,n(noemail),Noop(ERROR: No Email Address to send FAX: status: [${FAXSTATUS}],  From: [${CALLERID(all)}])
exten => h,n,Macro(hangupcall,)
exten => h,process+101(failed),Noop(FAX ${FAXSTATUS} for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)})
exten => h,n,Macro(hangupcall,)

but changing extensions_additional.conf will be overwritten by freepbx? so I have to use the context [ext-fax-custom] I guess in extensions_custom.conf?
Can I avoid jumping back to the originating context? Or will that force error-messages in freepbx?
kind regards,
astrakid

Use new code in extensions_override_freepbx.conf

1 Like

thanks a lot. in parallel oi read about custom applications which should do the same. i will try both. thanks a lot!