[Home]

Summary:ASTERISK-11870: AGISTATUS is set to SUCCESS although the agi program returns not 0
Reporter:Fabian Mueller (fmueller)Labels:
Date Opened:2008-04-17 07:48:18Date Closed:2011-06-07 14:08:01
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I have this context:

[default]
exten => 69,1,Answer()
exten => 69,2,AGI(exit-status)
exten => 69,3,Noop(${AGISTATUS})
exten => 69,4,Hangup()

The source for the application "exit-status" is this:

#include <stdlib.h>
int main(void)
{
       exit(-1);
}

The documentation in UPGRADE.txt says:

If an AGI script exits with a non-zero exit code, the AGISTATUS variable will be set to "FAILURE" as opposed to "SUCCESS".

The problem is that AGISTATUS is set to SUCCESS as you can see in the following verbose output:

*CLI>     -- Executing [69@default:1] Answer("SIP/111-08202838", "") in new stack
   -- Executing [69@default:2] AGI("SIP/111-08202838", "exit-status") in new stack
   -- Launched AGI Script /var/lib/asterisk/agi-bin/exit-status
   -- AGI Script exit-status completed, returning 0
   -- Executing [69@default:3] NoOp("SIP/111-08202838", "SUCCESS") in new stack
   -- Executing [69@default:4] Hangup("SIP/111-08202838", "") in new stack
 == Spawn extension (default, 69, 4) exited non-zero on 'SIP/111-08202838'

Thanks for your feedback.
Comments:By: Tilghman Lesher (tilghman) 2008-04-17 10:28:40

Please try SVN 114195

By: Fabian Mueller (fmueller) 2008-04-17 13:58:56

It works in 114195.