Origintae Command in PHPAGI

Hi ,
I am trying to initiate a call From Asterisk to the Outside World using Originate Command.Basically I want to dial from any available channel on DAHDI trunk 1 DAHDI/g1 to let’s say 9545555555. Once the call connects I want to playout a message on the channel ( using festival ).
I have used console dial 19545555555@Asterisk_Calling and have been successfull in getting the call connected atleast but whenever I have tried directly thru’ telnet 5038 or using PHPAGI I have been unsuccessful. Please advsie.
Here is PHPAGI send_request command for the same:-

$number = trim(‘9546666666’);
$extension = trim(‘19545555555’);
$mycontext = trim(“Asterisk_Calling”);
$call = $asm->send_request(‘Originate’,
array( ‘Channel’ => “DAHDI/g1”,
‘Exten’ => $extension,
‘Context’ => $mycontext,
‘Priority’ => 1,
‘Callerid’ => $number));

Debugging on the asterisk console results in Manager logged on and then the Hangup on DAHDI/2-1.