[asterisk-bugs] [Asterisk 0012429]: AGISTATUS is not set to the correct value

noreply at bugs.digium.com noreply at bugs.digium.com
Sun Apr 13 12:28:27 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12429 
====================================================================== 
Reported By:                fmueller
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12429
Category:                   Resources/res_agi
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 114091 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             04-12-2008 14:25 CDT
Last Modified:              04-13-2008 12:28 CDT
====================================================================== 
Summary:                    AGISTATUS is not set to the correct value
Description: 
I call this context:

[default]
exten => 69,1,Answer()
exten => 69,2,DeadAGI(deadagi-test.php)
exten => 69,3,NoOp(foo)
exten => 69,4,Hangup()
exten => h,1,NoOp(${AGISTATUS})

The source code for deadagi-test.php is this:

#!/usr/local/bin/php
<?php
sleep(7);
?>

I hangup while the script is sleeping. According to the documentation that
is given by the command 'show application AGI' I expected that the value of
AGISTATUS is  HANGUP but the following line is written to the CLI:

Executing [h at default:1] NoOp("SIP/111-08201fb8", "SUCCESS") in new stack

Doing the same with AGI instead of DeadAGI I get what I expected:
Executing [h at default:1] NoOp("SIP/111-08200328", "HANGUP") in new stack

This is a bug, right?
Back to DeadAGI. I again use the context mentioned at the beginning but
change the source code of deadagi-test.php to this:

#!/usr/local/bin/php
<?php
while (($line = fgets(STDIN)) != "\n") {}
echo("STREAM FILE demo-congrats \"\"\n");
flush(STDOUT);
fgets(STDIN);
?>

When I hangup while the sound file is beeing played back the following is
written to the CLI:

-- AGI Script deadagi-test.php completed, returning -1
-- Executing [h at default:1] NoOp("SIP/111-08191378", "") in new stack

This means that AGISTATUS is not set which is a bug, isn´t it? Also note
the "returning -1". When you change the line
echo("STREAM FILE demo-congrats \"\"\n");
to
echo("GET DATA demo-congrats 5000 1\n");
in the script above and again hangup while the sound file is beeing played
back the following is written to the CLI:

-- AGI Script deadagi-test.php completed, returning 0
-- Executing [h at default:1] NoOp("SIP/111-08191378", "SUCCESS") in new
stack

So this time we have "returning 0" and AGISTATUS set to SUCCESS. I do not
think that the AGISTATUS variable and the number returned (0 or -1) should
depend on what command you use (STREAM FILE or GET DATA). What do you think
about this?
Thank you for your feedback.
====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 04-13-08 12:28  
---------------------------------------------------------------------- 
Correct.  You are NOT supposed to use DeadAGI on a live call.  There are
all sorts of problems that that can cause.  Do not use DeadAGI in an
improper way, and you'll be fine. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-13-08 12:28  Corydon76      Note Added: 0085423                          
======================================================================




More information about the asterisk-bugs mailing list