]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
I found a bug while browsing the queue code and managed to reproduce it in a small...
authorMark Michelson <mmichelson@digium.com>
Fri, 28 Dec 2007 00:16:15 +0000 (00:16 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 28 Dec 2007 00:16:15 +0000 (00:16 +0000)
If a queue uses the ringall strategy, it was possible through unfortunate coincidence for a single member at a given penalty level to
make app_queue think that all members at that penalty level were unavailable and cause the members at the
next penalty level to be rung. With this patch, we will only move to the next penalty level if ALL the members
at a given penalty level are unreachable.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95095 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 159bdda65401b66908a92031ec3a088cdc348421..9c23a816a3dff9f5179fc883799e6e862a69218b 100644 (file)
@@ -1922,17 +1922,15 @@ static int ring_one(struct queue_ent *qe, struct callattempt *outgoing, int *bus
                                if (cur->stillgoing && !cur->chan && cur->metric <= best->metric) {
                                        if (option_debug)
                                                ast_log(LOG_DEBUG, "(Parallel) Trying '%s' with metric %d\n", cur->interface, cur->metric);
-                                       ring_entry(qe, cur, busies);
+                                       ret |= ring_entry(qe, cur, busies);
                                }
                        }
                } else {
                        /* Ring just the best channel */
                        if (option_debug)
                                ast_log(LOG_DEBUG, "Trying '%s' with metric %d\n", best->interface, best->metric);
-                       ring_entry(qe, best, busies);
+                       ret = ring_entry(qe, best, busies);
                }
-               if (best->chan) /* break out with result = 1 */
-                       ret = 1;
        }
 
        return ret;