[Asterisk-Users] AGI Problem

Giovanni Miano giomiano at gmail.com
Fri Dec 2 04:51:45 MST 2005


Try print "EXEC ChanIsAvail IAX2/24\n";

Channel type is IAX2 not IAX

Cheers

2005/12/2, Cyrille Demaret <cyrille at easynet.be>:
> 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
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>


--
Giovanni Miano



More information about the asterisk-users mailing list