Call time

how can i get the call time from an AGI script

I do not know yet how it work with AGI, but I do this:

In file /etc/asterisk/cdr_custom.conf I write
Master.csv => ${CDR(disposition)} = ${CDR(src)} == ${CDR(dst)} === ${CDR(answer)} ==== ${CDR(end)} ===== ${CDR(billsec)}
where “${CDR(billsec)}” is seconds that you need.
Asterisk write all calls in file /var/log/asterisk/cdr-custom/Master.csv
I have a perl script which read this file and show the result on web page.