Delete fax after sending

There is any option to disable deleting faxes after sending to email?

I do it now with a custom context:

" exten => h,n(delete_opt),Set(DELETE_AFTER_SEND=false)"

I don’t think so (right now). It sounds like a good feature request, though.

Fax pro is the only way to get them to not delete. It’s an option in there

Sorry to resurrect this old thread, but I have a question for psdk, if he is still around :slight_smile:

Regarding the custom context you created, I assume this was created in one of the “_custom.conf" or "_additional.conf” files? Which one, specifically?

Also, once the custom context is created, would I need to do anything further or would the “fax2mail.php” script pickup this option setting automatically?

Thanks! :slight_smile:

Even if he isn’t here, the answer is probably going to be the _custom.conf file, since the _additional.conf files are all managed by FreePBX.

Just in case this is of any help to future readers of this thread, what I ended up doing was copying the following from ‘extensions_additional.conf’:

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,)

and copying it into ‘extensions_override_freepbx.conf’ under ‘[ext-fax]’ (which I added). I then changed ‘DELETE_AFTER_SEND=true’ to ‘DELETE_AFTER_SEND=false’ then reloaded the config.

I probably didn’t have to copy the entirety of that, but I did try copying just the part that had the ‘DELETE_AFTER_SEND’ but that didn’t work.

Anyway, this way works exactly as desired, and now there is a copy of faxes that have come inbound just in case. I have a script that will delete any faxes older than 28 days.

1 Like

You can also do this by purchasing Fax Pro which helps keep the project going

1 Like

I wrote a module that would delete the FAX before sending. Anyone want that code. :slight_smile:

Well, this will finally make faxing secure!

1 Like