[Home]

Summary:ASTERISK-06941: [patch] If a queue has only a paused member i get "No one is answering queue"
Reporter:Peter Holik (peterh)Labels:
Date Opened:2006-05-10 06:26:25Date Closed:2006-05-19 10:41:46
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_queue
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_queue.c.diff
Description:I think this queue should not be joined

--- app_queue.c.orig    2006-05-10 13:20:56.000000000 +0200
+++ app_queue.c 2006-05-10 13:02:36.000000000 +0200
@@ -430,6 +430,8 @@
       enum queue_member_status result = QUEUE_NO_MEMBERS;

       for (member = q->members; member; member = member->next) {
+               if (member->paused) continue;
+
               switch (member->status) {
               case AST_DEVICE_INVALID:
                       /* nothing to do */
Comments:By: Peter Holik (peterh) 2006-05-10 07:00:26

Well maybe it's better to replay in get_member_status with "QUEUE_NO_REACHABLE_MEMBERS"

and set in queues.conf "joinempty=strict"

By: BJ Weschke (bweschke) 2006-05-10 08:50:16

If you're going to set it to QUEUE_NO_REACHABLE_MEMBERS, that's going to change the behavior of app_queue which will require that this be an option instead of changing default behavior.
We could probably justify the original patch you put in the description as a "bug fix".

Do you have a disclaimer on file?

By: Peter Holik (peterh) 2006-05-10 09:08:31

But if an agents is unavailable also "QUEUE_NO_REACHABLE_MEMBERS" is set.


I want that if agents are logged out, paused or an agents was available and
is now unreachable that the caller is directed to somewhere else.

Therefore is set in queue.conf

joinempty=strict
leavewhenempty=strict

I think the status of "agent unavailable" and "agent paused" should be the
same so i decided to return "QUEUE_NO_REACHABLE_MEMBERS"

By: Peter Holik (peterh) 2006-05-10 09:10:39

Here the function in detail:

static enum queue_member_status get_member_status(const struct ast_call_queue *q)
{
       struct member *member;
       enum queue_member_status result = QUEUE_NO_MEMBERS;

       for (member = q->members; member; member = member->next) {
               if (member->paused) {
                       result = QUEUE_NO_REACHABLE_MEMBERS;
                       continue;
               }
               switch (member->status) {
               case AST_DEVICE_INVALID:
                       /* nothing to do */
                       break;
               case AST_DEVICE_UNAVAILABLE:
                       result = QUEUE_NO_REACHABLE_MEMBERS;
                       break;
               default:
                       return QUEUE_NORMAL;
               }
       }

       return result;
}

By: BJ Weschke (bweschke) 2006-05-10 09:17:18

peterh: I can appreciate your needs, but some other people may not want it set like that and may like the current behavior. If we commit your patch, we're not giving them a choice either. If you want your patch to go in, it's got to be an option added to joinempty and leavewhenempty. Since this is a feature change, we're going to need to have a patch that applies against /trunk and will not go into 1.2. The only thing we could put into 1.2 would be to eliminate the msg when it's coming up inappropriately.
Also - if you want your patch to go in, we need for you to get a disclaimer on file with Digium. Thanks.

By: Peter Holik (peterh) 2006-05-10 09:42:19

"strict" for joinempty and leavewhenempty is only used if status is "QUEUE_NO_REACHABLE_MEMBERS".

Why is there not only "QUEUE_NO_MEMBERS" as a status?

my patch breaks not the current behavior.

i think if a function asks for the status of agents in a queue
i want as a result "QUEUE_NO_MEMBERS" if there are no agents or
"QUEUE_NO_REACHABLE_MEMBERS" if there are agents but they are not available.

I only wanted to report a bug.

Beacause i am not a lazy one, i made a patch as suggestion.

i can also live with my first patch.


disclaimer: sorry i have no fax / use this patch as you like

By: Kevin P. Fleming (kpfleming) 2006-05-18 17:21:30

There is no disclaimer required for this change.

I believe that treating 'paused' the same as 'unreachable' in this case makes complete sense. It is a small behavior change, but not an unreasonable one.

By: Joshua C. Colp (jcolp) 2006-05-19 10:41:45

Now in 1.2 and trunk, thanks!