steve@daviesfam.org
2006-Feb-10 03:19 UTC
[Asterisk-Users] Obtaining billsecs in the dialplan after a call?
Hi, I'm stuck on a silly thing. I need to get the "billsec" CDR value after a call. But I'm finding its always 0. Here's my test code: exten => *244*,1,Dial(Local/test@custom-tests/n,,g) exten => *244*,n,Noop(after dial duration is ${CDR(duration)} billsec is ${CDR(billsec)}) exten => *244*,n,Hangup [custom-tests] exten => test,1,Answer exten => test,n,Playback(tt-somethingwrong) exten => test,n,Hangup The actual CDR record that gets posted in Master.csv looks like so: "","200","*244*","default","""Exten 200"" <200>","SIP/200-94dd","Local/test@custom-tests-0255,1","Hangup","","2006-02-10 11:57:42","2006-02-10 11:57:42","2006-02-10 11:57:45",3,3,"ANSWERED","DOCUMENTATION" So the duration is there just fine. But ${CDR(billsec)} remains stubbonly 0. Now I don't really understand the CDR code 100% - but it looks like billsec is only worked out then the cdr is posted. But there is no way to force the cdr to be posted from the dialplan, is there? Thanks, Steve
Olivier Perrin
2006-Feb-10 04:32 UTC
[Asterisk-Users] Obtaining billsecs in the dialplan after a call?
Hi, You can use the ANSWEREDTIME variable : exten => *244*,n,Noop(after dial duration is ${ANSWEREDTIME}) Regards, Olivier ------------------------------------- http://www.olivier-perrin.net Le vendredi 10 f?vrier 2006 ? 12:19 +0200, steve@daviesfam.org a ?crit :> Hi, > > I'm stuck on a silly thing. I need to get the "billsec" CDR value after a > call. But I'm finding its always 0. > > Here's my test code: > > exten => *244*,1,Dial(Local/test@custom-tests/n,,g) > exten => *244*,n,Noop(after dial duration is ${CDR(duration)} billsec is > ${CDR(billsec)}) > exten => *244*,n,Hangup > > [custom-tests] > > exten => test,1,Answer > exten => test,n,Playback(tt-somethingwrong) > exten => test,n,Hangup > > > > The actual CDR record that gets posted in Master.csv looks like so: > > "","200","*244*","default","""Exten 200"" <200>","SIP/200-94dd","Local/test@custom-tests-0255,1","Hangup","","2006-02-10 > 11:57:42","2006-02-10 11:57:42","2006-02-10 11:57:45",3,3,"ANSWERED","DOCUMENTATION" > > So the duration is there just fine. But ${CDR(billsec)} remains stubbonly > 0. > > Now I don't really understand the CDR code 100% - but it looks like > billsec is only worked out then the cdr is posted. But there is no way to > force the cdr to be posted from the dialplan, is there? > > Thanks, > Steve > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Simone Cittadini
2006-Feb-13 05:53 UTC
[Asterisk-Users] Obtaining billsecs in the dialplan after a call?
steve@daviesfam.org ha scritto:>Hi, > >I'm stuck on a silly thing. I need to get the "billsec" CDR value after a >call. But I'm finding its always 0. > >Here's my test code: > >exten => *244*,1,Dial(Local/test@custom-tests/n,,g) >exten => *244*,n,Noop(after dial duration is ${CDR(duration)} billsec is >${CDR(billsec)}) >exten => *244*,n,Hangup > >[custom-tests] > >exten => test,1,Answer >exten => test,n,Playback(tt-somethingwrong) >exten => test,n,Hangup > > > >The actual CDR record that gets posted in Master.csv looks like so: > >"","200","*244*","default","""Exten 200"" <200>","SIP/200-94dd","Local/test@custom-tests-0255,1","Hangup","","2006-02-10 >11:57:42","2006-02-10 11:57:42","2006-02-10 11:57:45",3,3,"ANSWERED","DOCUMENTATION" > >So the duration is there just fine. But ${CDR(billsec)} remains stubbonly >0. > >Now I don't really understand the CDR code 100% - but it looks like >billsec is only worked out then the cdr is posted. But there is no way to >force the cdr to be posted from the dialplan, is there? > > >You have to read that variable after the hangup, use the h extension and / or ResetCDR([options]) Causes the Call Data Record to be reset, optionally storing the current CDR before zeroing it out (if 'w' option is specifed). A CDR record *will* be stored for any activity following this command. using h is cleaner in my opinion