<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 &lt;<a href="mailto:kamlesh_kmr@hotmail.com">kamlesh_kmr@hotmail.com</a>&gt; 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>&nbsp;<br>I'm using AMI to get the extension status but always get -1 i.e. extension not found.<br>&nbsp;<br>#!/usr/bin/php -q<br>&lt;?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-&gt;request['agi_extension'];<br>$as-&gt;connect("localhost", "user", "passwd");<br>$status = $as-&gt;ExtensionState($exten,'context',1);<br>$status1 = $status['Status'];<br>$agi-&gt;verbose("Extension status is ".$status1);<br>?&gt;<br>&nbsp;<br>Always return Extension status is -1<br>&nbsp;<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> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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> &nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></span></div></blockquote></body></html>