[asterisk-commits] mmichelson: branch 1.4 r95095 - /branches/1.4/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 27 18:16:16 CST 2007


Author: mmichelson
Date: Thu Dec 27 18:16:15 2007
New Revision: 95095

URL: http://svn.digium.com/view/asterisk?view=rev&rev=95095
Log:
I found a bug while browsing the queue code and managed to reproduce it in a small setup.

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.


Modified:
    branches/1.4/apps/app_queue.c

Modified: branches/1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=95095&r1=95094&r2=95095
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Thu Dec 27 18:16:15 2007
@@ -1922,17 +1922,15 @@
 				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);
-		}
-		if (best->chan) /* break out with result = 1 */
-			ret = 1;
+			ret = ring_entry(qe, best, busies);
+		}
 	}
 
 	return ret;




More information about the asterisk-commits mailing list