[asterisk-users] extension status using AMI

Arstan Jusupov arstanj at gmail.com
Thu May 24 18:34:17 CDT 2012


Why don't you use AMI? There's are phpami project if you google.


Sent from my iPhone

On May 25, 2012, at 1:51 AM, Kamlesh Kumar <kamlesh_kmr at hotmail.com> wrote:

> Hi,
>  
> I'm using AMI to get the extension status but always get -1 i.e. extension not found.
>  
> #!/usr/bin/php -q
> <?php
> include_once ("phpagi-2.14/phpagi.php");
> include_once ("/phpagi-2.14/phpagi-asmanager.php");
> $agi = new AGI();
> $as = new AGI_AsteriskManager();
> $exten = $agi->request['agi_extension'];
> $as->connect("localhost", "user", "passwd");
> $status = $as->ExtensionState($exten,'context',1);
> $status1 = $status['Status'];
> $agi->verbose("Extension status is ".$status1);
> ?>
>  
> Always return Extension status is -1
>  
> Thanks,
> Kamlesh
> 
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120525/d1346184/attachment.htm>


More information about the asterisk-users mailing list