[Asterisk-Users] AGI Problem

Cyrille Demaret cyrille at easynet.be
Fri Dec 2 03:12:25 MST 2005


Hi,

I'm running the last CVS asterisk version (I was running an older version
before with the same problem) and I've a problem with agi scripts. Commands
results are not always correct.

I've made a small agi test script that execute ChanIsAvail on an inexistent
extension:

----------------------------------------------------
#!/usr/bin/perl

$|=1;
while(<STDIN>) {
        chomp;
        last unless length($_);
        if (/^agi_(\w+)\:\s+(.*)$/) {
                $AGI{$1} = $2;
        }
}

# Check
print "EXEC ChanIsAvail IAX/24\n";
$result = <STDIN>;
print "VERBOSE \"$result\" 0\n";

# Check
print "EXEC ChanIsAvail IAX/24\n";
$result = <STDIN>;
print "VERBOSE \"$result\" 0\n";

# Check
print "EXEC ChanIsAvail IAX/24\n";
$result = <STDIN>;
print "VERBOSE \"$result\" 0\n";
----------------------------------------------------

Result is :

----------------------------------------------------
   -- Executing DeadAGI("SIP/200-60d2", "b") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/b
    -- AGI Script Executing Application: (ChanIsAvail) Options: (IAX/24)
Dec  2 10:29:37 WARNING[15776]: channel.c:2520 ast_request: No channel type
registered for 'IAX'
  b: 200 result=-1
    -- AGI Script Executing Application: (ChanIsAvail) Options: (IAX/24)
Dec  2 10:29:37 WARNING[15776]: channel.c:2520 ast_request: No channel type
registered for 'IAX'
  b: 200 result=1
    -- AGI Script Executing Application: (ChanIsAvail) Options: (IAX/24)
Dec  2 10:29:37 WARNING[15776]: channel.c:2520 ast_request: No channel type
registered for 'IAX'
  b: 510 Invalid or unknown command
-- AGI Script b completed, returning 0
----------------------------------------------------

The first result is ok (-1) but not the second and the third.

Why do I get different results for the same command?

Thank you,

Regards,

Cyrille




More information about the asterisk-users mailing list