Recording cdr to database all calls to a specific extension

Dear all,

I am actually trying to log all calls coming to a specific extension.

Therefor, I would like to use an AGI script that would be launched to write into a database the date and callernumber.

For now I am using this extension :

exten => 2020,1,DeadAGI(astcc-duty.agi)
exten => 2020,2,Queue(${EXTEN}|rt|||1)
exten => 2020,3,Dial(SIP/${EXTEN},,rt)
exten => 2020,4,Hangup()

I tried to recode from astcc.agi but unsuccessfuly.

We already use the original astcc.agi on this server so all dependencies are already installed and working.

Do you know if some kind of existing script could handle with this ?

… or would it be another way to log all calls going to this specific number using a different database than cdr or cdrs ?