[Home]

Summary:ASTERISK-29043: app_queue: Leave empty sometimes not recorded as abandoned
Reporter:Kfir Itzhak (mastertheknife)Labels:
Date Opened:2020-08-25 03:22:22Date Closed:2020-09-01 10:08:51
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Applications/app_queue
Versions:16.12.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:CentOS 7Attachments:
Description:Hi,

After upgrading PBXes from Asterisk 13 to Asterisk 16 we began to see a bug. The bug was evident because our callcenter display system relies on the AMI events, such as AgentComplete and QueueCallerAbandon. The QueueCallerLeave event is not used, because its a general event and not an outcome.

The bug was introduced in Asterisk ~15 by this commit:
https://github.com/asterisk/asterisk/commit/045dbcc2d6e6b28645fad2c16843305c50150d5b

That commit tried to fix double EXITEMPTY entries in the queue log, and it did. But, because wait_our_turn() doesn't let queue_exec() double process it anymore, when its handled by wait_our_turn, the call is not recorded as abandoned, and QueueCallerAbandon is not generated.
This seems like an innocent developer error. The leave empty is handled in two different places, and they both write EXITEMPTY to queue log, but only one place recorded it the call as abandoned.

This caused this behavior:
1) If the call is waiting for an available agent (wait_our_turn), and there is no available agent anymore (e.g. last agent went into pause), the call is removed from the queue but its not recorded as abandoned, and thus, QueueCallerAbandon event is not generated.
2) If the call is in the middle of dialing to an agent (queue_exec->try_calling), and while dialing, the agent went on pause, and then rejected the call, the call is removed from the queue and recorded as abandoned, and QueueCallerAbandon event is generated.
Its re-producible but reproducing #2 may take a few attempts.

I have created a patch and tested it successfully.
Comments:By: Asterisk Team (asteriskteam) 2020-08-25 03:22:24.146-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.

By: Kfir Itzhak (mastertheknife) 2020-08-25 03:25:11.587-0500

This patch will fix the issue, tested successfully on Asterisk 16.12:

<inline patch removed>

By: Joshua C. Colp (jcolp) 2020-08-25 04:32:45.372-0500

Please attach patches as files instead of inlining them in comments. Are you able to submit the patch for review after signing the license agreement?

By: Kfir Itzhak (mastertheknife) 2020-08-25 04:39:11.875-0500

Hi Joshua,

At first i didn't know why it didn't let me upload the patch, thats why i added it as a comment.
I have now found the Patch Guidelines and i'm waiting for the license agreement approval. After that, i'll upload the patch according the guidelines.
Thank you.

By: Kfir Itzhak (mastertheknife) 2020-08-26 05:55:33.878-0500

Pushed :-)

By: Friendly Automation (friendly-automation) 2020-09-01 10:08:52.872-0500

Change 14884 merged by Friendly Automation:
app_queue: Fix leave-empty not recording a call as abandoned

[https://gerrit.asterisk.org/c/asterisk/+/14884|https://gerrit.asterisk.org/c/asterisk/+/14884]

By: Friendly Automation (friendly-automation) 2020-09-01 10:14:43.986-0500

Change 14821 merged by Friendly Automation:
app_queue: Fix leave-empty not recording a call as abandoned

[https://gerrit.asterisk.org/c/asterisk/+/14821|https://gerrit.asterisk.org/c/asterisk/+/14821]

By: Friendly Automation (friendly-automation) 2020-09-01 10:15:35.068-0500

Change 14811 merged by Friendly Automation:
app_queue: Fix leave-empty not recording a call as abandoned

[https://gerrit.asterisk.org/c/asterisk/+/14811|https://gerrit.asterisk.org/c/asterisk/+/14811]

By: Friendly Automation (friendly-automation) 2020-09-01 10:16:03.942-0500

Change 14822 merged by Friendly Automation:
app_queue: Fix leave-empty not recording a call as abandoned

[https://gerrit.asterisk.org/c/asterisk/+/14822|https://gerrit.asterisk.org/c/asterisk/+/14822]

By: Friendly Automation (friendly-automation) 2020-09-01 10:49:42.463-0500

Change 14823 merged by Kevin Harwell:
app_queue: Fix leave-empty not recording a call as abandoned

[https://gerrit.asterisk.org/c/asterisk/+/14823|https://gerrit.asterisk.org/c/asterisk/+/14823]