Php agi script

Hi All,
I am working on asterisk 1.4.4 and php-agi-2.14
I am using AGI (PHP) for making call and collecting statistics of the call like… dialstatus, answered time…etc…

I am getting the below output on the conlose…

AGI Rx << EXEC Dial SIP/102|10
– AGI Script Executing Application: (Dial) Options: (SIP/102|10)
– Called 102
– SIP/102-0a074e00 is ringing
– Call on SIP/102-0a074e00 left from hold
– SIP/102-0a074e00 answered SIP/101-0a06e4b0
AGI Tx >> 200 result=-1

AGI Rx << GET VARIABLE DIALSTATUS
AGI Tx >> 200 result=1 (ANSWER)

AGI Rx << VERBOSE “GET VARIABLE DIALSTATUS returned -1” 1
makecall.php: GET VARIABLE DIALSTATUS returned -1
AGI Tx >> 200 result=1

AGI Rx << GET VARIABLE ANSWEREDTIME
AGI Tx >> 200 result=1 (7)

– AGI Script makecall.php completed, returning 0
== Auto fallthrough, channel 'SIP/101-0a06e4b0’
status is ‘ANSWER’

But in my log i am getting blank values… like
dial status Array
(

[code] => 200
[result] => -1
[data] =>
)
data:
answered time Array
(

[code] => 200
[result] => 1
[data] =>
)
data:

And my AGI script is

#!/usr/local/bin/php -q

<? require('phpagi-2.14/phpagi.php'); $stdlog = fopen('my_agi.log', 'w'); $agi = new AGI(); $status = $agi->exec_dial("SIP","102","10"); $dialstatus = $agi->get_variable("DIALSTATUS"); // execute the command GET VARIABLE DIALSTATUS fputs($stdlog,"dial status ".print_r($dialstatus,true)); //put the result in the log fputs($stdlog,"data: ".$dialstatus['data']); $answeredtime = $agi->get_variable("ANSWEREDTIME"); // execute the command GET VARIABLE ANSWEREDTIME fputs($stdlog,"\nanswered time ".print_r($answeredtime,true)); // put the result in the log fputs($stdlog, "data: ".$answeredtime['data']); fclose($stdlog); ?>

Please can anybody help … Sad

Thanks in advance…

Regards,
Santhosh