[Asterisk-Users] Grabbing the billsec and duration after a hangup.

Mark Ackroyd mark.ackroyd at cencion.com
Mon Mar 20 02:38:58 MST 2006


 Hello,
 
 I am wondering if someone has got any ideas that can help solve this
 problem.
 
 I have a dial plan that you call into, and depending on certain conditions
 it calls out on a number grabbed from a database.
 
 Something like this :
 
 exten => s,n,Do something
 exten => s,n,Do something else
 exten => s,n,Dial(ZAP/g1/${OUTBOUND},${timeout})
 
 I need to log the time the person was connected to $(OUTBOUND) , these are
 duration and billsec in the CDR's
 
 So at hangup I do something like this.
 
 exten => h,1,DeadAGI(cdr-
 outlogger.php|${CDR(start)}|${OUTBOUND}|${CDR(channel)}|${CDR(duration)}|$
 {CDR(billsec)}|${CDR(disposition)}|${CDR(accountcode)})
 
 Trouble is duration and billsec are *ALWAYS* 0 (zero), as if they have not
 been loaded with the values, even though the channel is hung up.
 
 Anyone got any ideas on how I can access ${CDR(duration)} and
 ${CDR(billsec)} in the hangup extension?
 
 Thanks, hope I explained that well enough.
 
 Mark




More information about the asterisk-users mailing list