[asterisk-commits] twilson: trunk r163873 - /trunk/apps/app_queue.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Dec 12 17:48:26 CST 2008
Author: twilson
Date: Fri Dec 12 17:48:26 2008
New Revision: 163873
URL: http://svn.digium.com/view/asterisk?view=rev&rev=163873
Log:
When using realtime queues, app_queue wasn't updating the strategy if it was changed in the realtime backend. This patch resolves the issue for almost all situations. It is currently not supported to switch to the linear strategy via realtime since the ao2_container for members will have been set to have multiple buckets and therefore the members would be unordered.
(closes issue #14034)
Reported by: cristiandimache
Tested by: otherwiseguy, cristiandimache
Modified:
trunk/apps/app_queue.c
Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=163873&r1=163872&r2=163873
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Fri Dec 12 17:48:26 2008
@@ -1469,8 +1469,26 @@
} else if (!strcasecmp(param, "servicelevel")) {
q->servicelevel= atoi(val);
} else if (!strcasecmp(param, "strategy")) {
- /* We already have set this, no need to do it again */
- return;
+ int strategy;
+
+ /* We are a static queue and already have set this, no need to do it again */
+ if (failunknown) {
+ return;
+ }
+ strategy = strat2int(val);
+ if (strategy < 0) {
+ ast_log(LOG_WARNING, "'%s' isn't a valid strategy for queue '%s', using ringall instead\n",
+ val, q->name);
+ q->strategy = QUEUE_STRATEGY_RINGALL;
+ }
+ if (strategy == q->strategy) {
+ return;
+ }
+ if (strategy == QUEUE_STRATEGY_LINEAR) {
+ ast_log(LOG_WARNING, "Changing to the linear strategy currently requires asterisk to be restarted.\n");
+ return;
+ }
+ q->strategy = strategy;
} else if (!strcasecmp(param, "joinempty")) {
parse_empty_options(val, &q->joinempty);
} else if (!strcasecmp(param, "leavewhenempty")) {
More information about the asterisk-commits
mailing list