[Home]

Summary:ASTERISK-24439: Wrong billsec of a new call on an already answered channel
Reporter:Farzan Doroodgar (farzan)Labels:
Date Opened:2014-10-18 16:16:44Date Closed:2014-10-19 21:33:31
Priority:MajorRegression?
Status:Closed/CompleteComponents:CDR/General
Versions:13.0.0-beta1 13.0.0-beta2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 6.5 TE410P Digium Card libss7Attachments:( 0) asterisk13beta2-issue24439.log
Description:*What I want to do:*
Answer an incoming call and Dial another number. When call is finished I need to have the correct conversation time of the newly made call (which is supposed to be stored in $\{CDR(billsec)\}).
*What I am getting:*
Since the channel is answered, the C option in Dial application is only resetting the answer variable of CDR to current time therefore the resulting billsec is equal to duration variable of CDR and is equal to channel seize time not actual call conversation time.
*My dial plan:*
{code}
exten => 333333,1,NoOp(Here I answer the channel and make another call)
   same => n,Answer
   same => n,Dial(DAHDI/g0/123456789,,gC)
   same => n,NoOP(Billsec: ${CDR(billsec) }) // Here billsec is equal to CDR(duration)
{code}

*Note:* If I simply remove Answer CMD from dialplan then billsec variable is showing the correct call time and this makes sense because channel was not answered and CDR(answer) will be assigned as soon as called party answers the channel.

BTW, I was using Asterisk 13.0.0-beta1 until I upgraded to beta2 based on the hints received by asking help from community and SO but unfortunately the problem persists. Also I've used ResetCDR and ForkCDR but those had no effect.
Comments:By: Matt Jordan (mjordan) 2014-10-18 21:49:38.550-0500

We require a complete debug log to help triage the issue. This document will provide instructions on how to collect debugging logs from an Asterisk machine for the purpose of helping bug marshals troubleshoot an issue: https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

Please make sure you have 'cdr set debug on' enabled as well.

By: Farzan Doroodgar (farzan) 2014-10-19 18:03:21.129-0500

CDR duration and billsec of attached logfile both were 24 seconds.

By: Farzan Doroodgar (farzan) 2014-10-19 18:03:58.465-0500

Attached the log file.

By: Matt Jordan (mjordan) 2014-10-19 21:33:31.097-0500

This is not a bug.

The {{billsec}} value represents the time from when the channel was Answered to when the CDR was ended. If you explicitly Answer the channel, that starts the time. The 'C' options does still reset the CDR, however, CDRs reflect what actually happened to the channel - so the fact that the underlying channel is Answered causes the time to be updated immediately to the time when the Dial is started.

As you noted, the solution here is to not Answer the inbound channel.

By: Farzan Doroodgar (farzan) 2014-10-20 02:48:32.968-0500

Thanks for your feedback.

Unfortunately channel needs to be answered because in my complete dialplan I need to interact with users before deciding do make a new call.
So are you suggesting that underlying CDR module is unable to cover scenarios like mine? I guess what users want is important not how CDR is currently working and therefore adding an option for Dial application to have both functionalities would be of great value. Any possibility we would have this feature added to source code with a patch or at least let me know which files need to be touched and I'll take care of the rest for my own good and I'll share the results somewhere on the net for others.

Thanks