I have been unable to capture user hangups with my AGI script. Instead of returning -1 or 0 and ‘hangup’, the script just seems to terminate. I have coded it two ways. In the first way I just made the calls and captured the return value. In the second way I used the Perl Asterisk::AGI module. I get the same behaviour each way. In the code below, it never seems to get to the HandleHangup subrouting. I never see anything come back on STDERR and I don’t get the file created either.
My extensions.conf file is pretty simple with just two real lines. The first calls the agi script using DeadAGI. The second one does a hangup when the script ends.
Here is the script that uses AGI Module.
$|=1; #This makes the output stream rather than buffer
my %AGIVariables; #the hash I store the AGI default variables in
my $MyAGI = new Asterisk::AGI;
send callback reference
print STDERR “Got to handlehangup!!!\n”;
my $now = time;
utime $now, $now, $FlagFile;
Any tips, hints, etc. would be greatly appreciated. Thanks.