<div dir="ltr">Hi List,<br><br>Thanks for guide me. Yes I know that CLI command , My motive is to get information into Php that's why I am finding the solution. <br><br>Ahmad Sir, You are right I forget to get information back from CLI to Php file. Thanks for provide the help link.I will revert back after testing my code with your guidance <br>
<br><br><div class="gmail_quote">On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA <span dir="ltr"><<a href="mailto:dhaval.it01034@gmail.com">dhaval.it01034@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi<br>You can use simple cli command<br>Manager show connected<div class="im"><br><br>On Thursday, August 25, 2011, James zhu <<a href="mailto:zhulizhong@live.com" target="_blank">zhulizhong@live.com</a>> wrote:<br>
> hi:<br>> please refer this:<br>
> <a href="http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP" target="_blank">http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP</a><br>> and check the manager.conf, make sure the accounts in managers.conf matchs the managers displayed.<br>
><br>> Best regards,<br>> James.zhu<br>> Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards, gateway(fxs/fxo/pri<->SIP).<br>> website: <a href="http://www.voipviews.com" target="_blank">www.voipviews.com</a><br>
><br>
><br>> ________________________________<br>> From: <a href="mailto:gohar.ahmed@vopium.com" target="_blank">gohar.ahmed@vopium.com</a><br>> To: <a href="mailto:asterisk-users@lists.digium.com" target="_blank">asterisk-users@lists.digium.com</a><br>
> Date: Thu, 25 Aug 2011 11:26:53 +0500<br>> Subject: Re: [asterisk-users] How to know how many user is connected<br>><br>> I’m not a php expert, but seems your php script is incomplete/ you are sending to socket (fputs) but note receiving anything(fgets) :<br>
><br></div>> See this page <<a href="http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP" target="_blank">http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP</a>> will help you.<div>
<div></div><div class="h5"><br>><br>> <br>><br>
> <br>><br>> From: <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>] On Behalf Of virendra bhati<br>
> Sent: Wednesday, August 24, 2011 6:16 PM<br>> To: Asterisk Users Mailing List - Non-Commercial Discussion<br>> Subject: [asterisk-users] How to know how many user is connected<br>><br>> <br>><br>> Hi List,<br>
><br>> I want to know how many manager is connected into asterisk server. I have made simple file but I don't have any idea how to get information back from Asterisk CLI<br>><br>> <?php<br>><br>> $socket = fsockopen("127.0.0.1","5038", $errno, $errstr, 30);<br>
> if (!$socket)<br>> {<br>> $done=0;<br>> } else {<br>> fputs($socket, "Action: Login\r\n");<br>> fputs($socket, "UserName: root\r\n");<br>> fputs($socket, "Secret: energy\r\n\r\n");<br>
> fputs($socket, "Action: Command\r\n");<br>> fputs($socket, "Command: manager show connected\r\n");<br>> $done=1;<br>> }<br>><br>> ?><br>><br>> Now how to get information into this PHP file....<br>
><br>> -----<br>> Thanks and regards<br>><br>> Virendra Bhati<br>> +91-9172341457<br>> Software Engineer<br>><br>> <br>><br>> -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> -- New to Asterisk? Join us for a live introductory webinar every Thurs: <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a> asterisk-users mailing list To UNSUBSCRIBE or update options visit: <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
</div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><br><br>
<br>-----<br>Thanks and regards<br><br> Virendra Bhati<br>+91-9172341457<br>Software Engineer<br></div><br>
</div>