[asterisk-users] How to know how many user is connected

Gohar Ahmed gohar.ahmed at vopium.com
Thu Aug 25 01:26:53 CDT 2011


I'm not a php expert, but seems your php script is incomplete/ you are
sending to socket (fputs) but note receiving anything(fgets) :

See this page
<http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP>  will
help you.

 

 

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of virendra bhati
Sent: Wednesday, August 24, 2011 6:16 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] How to know how many user is connected

 

Hi List,

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

<?php

  $socket = fsockopen("127.0.0.1","5038", $errno, $errstr, 30);
  if (!$socket) 
  {
     $done=0;
  } else {
  fputs($socket, "Action: Login\r\n");
  fputs($socket, "UserName: root\r\n");
  fputs($socket, "Secret: energy\r\n\r\n");
  fputs($socket, "Action: Command\r\n");
  fputs($socket, "Command: manager show connected\r\n");
  $done=1;
  }

?>

Now how to get information into this PHP file....


-----
Thanks and regards

 Virendra Bhati
+91-9172341457
Software Engineer

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110825/dce98043/attachment.htm>


More information about the asterisk-users mailing list