Re: [Asterisk-Users] PHP Manager
try this ?php $socket = fsockopen(localhost,5038, $errno, $errstr, $timeout); fputs($socket, Action: Login\r\n); fputs($socket, UserName: 1212\r\n); fputs($socket, Secret: 1212\r\n\r\n); fputs($socket, Action: Command\r\n); fputs($socket, Command: reload\r\n\r\n); * fputs($socket, Action: Command\r\n);* fputs($socket, Command: show channels\r\n\r\n); $wrets=fgets($socket,128); ? Code Lover wrote: Hi all, I have a small problem to execute Asterisk Commands in Asterisk Manager using PHP. I am able to run all Asterisk Manager command but the problem is comming with asterisk command. here is the code i am trying to run. ?php $socket = fsockopen(localhost,5038, $errno, $errstr, $timeout); fputs($socket, Action: Login\r\n); fputs($socket, UserName: 1212\r\n); fputs($socket, Secret: 1212\r\n\r\n); fputs($socket, Action: Command\r\n); fputs($socket, Command: reload\r\n\r\n); #Working well fputs($socket, Command: show channels\r\n\r\n); #Not working Working well fputs($socket, Command: 'show channels'\r\n\r\n); #Not working Working well $wrets=fgets($socket,128); ? If you see in my code when i am calling only reload command working but when i am trying to call piar command it is just prompting : == Manager '1212' logged off from localhost without showing channels Please advice me to solve this problem. -- Thank You, Code Lover ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] PHP Manager
Hi all, I have a small problem to execute Asterisk Commands in Asterisk Manager using PHP. I am able to run all Asterisk Manager command but the problem is comming with asterisk command. here is the code i am trying to run. ?php $socket = fsockopen(localhost,5038, $errno, $errstr, $timeout); fputs($socket, Action: Login\r\n); fputs($socket, UserName: 1212\r\n); fputs($socket, Secret: 1212\r\n\r\n); fputs($socket, Action: Command\r\n); fputs($socket, Command: reload\r\n\r\n); #Working well fputs($socket, Command: show channels\r\n\r\n); #Not working Working well fputs($socket, Command: 'show channels'\r\n\r\n); #Not working Working well $wrets=fgets($socket,128); ? If you see in my code when i am calling only reload command working but when i am trying to call piar command it is just prompting : == Manager '1212' logged off from localhost without showing channels Please advice me to solve this problem. -- Thank You, Code Lover ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] PHP Manager
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.On 12/28/05, Code Lover [EMAIL PROTECTED] wrote: Hi all,I have a small problem to execute Asterisk Commands in AsteriskManager using PHP. I am able to run all Asterisk Manager command but the problem iscomming with asterisk command.here is the code i am trying to run.?php $socket = fsockopen(localhost,5038, $errno, $errstr, $timeout); fputs($socket, Action: Login\r\n); fputs($socket, UserName: 1212\r\n); fputs($socket, Secret: 1212\r\n\r\n); fputs($socket, Action: Command\r\n); fputs($socket, Command: reload\r\n\r\n); #Working well fputs($socket, Command: show channels\r\n\r\n); #Not working Working well fputs($socket, Command: 'show channels'\r\n\r\n); #Not working Working well $wrets=fgets($socket,128); ?If you see in my code when i am calling only reload command workingbut when i am trying to call piar command it is just prompting :== Manager '1212' logged off from localhost without showing channelsPlease advice me to solve this problem.--Thank You,Code Lover___--Bandwidth and Colocation provided by Easynews.com --Asterisk-Users mailing listTo UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org ___ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] PHP Manager examples
CW_ASN wrote: Here is my example. I'm using a lot of times a day. ?php $socket = fsockopen(192.168.0.53,5038, $errno, $errstr, $timeout); fputs($socket, Action: Login\r\n); fputs($socket, UserName: admin\r\n); fputs($socket, Secret: blabla\r\n\r\n); fputs($socket, Action: Command\r\n); fputs($socket, Command: reload\r\n\r\n); $wrets=fgets($socket,128); ? Thank you! Added to http://www.voip-info.org/tiki-index.php?page=Asterisk+manager+API /Olle ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] PHP Manager examples
Anyone have any example scripts in PHP that connect to the manager? I'm not really a much of a programmer so I could use boost. Once I can figure out how to get it to login properly, I'll be ok from there. Thanks, Kevin _ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] PHP Manager examples
Kevin Bockman wrote: Anyone have any example scripts in PHP that connect to the manager? I started a PHP * Manager API, modeled on the Perl API, but haven't had a lot of time to work on it. I'll be happy to give you what I do have. -- JustThe.net Internet New Media Services 22674 Motnocab Road * Apple Valley, CA 92307-1950 Steve Sobol, Proprietor 888.480.4NET (4638) * 248.724.4NET * [EMAIL PROTECTED] ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] PHP Manager examples
--- Steve Sobol [EMAIL PROTECTED] wrote: I started a PHP * Manager API, modeled on the Perl API, but haven't had a lot of time to work on it. I'll be happy to give you what I do have. ___ Sure, I'd appreciate that. All I really need to start is to get it to login properly, as I stated. I think I can get the rest. Thanks, Kevin _ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] PHP Manager examples
Here is my example. I'm using a lot of times a day. ?php $socket = fsockopen(192.168.0.53,5038, $errno, $errstr, $timeout); fputs($socket, Action: Login\r\n); fputs($socket, UserName: admin\r\n); fputs($socket, Secret: blabla\r\n\r\n); fputs($socket, Action: Command\r\n); fputs($socket, Command: reload\r\n\r\n); $wrets=fgets($socket,128); ? Regards, Gus - Original Message - From: Kevin Bockman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, November 02, 2003 6:42 PM Subject: [Asterisk-Users] PHP Manager examples Anyone have any example scripts in PHP that connect to the manager? I'm not really a much of a programmer so I could use boost. Once I can figure out how to get it to login properly, I'll be ok from there. Thanks, Kevin _ Are you a Techie? Get Your Free Tech Email Address Now! Visit http://www.TechEmail.com ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users ___ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users