Summary:ASTERISK-12487: Channel var AGISTATUS is not set for many AGI/DeadAGI failure conditions
Reporter:Scott White (smw1218)Labels:
Date Opened:2008-07-30 13:16:33Date Closed:2010-10-14 16:28:39
Versions:Frequency of
Description:Under any network failure for FastAGI (and possibly many other failure conditions) AGI does not set the AGISTATUS channel variable.  This make dial plan recovery code much more difficult. This is trivial to reproduce:

exten => 150,1,Answer()
exten => 150,n,AGI(agi://dummyhost/dummyapp/dummy)
exten => 150,n,NoOp(${AGISTATUS})
exten => 150,n,HangUp()

Since "dummyhost" does not exist, AGI will fail to connect but not set the AGISTATUS to "FAILURE"


The function agi_exec_full in res/res_agi.c does not handle the return value of -1 in its case statement that sets the channel variable.  The launch_netscript function, however, returns -1 in most socket failure cases.  A possible fix is to add -1 to the enum and case statement as a failure condition:

[[[code removed.  Please upload all patches into the file upload area.]]]
Comments:By: Digium Subversion (svnbot) 2008-07-30 13:55:37

Repository: asterisk
Revision: 134480

U   branches/1.4/res/res_agi.c

r134480 | tilghman | 2008-07-30 13:55:36 -0500 (Wed, 30 Jul 2008) | 5 lines

launch_netscript sometimes returns -1, which fails to set AGISTATUS.  Map
failure to -1, so that AGISTATUS is always set.
(closes issue ASTERISK-12487)
Reported by: smw1218