Call recording of a AGI channel AGI->

Hi,

Can any one help me with call recording of a channel to record both parties.

which one should i use of the below

$agi->exec(‘Monitor’, ‘wav,asteriskrecording,m’); or

$agi->exec(‘record’, ‘asteriskcall%d:wav’); or

$agi->record_file(“hello3”, “WAV”, “#”, 10000000, 0, true, 2);

I am getting partial success with the third one but it doesnt record complete phone talk.

please help

Thanks
Anand