[Asterisk-Users] Weird AGI/X100P behavior

James Sharp jsharp at psychoses.org
Fri Apr 11 23:50:31 MST 2003


I've got a single phone line coming into an X100P.

In extensions.conf I've got this:

[inboundzap]
exten => s,1,Answer
exten => s,2,EAgi,hanguptest.agi

I see the ring come in and Asterisk detects it and tries to do something
with it:

NOTICE[20492]: File chan_zap.c, Line 4017 (ss_thread): Got event 2
(Ring/Answered)...
    -- Executing Answer("Zap/1-1", "") in new stack
    -- Executing EAGI("Zap/1-1", "hanguptest.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/hanguptest.agi
Foo:  1
    -- AGI Script hanguptest.agi completed, returning 0
    -- Hungup 'Zap/1-1'
    -- Starting simple switch on 'Zap/1-1'


The line never gets answered, though....unless I use one of the sample AGI
scripts that come with *.

My hanguptest.agi file is pretty simple:

#!/usr/bin/perl

use Asterisk::AGI;
$|=1;
$AGI = new Asterisk::AGI;
%input = $AGI->ReadParse();
$AGI->answer();
$foo = $AGI->wait_for_digit();
print STDERR "Foo:  $foo\n";
$AGI->say_digits('$foo');
$AGI->hangup;


Am I missing something basic about AGI?





More information about the asterisk-users mailing list