[asterisk-dev] ANSWERED channel chan->cdr->billsec=0 ?

Russell Bryant russell at digium.com
Thu May 4 05:59:01 MST 2006


ast guy wrote:
> Any way how do I access the billsecond variable with correct value
> from channel after call, in my application ?

In Asterisk 1.2, the billsec CDR variable is not calculated until the
CDR is being posted.  However, this has been changed in the trunk so
that it is calculated when the CDR is ended using the ast_cdr_end() API
call.  This lets you access the value in the 'h' extension in the dialplan.

Since you're doing this inside of an application, you can calculate the
value yourself.  Call ast_cdr_end() to end to CDR, then take the
difference between the CDR end time and the CDR answer time.

Russell



More information about the asterisk-dev mailing list