AFAIK you need to use different actions for each command.,
sending 3 commands in the same action wont work. I have no
problems to issue commands, originates etc.<br><br><div><span class="gmail_quote">On 12/28/05, <b class="gmail_sendername">Code Lover</b> <<a href="mailto:lateef.np@gmail.com">lateef.np@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br><br>I have a small problem to execute Asterisk Commands in Asterisk<br>Manager using PHP.
<br>I am able to run all Asterisk Manager command but the problem is<br>comming with asterisk command.<br><br>here is the code i am trying to run.<br><br><?php<br> $socket = fsockopen("localhost","5038", $errno, $errstr, $timeout);
<br> fputs($socket, "Action: Login\r\n");<br> fputs($socket, "UserName: 1212\r\n");<br> fputs($socket, "Secret: 1212\r\n\r\n");<br> fputs($socket, "Action: Command\r\n");<br> fputs($socket, "Command: reload\r\n\r\n"); #Working well
<br> fputs($socket, "Command: show channels\r\n\r\n"); #Not working Working well<br> fputs($socket, "Command: 'show channels'\r\n\r\n"); #Not working Working well<br> $wrets=fgets($socket,128);<br><br>
?><br><br><br><br>If you see in my code when i am calling only "reload" command working<br>but when i am trying to call piar command it is just prompting :<br>== Manager '1212' logged off from localhost<br><br>
without showing channels<br><br>Please advice me to solve this problem.<br>--<br>Thank You,<br>Code Lover<br>_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">
Easynews.com</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">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>"Su nombre es GNU/Linux, no solamente Linux, mas info en <a href="http://www.gnu.org">http://www.gnu.org</a>"