Need Some PHP/AMI Guidance Please

Home » Asterisk Users » Need Some PHP/AMI Guidance Please
Asterisk Users No Comments

Hello all,

I’ve got some PHP code that opens an AMI socket and does a ConfBridgeList for a specific bridge (8888).

This all works just fine but I need to filter the information displayed to only CallerIDName so I can see a complete list of names of participants.

After days of googling and playing with it, I’m no closer than I was when I
started.

I’m not at all married to a table. A simple list of names is fine…

Any help is much appreciated!

Pertinent code:

\n”;

} else {

fwrite($ami, “Action: Login\r\nUsername: someuser\r\nSecret:
somesecret\r\nEvents: off\r\n\r\n”);

fwrite($ami, “Action: ConfbridgeList\r\nConference: 8888\r\n\r\n”);

sleep(1);

$record = fread($ami,1024);

$record = explode(“\r\n”, $record);

echo ““;

echo “

“;

foreach($record as $value){

if(!strlen(stristr($value,’Asterisk’))>0

&& !strlen(stristr($value,’Response’))>0

&& !strlen(stristr($value,’Message’))>0

&& !strlen(stristr($value,’Event’))>0

&& strlen(strpos($value,’ ‘))>0)

php_table($value);;

}

echo “

“;

fclose($ami);

}

function php_table($value){

$row1 = true;

$value = explode(” “, $value);

foreach($value as $field){

if($row1){

echo “

“.$field.”

“;

$row1 = false;

}

else{

echo “

“.$field.”

“;

$row1 = true;

}

}

}

?>

I think the “explode” is where I should be looking but I’m very new to PHP

Thank you!

Pat…