<div dir="ltr">Hi Ahmed,<br><br><span style="font-size: 11pt; color: rgb(31, 73, 125);">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<br><font style="color: rgb(0, 0, 0);" size="4"><b><br>Yes I was looking for this :)<br></b><font size="2">Please tell me how to close other socket from current sockets.<br>
<br>one more thing in my case it may be possible that <br>root 127.0.0.1 may be more then one then how to close them individually? </font><b><br></b></font></span><br><div class="gmail_quote">On Thu, Aug 25, 2011 at 5:09 PM, Gohar Ahmed <span dir="ltr"><<a href="mailto:gohar.ahmed@vopium.com">gohar.ahmed@vopium.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;"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">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. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p><div><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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>] <b>On Behalf Of </b>Gohar Ahmed<br>
<b>Sent:</b> Thursday, August 25, 2011 4:25 PM<div class="im"><br><b>To:</b> 'Asterisk Users Mailing List - Non-Commercial Discussion'<br></div><div class="im"><b>Subject:</b> Re: [asterisk-users] How to know how many user is connected<u></u><u></u></div>
</span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">What I understood: you need to disconnect the AMI socket.<u></u><u></u></p><div class="im"><p class="MsoNormal">1) I want to disconnect <b>connected manager</b> into Asterisk. Is it possible ? <span style="font-family: Wingdings;">ß</span> Close the $socket after you get the response. <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="margin-bottom: 12pt;">What I understood: you need to maintain the socket until some button is pressed to stop AMI<br>2) I want to maintain this socket connection until we disconnect it from web page. <span style="font-family: Wingdings;">ß</span> 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)<u></u><u></u></p>
<p class="MsoNormal">See php section for other examples.<u></u><u></u></p></div><p class="MsoNormal"><a href="http://www.voip-info.org/wiki/view/Asterisk+manager+Examples" target="_blank">http://www.voip-info.org/wiki/view/Asterisk+manager+Examples</a> <u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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>] <b>On Behalf Of </b>virendra bhati<br>
<b>Sent:</b> Thursday, August 25, 2011 4:02 PM<div class="im"><br><b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br></div><div><div></div><div class="h5"><b>Subject:</b> Re: [asterisk-users] How to know how many user is connected<u></u><u></u></div>
</div></span></p></div><div><div></div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal" style="margin-bottom: 12pt;">Hi List,<br><br>Thanks now I am able to get all values from asterisk CLI but I want 2 more things .<br>
<br>1) I want to disconnect <b>connected manager</b> into Asterisk. Is it possible ?<br>2) I want to maintain this socket connection until we disconnect it from web page.<u></u><u></u></p><div><p class="MsoNormal">On Thu, Aug 25, 2011 at 1:57 PM, virendra bhati <<a href="mailto:virbhati@gmail.com" target="_blank">virbhati@gmail.com</a>> wrote:<u></u><u></u></p>
<div><p class="MsoNormal" style="margin-bottom: 12pt;">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>
<u></u><u></u></p><div><div><div><p class="MsoNormal">On Thu, Aug 25, 2011 at 12:21 PM, DHAVAL INDRODIYA <<a href="mailto:dhaval.it01034@gmail.com" target="_blank">dhaval.it01034@gmail.com</a>> wrote:<u></u><u></u></p>
</div></div><blockquote style="border-width: medium medium medium 1pt; border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color rgb(204, 204, 204); padding: 0in 0in 0in 6pt; margin: 5pt 0in 5pt 4.8pt;">
<div><div><p class="MsoNormal">Hi<br>You can use simple cli command<br>Manager show connected<u></u><u></u></p><div><p class="MsoNormal"><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>
><u></u><u></u></p></div><p class="MsoNormal">> 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.<u></u><u></u></p>
<div><div><p class="MsoNormal"><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> <u></u><u></u></p>
</div></div><p class="MsoNormal"><u></u> <u></u></p></div></div><p class="MsoNormal">--<br>_____________________________________________________________________<u></u><u></u></p><div><p class="MsoNormal"><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><u></u><u></u></p></div></blockquote></div><p class="MsoNormal"><br><br clear="all">
<br>-- <u></u><u></u></p><div><div><p class="MsoNormal"><br><br><br>-----<br>Thanks and regards<br><br> Virendra Bhati<br>+91-9172341457<br>Software Engineer<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p>
</div></div></div><p class="MsoNormal"><br><br clear="all"><br>-- <u></u><u></u></p><div><p class="MsoNormal"><br><br><br>-----<br>Thanks and regards<br><br> Virendra Bhati<br>+91-9172341457<br>Software Engineer<u></u><u></u></p>
</div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></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>