After ReceiveFAX()

My dialplan

exten => s,n,ReceiveFAX({FAXDEST}/{FAXFILE},f)
exten => s,n,GotoIf([ {FAXSTATUS} = FAILED ]?hangup:continue)

exten => s,n(hangup),Verbose(Removing tmp file)
exten => s,n,System(rm -f {FAXDEST}/{FAXFILE})
exten => s,n,Hangup

exten => s,n(continue),Verbose(FaxFile moving… {FAXDEST}/{FAXFILE} -> ${FAX_DEST}/)

The dialplan works, if FAXSTATUS is FAILED or SUCCESS, but about 1% of faxes are received and FAXFILE is being generated without an error and can be converted to pdf but dialplan does not continue pass s,n,ReceiveFAX()
I added
exten => h,1,System(test -e {FAXDEST}/{FAXFILE})
exten => h,n,GotoIf(["{SYSTEMSTATUS}" = “SUCCESS”]?continue:hangup)

bellow exten => s…
but without ability to replicate the event I am unable to test if in fact dial plan will execute h extension.
I guess my question is; if dialplan is unable to continue with s extension will it skip reaming s and execute h,1 for the same call?
It would be desired to process the received faxes even if exten s are no longer being executed.

Following approach does not work:

exten => s,n,ReceiveFAX({FAXDEST}/{FAXFILE},f)

exten => h,1,System(test -e {FAXDEST}/{FAXFILE})
exten => h,n,GotoIf(["{SYSTEMSTATUS}" = “SUCCESS”]?continue)

I should also bring it up that this dialplan is in Micro as part of

same => n,Answer()
same => n,Ringing
same => n,Macro(inboundfax)
same => n,NoOp(Done)
same => n,Hangup()

Should I move the dialplan out of Micro?

first of all, in your dial-plan

exten => s,n,GotoIf([ {FAXSTATUS} = FAILED ]?hangup:continue)
exten => s,n,GotoIf([ “${FAXSTATUS}” = “FAILED” ]?hangup:continue)

when fax is hangup, dialpaln can goto extension h.

append my dialplan for fax

;;------------------ Fax ------------------;;
exten => fax,1,Noop(-- Fax Receive --)
same => n,Set(FaxCall=1)
same => n,System(/bin/mkdir /var/spool/asterisk/fax/{STRFTIME({EPOCH},%Y%m%d)})
same => n,Set(FaxFile=/var/spool/asterisk/fax/{STRFTIME({EPOCH},%Y%m%d)}/{CALLERID(num)}_{INEXTEN}XXXX{STRFTIME({EPOCH},%Y%m%d_%H%M%S)}.tiff)
same => n,UserEvent(UserFaxReceive,callerid: {INEXTEN},faxfile: {FaxFile})
same => n,ReceiveFAX(${FaxFile},dfs)

include => FaxResult

exten => h,1,Noop(–Fax Result–)
same => n,GotoIf(["{FaxCall}"!=“1”]?noFax)
same => n,Noop(Channel={CHANNEL},File={FAXOPT(filename)},Pages={FAXOPT(pages)},Rate={FAXOPT(rate)},Resolution={FAXOPT(resolution)}) same => n,Noop(Status={FAXOPT(status)})
same => n,Noop(Message={FAXOPT(statusstr)}) same => n,UserEvent(UserFaxResult,status: {FAXOPT(status)},message: {FAXOPT(statusstr)}) same => n(noFax),Noop(FaxCall={FaxCall})

The loss of the “$”, and that isn’t the only missing one, is the result of failing to mark up the text as preformatted (using the </> button. The OP needs to correct the markup, so that we can see the actual dialplan.

I end up moving dialplan out of MICRO and abandoning FAXSTATUS on inbound in place of testing the fax file:

exten => s,n,ReceiveFAX(${FAXDEST}/${FAXFILE},f)

exten => h,1,Verbose(Fax receipt completed with status: ${FAXSTATUS})
exten => h,n,System(test -e ${FAXDEST}/${FAXFILE})
exten => h,n,GotoIf($["${SYSTEMSTATUS}" = "SUCCESS"]?continue:hangup)

exten => h,n(hangup),Verbose(Removing tmp file)
exten => h,n,System(rm -f ${FAXDEST}/${FAXFILE})
exten => h,n,Hangup

exten => h,n(continue),Verbose(FaxFile moving... ${FAXDEST}/${FAXFILE} -> ${FAX_DEST}/)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.