[Home]

Summary:ASTERISK-23242: AGISTATUS returns false statuses for some scripts when using AGI(script.agi)
Reporter:Benjamin Keith Ford (bford)Labels:
Date Opened:2014-01-31 16:40:48.000-0600Date Closed:2014-02-26 13:42:53.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Tests/testsuite
Versions:11.7.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:UbuntuAttachments:
Description:While writing a test for AGI exit statuses, I found that the AGISTATUS variable was returning incorrect statuses when running the waiting.agi and hanging up the channel while the script is being run. The value returned should be HANGUP, but NULL is returned instead.
Comments:By: Kinsey Moore (kmoore) 2014-02-26 11:12:51.798-0600

When I execute these AGI files, I see both returning SUCCESS in the AGISTATUS variable for Asterisk 11 branch and trunk. Did you check to make sure you had the execution bit set in permissions?

What documentation did you use to determine that waiting.agi should have returned HANGUP? Was it the test itself? I'm not that familiar with AGI.

By: Benjamin Keith Ford (bford) 2014-02-26 13:17:33.242-0600

I talked to Matt about the scripts, and waiting.agi should return HANGUP. Updated the description so that it describes the correct error now - donothing.agi is working as intended. This might also be fixed as I work on the test a bit more.

By: Benjamin Keith Ford (bford) 2014-02-26 13:37:15.429-0600

I checked the logs after running the test, hanging up the channel while executing the script, and it does show that AGISTATUS gets set to HANGUP. Checking AGISTATUS in a channel called directly after that channel, though, will return NULL.

By: Kinsey Moore (kmoore) 2014-02-26 13:42:53.991-0600

As discussed, AGISTATUS is a channel variable and not a global variable and so is not available after the channel goes away, even for another channel originated in exactly the same way. This value should be captured using the h extension or hangup handlers (only available in 12+).