Hi, Is there any way that I can store my manager API output that is: My question is that is there any why using that I can get the QueueStatus and store the result in some text file for further processing. <?php $strHost = "127.0.0.1"; $strUser = "cron"; $strSecret = "1234"; $oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed"); fputs($oSocket, "Action: Login\r\n"); fputs($oSocket, "Username: $strUser\r\n"); fputs($oSocket, "Secret: $strSecret\r\n\r\n"); fputs($oSocket, "Action: QueueStatus\r\n\r\n"); fputs($oSocket, "Action: Logoff\r\n\r\n"); fclose($oSocket); ?> thanks arun -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070505/b8315f56/attachment.htm
Arun Kumar wrote:> Is there any way that I can store my manager API output that is: > My question is that is there any why using that I can get the QueueStatus > and store the result in some text file for further processing. > > <?php > > $strHost = "127.0.0.1"; > $strUser = "cron"; > $strSecret = "1234"; > > $oSocket = fsockopen($strHost, 5038, > $errnum, $errdesc) or die("Connection to host failed"); > > fputs($oSocket, "Action: Login\r\n"); > fputs($oSocket, "Username: $strUser\r\n"); > fputs($oSocket, "Secret: > $strSecret\r\n\r\n"); > fputs($oSocket, "Action: > QueueStatus\r\n\r\n"); > fputs($oSocket, "Action: Logoff\r\n\r\n"); > fclose($oSocket); > > ?>Is this a PHP question? You need to use fread() to get the output from Asterisk. Have a look at http://us.php.net/manual/en/function.fsockopen.php There are many examples. Regards, Philipp -- amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Let's use IT to solve problems and not to create new ones. Asterisk? -> http://www.das-asterisk-buch.de Gesch?ftsf?hrer: Stefan Wintermeyer Handelsregister: Neuwied B 14998
On Sat, 5 May 2007, Arun Kumar wrote:> Hi, > > Is there any way that I can store my manager API output that is:Read The Fine WiKi!!! http://www.voip-info.org/wiki/index.php?page=Asterisk+manager+Example%3A+PHP Gordon