[asterisk-users] how to know status of asterisk from php

virendra bhati virbhati at gmail.com
Thu Apr 28 01:19:38 CDT 2011


Hi,

As per you suggestion I write small php scripts but didn't get result. Below
is the php script and output of programs too.

*PHP Script:-*

<?php
$priline = system('/usr/sbin/asterisk -rnx "pri show spans"',$pri);
$asterisk = system("/etc/init.d/asterisk status", $asterisks);
$mysql = system("/etc/init.d/mysql status",$mysqls);
echo "priline=>".$priline;
echo "<br>";
echo "pri=>".$pri;
echo "<br>";
echo "asterisk=>".$asterisk;
echo "<br>";
echo "asterisks=>".$asterisks;
echo "<br>";
echo "mysql=>".$mysql;
echo "<br>";
echo "mysqls=>".$mysqls;
echo "<br>";
?>

*Output:-*

Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
priline=>Unable to connect to remote asterisk (does /var/run/asterisk.ctl
exist?)
pri=>1
asterisk=>
asterisks=>127
mysql=>
mysqls=>127


On Wed, Apr 27, 2011 at 8:43 PM, Juan David Diaz <juanchonk at gmail.com>wrote:

> Hi:
>
> http://php.net/manual/en/function.system.php
>
> Then, the commands you shoul run:
>
> /usr/sbin/asterisk -rnx"pri show spans"
> /etc/init.d/asterisk status
> /etc/init.d/mysql status
> .
> .
> .
> .
> and so on!!
>
> good luck!
>
> Regards.
>
> Juan.
> Linux User #441131
>
>
> On Wed, Apr 27, 2011 at 6:22 AM, virendra bhati <virbhati at gmail.com>wrote:
>
>> Hi
>>
>> How to know status of Asterisk,Mysql. PRI lines and other services from
>> PHP scripts ?
>>
>> ----
>> Thanks and regards
>>
>>  Virendra Bhati
>> +91-9172341457
>>
>>
>> --
>> _____________________________________________________________________
>> -- 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
>>
>
>
> --
> _____________________________________________________________________
> -- 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
>



-- 



-----
Thanks and regards

 Virendra Bhati
+91-9172341457
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110428/849afb99/attachment.htm>


More information about the asterisk-users mailing list