[Asterisk-Users] AGI Channel Status

jerk face jerkface2098 at yahoo.com
Thu Aug 21 09:36:08 MST 2003


>>$status = $AGI->channel_status('Zap/1-1');
I did try to do that, but it doesn't work for some reason.
 
What I did was change $AGI->channel_status('Zap/1-1'); to score($AGI->channel_status('Zap/1-1'));
 
Then I added
sub score{
     my ($returncode) = @_;
     print STDERR "Return code for Zap/1-1 is $returncode\n\n";
}




James Golovich <james at wwnet.net> wrote:


On Thu, 21 Aug 2003, jerk face wrote:

> I'm having some trouble getting the channel status with an AGI script.
> 
> #!/usr/bin/perl
> 
> use Asterisk::AGI;
> $AGI = new Asterisk::AGI;
> 
> my %input = $AGI->ReadParse();
> 
> $AGI->channel_status('Zap/1-1');
> 
> I am now stuck, and don't know how to get the return codes:

Well assuming that you are using version 0.08 of asterisk-perl (because
channel_status previously only worked on the current channel before then),
then all you need to do is:

$status = $AGI->channel_status('Zap/1-1');

and $status will contain the return value

James

_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20030821/d625f9de/attachment.htm


More information about the asterisk-users mailing list