summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2008-12-12 23:48:26 +0000
committerTerry Wilson <twilson@digium.com>2008-12-12 23:48:26 +0000
commit74de8fdaa7e785ff3937ef17a7973381d3f5e201 (patch)
treeed6626becf010f242807d2a849f6e15dd19cd39a /apps
parentbabd4e6876c01360f67a0b5b2d2453999648f96b (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index fe039f750..1863acdaa 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1469,8 +1469,26 @@ static void queue_set_param(struct call_queue *q, const char *param, const char
} 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")) {