<html><head></head><body bgcolor="#FFFFFF"><div>Why don't you use AMI? There's are phpami project if you google.</div><div><br></div><div><br>Sent from my iPhone</div><div><br>On May 25, 2012, at 1:51 AM, Kamlesh Kumar <<a href="mailto:kamlesh_kmr@hotmail.com">kamlesh_kmr@hotmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
<div dir="ltr">
Hi,<br> <br>I'm using AMI to get the extension status but always get -1 i.e. extension not found.<br> <br>#!/usr/bin/php -q<br><?php<br>include_once ("phpagi-2.14/phpagi.php");<br>include_once ("/phpagi-2.14/phpagi-asmanager.php");<br>$agi = new AGI();<br>$as = new AGI_AsteriskManager();<br>$exten = $agi->request['agi_extension'];<br>$as->connect("localhost", "user", "passwd");<br>$status = $as->ExtensionState($exten,'context',1);<br>$status1 = $status['Status'];<br>$agi->verbose("Extension status is ".$status1);<br>?><br> <br>Always return Extension status is -1<br> <br>Thanks,<br>Kamlesh<br><br>                                            </div>
</div></blockquote><blockquote type="cite"><div><span>--</span><br><span>_____________________________________________________________________</span><br><span>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> --</span><br><span>New to Asterisk? Join us for a live introductory webinar every Thurs:</span><br><span> <a href="http://www.asterisk.org/hello">http://www.asterisk.org/hello</a></span><br><span></span><br><span>asterisk-users mailing list</span><br><span>To UNSUBSCRIBE or update options visit:</span><br><span> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></span></div></blockquote></body></html>