Recording problem

Hi all,
I am working on Asterisk and tried to record using the AGI command RECORD FILE. I am coding in C by recording after dialling (using EXEC DIAL and then RECORD FILE AGI commands). But only a file in the name is created but no voice is being recorded. Is there any other configurations to be set for recording? I would like to know how could this be done. Will the conversation of both the caller and callee recorded in the same file? Could anybody help me out. Thanks in advance.