[Asterisk-Dev] FastAGI Bug/Problem/Feature Request

Jean-Hugues ROBERT jean_hugues_robert at yahoo.com
Thu Jun 30 00:33:07 MST 2005


So, AGI fallback ?

Assuming that your Fast AGI application would answer the call, I think that 
you can
get by using the dial command in the dial plan.

You could for example 
dial(Local/agi_appli at agi_context&Local/agi_fallback at agi_fallback_ctx)
Then, in extension agi_fallback, wait a little while before answering (to 
let the
agi_appli extension answer first... if it up).

Alternatively, maybe you can:
exten => 1000,1,dial(Local/agi_appli at agi_context)
exten => 1000,2,Noop "Fallback here ?"

There obviously is some overhead associated to these solutions, but it may 
be an
acceptable work around.

I haven't tried it myself, if you do, please let me know if that works for 
you. Thanks.



PS: Maybe /n parameter should be used

At 12:43 16/06/2005 +0100, you wrote:
>Hello all,
>Somebody advised that I should discuss this issue here first before 
>posting a bug/feature request.
>So, FastAGI can be used to perform automatic call-handling with a remote 
>FastAGI server.
>When the FastAGI Server is available (accepting connections), the call is 
>handled, and unless the FastAGI Server specifies otherwise, Asterisk will 
>continue at the next priority in extensions.conf when the FastAGI Server 
>closes the connection.
>However, when the FastAGI server is not available (because it's down, or 
>network issues), Asterisk does *not* simply proceed to the next priority - 
>instead it hangs up the call.
>This means that if you're supplying a service over FastAGI, then when your 
>FastAGI Server is down, Asterisk will hang up on all your callers.
>I'd like to suggest/request that this behaviour be changed so that 
>Asterisk prints out a warning message (indicating that the server could 
>not be found), then proceeds to the next priority in extensions.conf as 
>normal, instead of just hanging up.  This would allow people who are using 
>FastAGI to build contingency plans into extensions.conf in case their AGI 
>server goes down.
>If Asterisk does manage to find the FastAGI server, it can easily be told 
>to skip the next priority (to avoid the contingency).  Here's an example 
>of how one might deploy graceful-fail contingency in this scheme:
>In extensions.conf:
>exten => 1000,1,Answer
>exten => 1000,2,agi(agi://
>; This is the contingency - AGI will skip it when found.
>exten => 1000,3,Goto(contingency, 1)
>; This is where the AGI Server continues.
>exten => 1000,4,Dial(SIP/12345,60,r)
>exten => 1000,5,Hangup
>exten => contingency,1,Playback(we-are-experiencing-technical-difficulties)
>exten => contingency,2,Playback(please-call-us-later)
>exten => contingency,3,Hangup
>In the AGI Processor (code based on JAGIServer/OrderlyCalls):
>//Do some logic and/or CTI stuff
>//Skip the contingency
>String priStr=agi.getAGIProperty("agi_priority");
>int pri=Integer.parseInt(priStr);
>//Close the connection to Asterisk.
>People who do not choose to build in contingency plans would be unaffected 
>by this change, unless the next priority in extensions.conf depends on a 
>successful FastAGI call *and* their FastAGI server is down.
>An alternative method of doing this would be to add an argument to the AGI 
>application command to specify what should happen if the FastAGI server 
>cannot be reached.
>Any thoughts before I make my bug post?
>Oh, and are priorities *always* numbers?
>Many thanks,
>Matt King, M.A. Oxon.
>Managing Director, Orderly Software Ltd.
>Author, JAGIServer, OrderlyCalls and OrderlyQ.
>Asterisk-Dev mailing list
>Asterisk-Dev at lists.digium.com
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev

Web:  http://hdl.handle.net/1030.37/1.1
Phone: +33 (0) 4 92 27 74 17

More information about the asterisk-dev mailing list