[asterisk-users] Manager API Output

Philipp Kempgen philipp.kempgen at amooma.de
Sat May 5 06:16:29 MST 2007


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


More information about the asterisk-users mailing list