[asterisk-users] Dialplan execution stops on app call even with TryExec (Am I missing something simple?)

Jay Reeder jreeder at voicenation.com
Tue Feb 22 23:00:53 CST 2011


 Figured it out...

1) Incoming SIP immediately routed out a Dahdi PRI trunk is answered
just before it dials the trunk
2) CNG detected after call is bridged
3) Call redirected to fax extension AFTER the bridge is torn down and
the hangup extension is run in the original "Dial" context
4) Fax extension executes and ReceiveFax detects T.38 hangup when fax is
completed
5) pbx WON'T run hangup extension (again) in fax ext. context so no more
dialplan execution after the ReceiveFax (so no fax delivery capabilities)

Not sure about impact but I modified chan_sip.c after CNG is detected
and just before the redirect (to the fax extension) and told it not to
run the hangup extension in the original "Dial" context by setting 
AST_FLAG_BRIDGE_HANGUP_DONT.  This appears to have fixed the issue.

-- Jay

On 2/21/2011 10:47 AM, Jay Reeder wrote:
> 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:
>
> 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=/var/www/html/vncake/fax_temp/${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\" **email address was here**"))
> ; 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]
>
>
>
> 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.
>
> This is running on 1.6.2.17 rc3 ... we upgraded because the same thing
> was happening with 1.6.2.6.
>
> Any help would be appreciated.
>
> Thanks,
>
> Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110223/b4769db2/attachment.htm>


More information about the asterisk-users mailing list