Asterisk Call recording: capture the agent information when a call is answered

Hello guys!

I posted this kind of question so many times, Still I could get the right answer.

I need to capture the agent information when a call is answered(Inbound calls , His/her user ID or agent ID) .

Currently, I am getting only Outbound calls call recording including agent’s information.

The DumpChan() application is helpful for seeing what variables are set in your dial plan at a particular moment. You might find a useful value there that you could then use as part of the fname_base argument in your Monitor() application calls.