[asterisk-commits] jpeeler: trunk r303011 - in /trunk: ./ apps/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 20 11:14:05 CST 2011


Author: jpeeler
Date: Thu Jan 20 11:14:01 2011
New Revision: 303011

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=303011
Log:
Merged revisions 303009 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r303009 | jpeeler | 2011-01-20 11:10:32 -0600 (Thu, 20 Jan 2011) | 21 lines
  
  Merged revisions 303008 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r303008 | jpeeler | 2011-01-20 11:07:44 -0600 (Thu, 20 Jan 2011) | 14 lines
    
    Merged revisions 303007 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r303007 | jpeeler | 2011-01-20 11:04:08 -0600 (Thu, 20 Jan 2011) | 8 lines
      
      Add new queue strategy to preserve behavior for when queue members moved to ao2.
      
      Add queue strategy called "rrordered" to mimic old behavior from when queue
      members were stored in a linked list.
      
      ABE-2707
    ........
  ................
................

Modified:
    trunk/   (props changed)
    trunk/apps/app_queue.c
    trunk/configs/queues.conf.sample

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=303011&r1=303010&r2=303011
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu Jan 20 11:14:01 2011
@@ -680,7 +680,8 @@
 	QUEUE_STRATEGY_RANDOM,
 	QUEUE_STRATEGY_RRMEMORY,
 	QUEUE_STRATEGY_LINEAR,
-	QUEUE_STRATEGY_WRANDOM
+	QUEUE_STRATEGY_WRANDOM,
+	QUEUE_STRATEGY_RRORDERED,
 };
 
 enum {
@@ -708,6 +709,7 @@
 	{ QUEUE_STRATEGY_RRMEMORY, "roundrobin" },
 	{ QUEUE_STRATEGY_LINEAR, "linear" },
 	{ QUEUE_STRATEGY_WRANDOM, "wrandom"},
+	{ QUEUE_STRATEGY_RRORDERED, "rrordered"},
 };
 
 static const struct autopause {
@@ -1538,7 +1540,7 @@
 	q->autopause = QUEUE_AUTOPAUSE_OFF;
 	q->timeoutpriority = TIMEOUT_PRIORITY_APP;
 	if (!q->members) {
-		if (q->strategy == QUEUE_STRATEGY_LINEAR)
+		if (q->strategy == QUEUE_STRATEGY_LINEAR || q->strategy == QUEUE_STRATEGY_RRORDERED)
 			/* linear strategy depends on order, so we have to place all members in a single bucket */
 			q->members = ao2_container_alloc(1, member_hash_fn, member_cmp_fn);
 		else
@@ -3909,6 +3911,7 @@
 		}
 		tmp->metric += mem->penalty * 1000000 * usepenalty;
 		break;
+	case QUEUE_STRATEGY_RRORDERED:
 	case QUEUE_STRATEGY_RRMEMORY:
 		if (pos < q->rrpos) {
 			tmp->metric = 1000 + pos;
@@ -4231,7 +4234,7 @@
 			ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_PARKCALL);
 			break;
 		case 'n':
-			if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_LINEAR)
+			if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_LINEAR || qe->parent->strategy == QUEUE_STRATEGY_RRORDERED)
 				(*tries)++;
 			else
 				*tries = qe->parent->membercount;
@@ -4418,8 +4421,9 @@
 	}
 	ast_channel_unlock(qe->chan);
 	ao2_lock(qe->parent);
-	if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY) {
+	if (qe->parent->strategy == QUEUE_STRATEGY_RRMEMORY || qe->parent->strategy == QUEUE_STRATEGY_RRORDERED) {
 		store_next_rr(qe, outgoing);
+
 	}
 	if (qe->parent->strategy == QUEUE_STRATEGY_LINEAR) {
 		store_next_lin(qe, outgoing);

Modified: trunk/configs/queues.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/queues.conf.sample?view=diff&rev=303011&r1=303010&r2=303011
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Thu Jan 20 11:14:01 2011
@@ -87,6 +87,8 @@
 ; fewestcalls - ring the one with fewest completed calls from this queue
 ; random - ring random interface
 ; rrmemory - round robin with memory, remember where we left off last ring pass
+; rrordered - same as rrmemory, except the queue member order from config file 
+              is preserved
 ; linear - rings interfaces in the order specified in this configuration file.
 ;          If you use dynamic members, the members will be rung in the order in
 ;          which they were added




More information about the asterisk-commits mailing list