aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-13 00:08:17 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-13 00:08:17 +0000
commit9a208fa4defbfa7ce0bd3c3d583de21fafbf44cb (patch)
tree0b836a4c9f7f8612eea9146c1d7df52a33a7d0d8 /apps/app_queue.c
parente5d3ab1b3cb035b61a00853739f2b12c004fdcff (diff)
Merged revisions 163873 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r163873 | twilson | 2008-12-12 17:48:26 -0600 (Fri, 12 Dec 2008) | 6 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.1@163875 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-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 0934e8ca0..c10f85b44 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1263,8 +1263,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")) {
if (!strcasecmp(val, "loose"))
q->joinempty = QUEUE_EMPTY_LOOSE;