<DIV>>>$status = $AGI->channel_status('Zap/1-1');</DIV>
<DIV>I did try to do that, but it doesn't work for some reason.</DIV>
<DIV> </DIV>
<DIV>What I did was change $AGI->channel_status('Zap/1-1'); to score($AGI->channel_status('Zap/1-1'));</DIV>
<DIV> </DIV>
<DIV>Then I added</DIV>
<DIV>sub score{</DIV>
<DIV> my ($returncode) = @_;</DIV>
<DIV> print STDERR "Return code for Zap/1-1 is $returncode\n\n";</DIV>
<DIV>}<BR></DIV>
<DIV><BR><BR><BR><B><I>James Golovich <james@wwnet.net></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR><BR>On Thu, 21 Aug 2003, jerk face wrote:<BR><BR>> I'm having some trouble getting the channel status with an AGI script.<BR>> <BR>> #!/usr/bin/perl<BR>> <BR>> use Asterisk::AGI;<BR>> $AGI = new Asterisk::AGI;<BR>> <BR>> my %input = $AGI->ReadParse();<BR>> <BR>> $AGI->channel_status('Zap/1-1');<BR>> <BR>> I am now stuck, and don't know how to get the return codes:<BR><BR>Well assuming that you are using version 0.08 of asterisk-perl (because<BR>channel_status previously only worked on the current channel before then),<BR>then all you need to do is:<BR><BR>$status = $AGI->channel_status('Zap/1-1');<BR><BR>and $status will contain the return value<BR><BR>James<BR><BR>_______________________________________________<BR>Asterisk-Users mailing
list<BR>Asterisk-Users@lists.digium.com<BR>http://lists.digium.com/mailman/listinfo/asterisk-users</BLOCKQUOTE><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/evt=10469/*http://sitebuilder.yahoo.com">Yahoo! SiteBuilder</a> - Free, easy-to-use web site design software