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

2011-08-26 Thread Gohar Ahmed
Google linux commands for the purpose.

Not sure about preemptively disconnecting sockets . I think there are
commands like “ss” in linux which you can use. You need to collect info from
AMI and then use combination of linux commands via php directly to
disconnect anyone (if possible). 

 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of virendra bhati
Sent: Thursday, August 25, 2011 6:03 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] How to know how many user is connected

 

Hi Ahmed,

Just realized that maybe you’re talking about disconnecting any other
AMI/manger connected user from another manager connection…hhmmm… I don’t
think so. Check AMI commands from asterisk wiki. If not, you may need system
command in your AMI connection  to close some other socket

Yes I was looking for this :)
Please tell me how to close other socket from current sockets.

one more thing in my case it may be possible that 
root  127.0.0.1 may be more then one then how to close them individually? 

On Thu, Aug 25, 2011 at 5:09 PM, Gohar Ahmed gohar.ah...@vopium.com wrote:

Just realized that maybe you’re talking about disconnecting any other
AMI/manger connected user from another manager connection…hhmmm… I don’t
think so. Check AMI commands from asterisk wiki. If not, you may need system
command in your AMI connection  to close some other socket. 

 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Gohar Ahmed
Sent: Thursday, August 25, 2011 4:25 PM


To: 'Asterisk Users Mailing List - Non-Commercial Discussion'

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

 

What I understood: you need to disconnect the AMI socket.

1) I want to disconnect connected manager into Asterisk. Is it possible ?
ß Close the $socket after you get the response. 

 

What I understood: you need to maintain the socket until some button is
pressed to stop AMI
2) I want to maintain this socket connection until we disconnect it from web
page. ß Close the $socket on particular action from web-page. This one’s
tricky btw maintain a while loop and break loop on a condition toggled by
web-page)

See php section for other examples.

http://www.voip-info.org/wiki/view/Asterisk+manager+Examples 

 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of virendra bhati
Sent: Thursday, August 25, 2011 4:02 PM


To: Asterisk Users Mailing List - Non-Commercial Discussion

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

 

Hi List,

Thanks now I am able to get all values from asterisk CLI but I want 2 more
things .

1) I want to disconnect connected manager into Asterisk. Is it possible ?
2) I want to maintain this socket connection until we disconnect it from web
page.

On Thu, Aug 25, 2011 at 1:57 PM, virendra bhati virbh...@gmail.com wrote:

Hi List,

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. 

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 
  

On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA
dhaval.it01...@gmail.com wrote:

Hi
You can use simple cli command
Manager show connected



On Thursday, August 25, 2011, James zhu zhulizh...@live.com wrote:
 hi:
 please refer this:
 http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
 and check the manager.conf, make sure the accounts in managers.conf matchs
the managers displayed.

 Best regards,
 James.zhu
 Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards,
gateway(fxs/fxo/pri-SIP).
 website: www.voipviews.com


 
 From: gohar.ah...@vopium.com
 To: asterisk-users@lists.digium.com
 Date: Thu, 25 Aug 2011 11:26:53 +0500
 Subject: Re: [asterisk-users] How to know how many user is connected

 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-boun...@lists.digium.com
[mailto:asterisk-users-boun...@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

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

2011-08-25 Thread Gohar Ahmed
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-boun...@lists.digium.com
[mailto:asterisk-users-boun...@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

 

--
_
-- 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

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

2011-08-25 Thread James zhu

hi:
please refer this:
http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
and check the manager.conf, make sure the accounts in managers.conf matchs the 
managers displayed.

Best regards,
James.zhu
Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards, gateway(fxs/fxo/pri-SIP).
website: www.voipviews.com 


From: gohar.ah...@vopium.com
To: asterisk-users@lists.digium.com
Date: Thu, 25 Aug 2011 11:26:53 +0500
Subject: Re: [asterisk-users] How to know how many user is connected



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 will help 
you.  From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@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 
--
_
-- 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

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

2011-08-25 Thread DHAVAL INDRODIYA
Hi
You can use simple cli command
Manager show connected

On Thursday, August 25, 2011, James zhu zhulizh...@live.com wrote:
 hi:
 please refer this:
 http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
 and check the manager.conf, make sure the accounts in managers.conf matchs
the managers displayed.

 Best regards,
 James.zhu
 Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards,
gateway(fxs/fxo/pri-SIP).
 website: www.voipviews.com


 
 From: gohar.ah...@vopium.com
 To: asterisk-users@lists.digium.com
 Date: Thu, 25 Aug 2011 11:26:53 +0500
 Subject: Re: [asterisk-users] How to know how many user is connected

 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-boun...@lists.digium.com [mailto:
asterisk-users-boun...@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



 -- _
-- 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

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

2011-08-25 Thread virendra bhati
Hi List,

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.

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


On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA dhaval.it01...@gmail.com
 wrote:

 Hi
 You can use simple cli command
 Manager show connected


 On Thursday, August 25, 2011, James zhu zhulizh...@live.com wrote:
  hi:
  please refer this:
  http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
  and check the manager.conf, make sure the accounts in managers.conf
 matchs the managers displayed.
 
  Best regards,
  James.zhu
  Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards,
 gateway(fxs/fxo/pri-SIP).
  website: www.voipviews.com
 
 
  
  From: gohar.ah...@vopium.com
  To: asterisk-users@lists.digium.com
  Date: Thu, 25 Aug 2011 11:26:53 +0500
  Subject: Re: [asterisk-users] How to know how many user is connected
 
  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-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@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
 
 
 
  -- _
 -- 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
Software Engineer
--
_
-- 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

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

2011-08-25 Thread virendra bhati
Hi List,

Thanks now I am able to get all values from asterisk CLI but I want 2 more
things .

1) I want to disconnect *connected manager* into Asterisk. Is it possible ?
2) I want to maintain this socket connection until we disconnect it from web
page.


On Thu, Aug 25, 2011 at 1:57 PM, virendra bhati virbh...@gmail.com wrote:

 Hi List,

 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.

 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


 On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA 
 dhaval.it01...@gmail.com wrote:

 Hi
 You can use simple cli command
 Manager show connected


 On Thursday, August 25, 2011, James zhu zhulizh...@live.com wrote:
  hi:
  please refer this:
  http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
  and check the manager.conf, make sure the accounts in managers.conf
 matchs the managers displayed.
 
  Best regards,
  James.zhu
  Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards,
 gateway(fxs/fxo/pri-SIP).
  website: www.voipviews.com
 
 
  
  From: gohar.ah...@vopium.com
  To: asterisk-users@lists.digium.com
  Date: Thu, 25 Aug 2011 11:26:53 +0500
  Subject: Re: [asterisk-users] How to know how many user is connected
 
  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-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@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
 
 
 
  -- _
 -- 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
 Software Engineer




-- 



-
Thanks and regards

 Virendra Bhati
+91-9172341457
Software Engineer
--
_
-- 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

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

2011-08-25 Thread Gohar Ahmed
What I understood: you need to disconnect the AMI socket.

1) I want to disconnect connected manager into Asterisk. Is it possible ?
ß Close the $socket after you get the response. 

 

What I understood: you need to maintain the socket until some button is
pressed to stop AMI
2) I want to maintain this socket connection until we disconnect it from web
page. ß Close the $socket on particular action from web-page. This one’s
tricky btw maintain a while loop and break loop on a condition toggled by
web-page)



See php section for other examples.

http://www.voip-info.org/wiki/view/Asterisk+manager+Examples 

 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of virendra bhati
Sent: Thursday, August 25, 2011 4:02 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] How to know how many user is connected

 

Hi List,

Thanks now I am able to get all values from asterisk CLI but I want 2 more
things .

1) I want to disconnect connected manager into Asterisk. Is it possible ?
2) I want to maintain this socket connection until we disconnect it from web
page.



On Thu, Aug 25, 2011 at 1:57 PM, virendra bhati virbh...@gmail.com wrote:

Hi List,

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. 

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 
  

On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA
dhaval.it01...@gmail.com wrote:

Hi
You can use simple cli command
Manager show connected



On Thursday, August 25, 2011, James zhu zhulizh...@live.com wrote:
 hi:
 please refer this:
 http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
 and check the manager.conf, make sure the accounts in managers.conf matchs
the managers displayed.

 Best regards,
 James.zhu
 Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards,
gateway(fxs/fxo/pri-SIP).
 website: www.voipviews.com


 
 From: gohar.ah...@vopium.com
 To: asterisk-users@lists.digium.com
 Date: Thu, 25 Aug 2011 11:26:53 +0500
 Subject: Re: [asterisk-users] How to know how many user is connected

 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-boun...@lists.digium.com
[mailto:asterisk-users-boun...@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

  

 -- _
-- 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
Software Engineer

 




-- 




-
Thanks and regards

 Virendra Bhati
+91-9172341457
Software Engineer

 

--
_
-- 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

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

2011-08-25 Thread Gohar Ahmed
Just realized that maybe you’re talking about disconnecting any other
AMI/manger connected user from another manager connection…hhmmm… I don’t
think so. Check AMI commands from asterisk wiki. If not, you may need system
command in your AMI connection  to close some other socket. 

 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Gohar Ahmed
Sent: Thursday, August 25, 2011 4:25 PM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] How to know how many user is connected

 

What I understood: you need to disconnect the AMI socket.

1) I want to disconnect connected manager into Asterisk. Is it possible ?
ß Close the $socket after you get the response. 

 

What I understood: you need to maintain the socket until some button is
pressed to stop AMI
2) I want to maintain this socket connection until we disconnect it from web
page. ß Close the $socket on particular action from web-page. This one’s
tricky btw maintain a while loop and break loop on a condition toggled by
web-page)

See php section for other examples.

http://www.voip-info.org/wiki/view/Asterisk+manager+Examples 

 

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of virendra bhati
Sent: Thursday, August 25, 2011 4:02 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] How to know how many user is connected

 

Hi List,

Thanks now I am able to get all values from asterisk CLI but I want 2 more
things .

1) I want to disconnect connected manager into Asterisk. Is it possible ?
2) I want to maintain this socket connection until we disconnect it from web
page.

On Thu, Aug 25, 2011 at 1:57 PM, virendra bhati virbh...@gmail.com wrote:

Hi List,

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. 

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 
  

On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA
dhaval.it01...@gmail.com wrote:

Hi
You can use simple cli command
Manager show connected



On Thursday, August 25, 2011, James zhu zhulizh...@live.com wrote:
 hi:
 please refer this:
 http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
 and check the manager.conf, make sure the accounts in managers.conf matchs
the managers displayed.

 Best regards,
 James.zhu
 Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards,
gateway(fxs/fxo/pri-SIP).
 website: www.voipviews.com


 
 From: gohar.ah...@vopium.com
 To: asterisk-users@lists.digium.com
 Date: Thu, 25 Aug 2011 11:26:53 +0500
 Subject: Re: [asterisk-users] How to know how many user is connected

 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-boun...@lists.digium.com
[mailto:asterisk-users-boun...@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

  

 -- _
-- 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
Software Engineer

 




-- 




-
Thanks and regards

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

2011-08-25 Thread virendra bhati
Hi Ahmed,

Just realized that maybe you’re talking about disconnecting any other
AMI/manger connected user from another manager connection…hhmmm… I don’t
think so. Check AMI commands from asterisk wiki. If not, you may need system
command in your AMI connection  to close some other socket
*
Yes I was looking for this :)
*Please tell me how to close other socket from current sockets.

one more thing in my case it may be possible that
root  127.0.0.1 may be more then one then how to close them individually? *
*
On Thu, Aug 25, 2011 at 5:09 PM, Gohar Ahmed gohar.ah...@vopium.com wrote:

 Just realized that maybe you’re talking about disconnecting any other
 AMI/manger connected user from another manager connection…hhmmm… I don’t
 think so. Check AMI commands from asterisk wiki. If not, you may need system
 command in your AMI connection  to close some other socket. 

 ** **

 ** **

 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Gohar Ahmed
 *Sent:* Thursday, August 25, 2011 4:25 PM

 *To:* 'Asterisk Users Mailing List - Non-Commercial Discussion'
 *Subject:* Re: [asterisk-users] How to know how many user is connected

 ** **

 What I understood: you need to disconnect the AMI socket.

 1) I want to disconnect *connected manager* into Asterisk. Is it possible
 ?ß Close the $socket after you get the response. 

 ** **

 What I understood: you need to maintain the socket until some button is
 pressed to stop AMI
 2) I want to maintain this socket connection until we disconnect it from
 web page. ß Close the $socket on particular action from web-page. This
 one’s tricky btw maintain a while loop and break loop on a condition toggled
 by web-page)

 See php section for other examples.

 http://www.voip-info.org/wiki/view/Asterisk+manager+Examples 

 ** **

 ** **

 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *virendra bhati
 *Sent:* Thursday, August 25, 2011 4:02 PM

 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] How to know how many user is connected

 ** **

 Hi List,

 Thanks now I am able to get all values from asterisk CLI but I want 2 more
 things .

 1) I want to disconnect *connected manager* into Asterisk. Is it possible
 ?
 2) I want to maintain this socket connection until we disconnect it from
 web page.

 On Thu, Aug 25, 2011 at 1:57 PM, virendra bhati virbh...@gmail.com
 wrote:

 Hi List,

 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.

 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
   

 On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA 
 dhaval.it01...@gmail.com wrote:

 Hi
 You can use simple cli command
 Manager show connected



 On Thursday, August 25, 2011, James zhu zhulizh...@live.com wrote:
  hi:
  please refer this:
  http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+PHP
  and check the manager.conf, make sure the accounts in managers.conf
 matchs the managers displayed.
 
  Best regards,
  James.zhu
  Doing asterisk/PRI/ss7/dahdi, linux, asterisk cards,
 gateway(fxs/fxo/pri-SIP).
  website: www.voipviews.com
 
 
  
  From: gohar.ah...@vopium.com
  To: asterisk-users@lists.digium.com
  Date: Thu, 25 Aug 2011 11:26:53 +0500
  Subject: Re: [asterisk-users] How to know how many user is connected
 
  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-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@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