[Home]

Summary:ASTERISK-29417: Hangup Handlers reporting incorrect CDR(duration) and CDR(billsec) when added from a Queue Gosub
Reporter:Bill Kervaski (bkervaski)Labels:
Date Opened:2021-05-07 13:34:25Date Closed:2021-05-27 12:00:01
Priority:MinorRegression?
Status:Closed/CompleteComponents:Applications/app_queue
Versions:18.3.0 18.4.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Amazon Linux 2 on AWSAttachments:
Description:After attaching a Hangup Handler via Application Queue's "gosub" option (either in the dialplan or queues.conf) the subroutine incorrectly reports the CDR(duration) of the amount of time the member is dialed and a CDR(billsec) of zero, even if the call is answered, instead of the call duration and billsec.  The channel reports the correct Elapsed Time (core show channel xxx).

I verified the handler is attached to the correct channel.

Using PJSIP, no local channels.

{noformat}
[agent]
exten => NoOp( ${CDR(duration)} ${CDR(billsec)} )
{noformat}

Would result in duration being the time the member was dialed before answering and billsec is always zero.
Comments:By: Asterisk Team (asteriskteam) 2021-05-07 13:34:26.222-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Joshua C. Colp (jcolp) 2021-05-07 13:42:26.417-0500

Is the "endbeforehexten" option enabled in cdr.conf?

By: Bill Kervaski (bkervaski) 2021-05-07 14:02:39.448-0500

No, but I just enabled it and got the same result.  If I answer after say 10 seconds, the duration is 10, billsec is 0, regardless of how long the channel is bridged.

This was working in 16 but not sure if the reason it was working was because we were using local channels with /n for members and now we're just using PJSIP channels.

By: Bill Kervaski (bkervaski) 2021-05-07 14:06:06.954-0500

When I explicitly set endbeforehexten to "no" the duration and billsec values are always 0.  Prior to submitting this it was just commented out in cdr.conf.

By: Joshua C. Colp (jcolp) 2021-05-07 14:13:21.813-0500

It is entirely possible you were relying on behavior that occurred as a result of the Local channel in the mix, can you not test that scenario and see if that was indeed the case?

By: Bill Kervaski (bkervaski) 2021-05-07 14:21:12.614-0500

I did earlier, we've had that in production for many years, it works as expected.

The "Elapsed Time" is correct on the channel dump in the same context that is called from the handler that evaluates CDR(duration) and CDR(billsec).

Shouldn't the channel's call duration and billsec be available on the hangup handler?

By: Joshua C. Colp (jcolp) 2021-05-07 14:43:10.429-0500

Maybe? I don't know the details of CDRs like that. Because of the way they are, it may not yet be terminated and available for some reason. In general though I was doing initial triage of the issue to further refine the report and fill in details. The current triage person will be back on Monday, so they may ask for additional information. As well if accepted there is no time frame on when it would get looked into.

By: Benjamin Keith Ford (bford) 2021-05-10 11:10:43.087-0500

Can you provide your local channel and pjsip setups with corresponding logs showing the full execution of this?

By: Asterisk Team (asteriskteam) 2021-05-27 12:00:01.126-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines