<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
We're having an issue where we call ReceiveFax in a context that
includes a hangup extension and half the time dialplan execution
doesn't continue after the fax is received successfully. Am I
missing something simple here? Below is a sample call where this
happened:<br>
<br>
<pre>The last log line for this channel/call is:
[Feb 21 09:10:53] VERBOSE[13730] res_fax_digium.c: -- Channel 'SIP/Level3_sip_peer_mcqueen-00002c3d' FAX session '228' is complete, result: 'SUCCESS' (FAX_SUCCESS), error: 'NO_ERROR', pages: 8, resolution: '204x196', transfer rate: '9600', remoteSID: 'TIME'
The context it's executing in is:
[ext-fax-voicenation]
exten => s,1,Noop(Receiving Fax for: ${FROM_DID} From: ${CALLERID(all)})
exten => s,n(receivefax),StopPlaytones
exten => s,n,Set(FAX_FILE_NAME=<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>var/www/html/vncake/fax_temp<span class="moz-txt-tag">/</span></i>${FROM_DID}-${CALLERID(number)}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID}.tif)
; Gafachi is known to have a broken ecm implementation - disable on receive - also send with 'z' option
exten => s,n,Set(trunk_name=${CUT(CHANNEL,-,1)})
exten => s,n,Noop(trunk name is ${trunk_name:4})
exten => s,n,ExecIf($[ "${trunk_name:4:7}" = "gafachi"]?Set(FAXOPT(ecm)=no))
;------------------------------
; Level3 V17/V34 modems were unreliable and V17 (14400) wasn't working so we downgrade to slower fax-modems
exten => s,n,Set(FAXOPT(modem)="V27,V29")
;------------------------------
exten => s,n,Set(FAXDELIVERED=no)
exten => s,n,TryExec(ReceiveFAX(${FAX_FILE_NAME},f))
exten => s,n,System(/var/www/html/vncake/cake/console/cake -app /var/www/html/vncake/app email_fax ${FAX_FILE_NAME} ${FAXPAGES} err:${FAXOPT(error)})
exten => s,n,Set(FAXDELIVERED=yes)
exten => s,n,ExecIf($["${FAXOPT(error)}"=""]?Set(FAXSTATUS=FAILED LICENSE EXCEEDED))
exten => s,n,ExecIf($["${FAXOPT(error)}"!="" && "${FAXOPT(error)}"!="NO_ERROR"]?Set(FAXSTATUS="FAILED FAXOPT: error: ${FAXOPT(error)} status: ${FAXOPT(status)} statusstr: ${FAXOPT(statusstr)}"))
exten => s,n,Hangup
exten => h,1,Noop(*** process fax now ***)
exten => h,n,GotoIf($["${FAXDELIVERED}" = "yes"]?end)
; if hangup while processing script above(before flag set =yes) then will jump to hangup and double process - need to pause here so script can make adjustments
exten => h,n,System(/bin/sleep 5)
exten => h,n,System(/var/www/html/vncake/cake/console/cake -app /var/www/html/vncake/app email_fax ${FAX_FILE_NAME} ${FAXPAGES} err:${FAXOPT(error)})
exten => h,n,Set(FAXDELIVERED=yes)
exten => h,n(end),Macro(hangupcall,)
exten => h,process+101(failed),Noop(FAX ${FAXSTATUS} for:${FAX_RX_EMAIL} , From: ${CALLERID(all)})
; email to notify instability in the fax module
exten => h,n,ExecIf($["${FAXOPT(error)}" = "FILE_IO_FAIL"]?System("echo \"** Asterisk Fax FILE_IO_FAIL - will reload. Thank you. Asterisk :)\" | mail -s \"** Asterisk Fax FILE_IO_FAIL\"<a class="moz-txt-link-abbreviated" href="mailto:itinternal@voicenation.com"> **email address was here**</a>"))
; Restart Asterisk if FILE IO FAILURE on fax - indicates instability in fax module
; accomplished by cron job that will restart asterisk as root when this file is found
exten => h,n,ExecIf($["${FAXOPT(error)}" = "FILE_IO_FAIL"]?System("echo \"FAX_IO_FAILURE\" >> /tmp/FAX_IO_FAILURE"))
exten => h,n,Macro(hangupcall,)
; end of [ext-fax]
</pre>
<br>
<br>
<br>
What am I missing here? Half the time we don't get back into the
dialplan from the ReceiveFax even though wrapped in TryExec. Before
wrapping the call in TryExec, I would get a log entry about
ReceiveFax exiting non-zero (after successful fax receipt) and no
other log entry for the call.<br>
<br>
This is running on 1.6.2.17 rc3 ... we upgraded because the same
thing was happening with 1.6.2.6.<br>
<br>
Any help would be appreciated.<br>
<br>
Thanks,<br>
<br>
Jay<br>
</body>
</html>