CDR userfield - set to timestamp at END of call?

hi all,

I’m wanting to have the start and end timestamps for each call logged in our CDR database. The reason, in case you are wondering is so that we can determine (easily) a time between calls for our agents (to see who is jacking around).

I have tried a few variations on this (beginning of macro deleted for length)

exten => s,n,Dial(${ARG1},${ARG3},L(99999999:99999999:30000)) exten => s,n,Voicemail(u${ARG2}) exten => s,n,Hangup exten => h,1,Set(CDR(userfield)=${TIMESTAMP})
and

exten => s,n,Dial(${ARG1},${ARG3},L(99999999:99999999:30000)) exten => s,n,Voicemail(u${ARG2}) exten => s,n,Set(CDR(userfield)=${TIMESTAMP}) exten => s,n,Hangup

I know that I can run a query with cron to add the duration field to the calldate field, but it would be nice to do this within asterisk if possible.

Any takers?

there is (postgres) uniqueid varchar(32) NOT NULL default ‘’ in database, this will be primary key to know where to write timestamp
(info taken from voip-info.org/wiki/view/Asterisk+cdr+odbc)
from dialplan take ${UNIQUEID}: Current call unique identifier
(info taken from voip-info.org/wiki/view/Asterisk+variables)
befor Dial() take id set(UNIQ=${UNIQUEID}) and after dial
h,1,system(CDRwriteTSTAMP.sh ${TIMESTAMP} ${UNIQ})
script should insert into cdr (userfield) values ($1) where uniqueid=$2
i woult try do it this way, i didn’t test it
-FD

any success ?

got in a bad car accident on thurs night, just getting back to work now…i actually had forgotten about this thread until just now.

i’ll probably just do an external mysql script at this point, i don’t have the energy to do much more…