Manager and PHP

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

Manager and PHP

Postby syvo » Fri Apr 08, 2005 2:57 am

Hi all

With a rather short experience in php, I have been trying to get a page that could show me who's connected to my asterisk server. Here is what I got :
Image

The problem is ... the code is horrible ...

Anyone used php with manager ?
My main concern is how the data is returned by the manager. Any way to get a nice array ?
thanks :)
syvo
Newsterisk
 
Posts: 10
Joined: Thu Dec 21, 2006 10:56 pm

Re: Manager and PHP

Postby mbrooks » Fri Apr 08, 2005 9:14 am

You could create an array from the socket output in php.

It would go something like this example:
<?php

$blah = array();
while (!feof($socket)) {
$wrets = fread($socket, 8192);
array_push($blah,$wrets);
}
?>

You can also push classes onto an array, so you can can make an array of objects.
mbrooks
Oldsterisk
 
Posts: 63
Joined: Thu Dec 21, 2006 10:56 pm


Return to Asterisk Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest