Woops. The documentation problem was my fault. I was basing that on a patched version of asterisk that jumped to another priority on FastAGI failure. I'll update the wiki.<br><br>Sean<br><br><div><span class="gmail_quote">
On 5/17/07, <b class="gmail_sendername">Tony Mountifield</b> <<a href="mailto:tony@softins.clara.co.uk">tony@softins.clara.co.uk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In article <<a href="mailto:464C8977.4020501@datatrakpos.com">464C8977.4020501@datatrakpos.com</a>>,<br>Lee Jenkins <<a href="mailto:lee@datatrakpos.com">lee@datatrakpos.com</a>> wrote:<br>><br>> Running
1.2.14<br>><br>> When I call a FastAGI script such as this script for an incoming call:<br>><br>> [calldirect]<br>> exten=>s,1,Answer()<br>> exten=>s,2,AGI(agi://192.168.1.175/calldirect?check&${CALLERID(num)})
<br>> exten=>s,3,Goto(check_time,s,1)<br>><br>> and the FastAGI server is not running (Asterisk gets "connection<br>> refused" TCP error), Asterisk just terminates the call like so:<br>><br>> May 17 12:58:00 WARNING[10154]: res_agi.c:210 launch_netscript: Connect
<br>> to 'agi://192.168.1.175/calldirect?check&NNNNNNNNNN' failed: Connection<br>> refused<br>> == Spawn extension (remove_caller, s, 2) exited non-zero on<br>> 'SIP/datatrak-0978b670'<br>
><br>> The text of the relevant wiki article<br>> (<a href="http://www.voip-info.org/wiki-Asterisk+FastAGI">http://www.voip-info.org/wiki-Asterisk+FastAGI</a>) infers that execution<br>> should roll through to the next executable line in the context where it
<br>> was called in the case of an error in executing the FastAGI:<br>><br>> "Asterisk 1.2<br>> Under Asterisk 1.2, if a request to a FastAGI service failed for any<br>> reason, there was no way to determine this from the dialplan. The
<br>> recommended action is to set a channel variable before calling the<br>> FastAGI, setting that variable to a known value within the FastAGI, and<br>> then checking that variable once the AGI has returned..."
<br>><br>> Is there a setting/var that I am missing?<br><br>No, the information is wrong. You need to make a small mod to res/res_agi.c<br>in order to trap this case. Look for the second occurrence of<br>LOCAL_USER_REMOVE, and add the lines just before it as show by this
<br>patch extract (ignore the line numbers; I have other mods too):<br><br>@@ -2065,6 +2106,9 @@<br> close(fds[1]);<br> if (efd > -1)<br> close(efd);<br>+ } else {
<br>+ pbx_builtin_setvar_helper(chan, "AGISTATUS", "NOTFOUND");<br>+ res = 0;<br> }<br> LOCAL_USER_REMOVE(u);<br> return res;<br><br>With this change, a refused connection will not hang up the channel, but
<br>instead will set the AGISTATUS variable to "NOTFOUND".<br><br>Cheers<br>Tony<br>--<br>Tony Mountifield<br>Work: <a href="mailto:tony@softins.co.uk">tony@softins.co.uk</a> - <a href="http://www.softins.co.uk">
http://www.softins.co.uk</a><br>Play: <a href="mailto:tony@mountifield.org">tony@mountifield.org</a> - <a href="http://tony.mountifield.org">http://tony.mountifield.org</a><br>_______________________________________________
<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>