How to use this function to exec meetme application?


#1

the fellowing code is part of wakeup.php(in /var/lib/asterisk/agi-in/).then how to use this function to use meetme application?
i have tried many times but always failed .help me!
if i want enter room 0000 then how can i write the code?
execute_agi(“meetme(0000)”) is wrong .help me!
//*******************************************
function execute_agi( $command )

{
GLOBAL $stdin, $stdout, $stdlog, $parm_debug_on;

fputs( $stdout, $command . “\n” );
fflush( $stdout );
if ($parm_debug_on)
fputs( $stdlog, $command . “\n” );

$resp = fgets( $stdin, 4096 );

if ($parm_debug_on)
fputs( $stdlog, $resp );

if ( preg_match("/^([0-9]{1,3}) (.)/", $resp, $matches) )
{
if (preg_match(’/result=([-0-9a-zA-Z]
)(.*)/’, $matches[2], $match))
{
$arr[‘code’] = $matches[1];
$arr[‘result’] = $match[1];
if (isset($match[3]) && $match[3])
$arr[‘data’] = $match[3];
return $arr;
}
else
{
if ($parm_debug_on)
fputs( $stdlog, “Couldn’t figure out returned string, Returning code=$matches[1] result=0\n” );
$arr[‘code’] = $matches[1];
$arr[‘result’] = 0;
return $arr;
}
}
else
{
if ($parm_debug_on)
fputs( $stdlog, “Could not process string, Returning -1\n” );
$arr[‘code’] = -1;
$arr[‘result’] = -1;
return $arr;
}
}