[Home]

Summary:ASTERISK-28720: When using realtime queues penaltymemberslimit checks for all members count
Reporter:EDV O-TON (edvoton)Labels:
Date Opened:2020-01-29 02:09:56.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Core/Configuration
Versions:16.7.0 Frequency of
Occurrence
Related
Issues:
Environment:Ubuntu 18.04.3 with all latest patches until 29-01-2020Attachments:
Description:The field penaltymemberslimit in the queue table should only check for valid members and not for all.
Example: We have a queue with a max penalty of 50 and a penaltymemberslimit of 10. For this queue we have some fallback members with a penalty of 60. When there is NO member with a valid penalty of 50 but 10 fallback members with 60 I would expect, that the max penalty would be ignored but it isn't and no one gets a call.
Comments:By: Asterisk Team (asteriskteam) 2020-01-29 02:09:57.106-0600

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.

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: Sean Bright (seanbright) 2020-01-29 07:42:25.339-0600

Do you consider this behavior a "bug" in that {{Queue}} is not behaving as documented, or do you just feel that it is not behaving as you would expect?

By: EDV O-TON (edvoton) 2020-01-30 00:52:11.949-0600

I would consider this as a bug or at least a disfunction. The penaltymemberslimit is intended to be used for avoiding having too few agents ready for a call and suspending the penalty limits but when counting even the in fact not available agents due to penalty limits in many cases there would be no agent to answer.



By: Benjamin Keith Ford (bford) 2020-01-30 12:06:43.577-0600

A couple of thoughts:
# Does the behavior remain the same when NOT using realtime?
# As sort of a follow up to 1, I would assume that the behavior is the same, because this does not sound like a bug to me, but rather a functionality that may be missing from app_queue. If you read the description of {{penaltymemberslimit}} in the queues.conf sample file, it says:
{quote}
A limit can be set to disregard penalty settings when the queue has
too few members.  No penalty will be weighed in if there are only X
or fewer queue members. (default 0)
{quote}
In this case, agents that do not meet the penalty criteria would still be counted towards the total number of queue members, even if they are not considered available, because it is counting the total number and not going by any special rules.

In my opinion, this option should not be changed, but a new option could potentially be added as a fallback mechanism if there is no workaround with current configuration. Does this sound reasonable to you?

By: EDV O-TON (edvoton) 2020-01-31 02:38:34.122-0600

Thank you, a fallback would be fine for us!
But I thought the penaltymemberslimit was used as a fallback itself for having not enough available agents. I read the docs, too but it's not clearly stated which members are being counted. And it seems quite useless having lots of spare agents that won't be used due to penalty limits. And which agents should be activated due to the penaltymemberslimit if not those with higher or lower penalties already being queue members? If you have a workaround with the current config I would be glad to know.

By: Benjamin Keith Ford (bford) 2020-01-31 09:11:03.263-0600

The documentation for app_queue is a little lacking due to how old it is. I can take a look at the code to see how it is actually calculating members for this rule. My guess is, if you have this option set to something like 5, and there are only 2 agents in the queue, then it will ignore the penalty settings. I'll confirm this and see if there's a workaround with current configuration. If not, we can look at other options.

By: EDV O-TON (edvoton) 2020-01-31 13:41:52.324-0600

Thanks for your effort! Have a nice weekend!

By: Benjamin Keith Ford (bford) 2020-02-03 11:08:38.675-0600

After looking at the code, I found this:
{code}
int membercount = ao2_container_count(q->members);
unsigned char usepenalty = (membercount <= q->penaltymemberslimit) ? 0 : 1;
{code}
which means that penaltymemberslimit is checking based off of the total number of members in the queue. Unfortunately, I saw no workaround in {{queues.conf}} or {{queuerules.conf}} for this, which means this would be a feature request. If you program and would like to submit a patch to Gerrit\[1], more information on how to do that can be found here\[2]. It would need to be backwards compatible (i.e. an option that defaults to "off"). If you are not a programmer, there are other ways to potentially get a patch in, including the {{asterisk-dev}} mailing list\[3] or submitting a bug bounty\[4].

\[1]: https://gerrit.asterisk.org/q/status:open
\[2]: https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage
\[3]: https://wiki.asterisk.org/wiki/display/AST/Mailing+Lists
\[4]: https://wiki.asterisk.org/wiki/display/AST/Asterisk+Bug+Bounties

By: EDV O-TON (edvoton) 2020-02-04 01:19:03.226-0600

Thank you again! I am a programmer (mostly c# and some other languages) but my C / C++ experience is about 20 years ago so I will dig through the code to see if I could submit a patch. Otherwise I will make use of the mailing list ;)

By: Benjamin Keith Ford (bford) 2020-02-04 09:41:19.047-0600

Sounds good! The {{app_queue}} code can be fragile since it's so old, so if you have any questions, feel free to ask any of the developers questions on the {{asterisk-dev}} IRC channel[1]. There are plenty of experienced people there that would be happy to help. I'll go ahead and open this ticket up and assign it to you.

[1]: https://wiki.asterisk.org/wiki/display/AST/IRC