aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-31 17:34:22 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-31 17:34:22 +0000
commit57f12952c1b2d47aefba22aeddd196408ba12de6 (patch)
tree75bfeb122a455359fee472df1292c00817ea7fe8 /apps/app_queue.c
parent5f2d98e5c5f68473eee513093f941e10c00d00f4 (diff)
Instead of always creating a realtime queue member as unpaused, read the
"paused" column and use that value for the paused status of the member. (issue #8949, jmls) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53035 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index d53c717f4..c3eb022f6 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -921,10 +921,11 @@ static void queue_set_param(struct call_queue *q, const char *param, const char
}
}
-static void rt_handle_member_record(struct call_queue *q, char *interface, const char *membername, const char *penalty_str)
+static void rt_handle_member_record(struct call_queue *q, char *interface, const char *membername, const char *penalty_str, const char *paused_str)
{
struct member *m, *prev_m;
int penalty = 0;
+ int paused = 0;
if (penalty_str) {
penalty = atoi(penalty_str);
@@ -932,6 +933,12 @@ static void rt_handle_member_record(struct call_queue *q, char *interface, const
penalty = 0;
}
+ if (paused_str) {
+ paused = atoi(paused_str);
+ if (paused < 0)
+ paused = 0;
+ }
+
/* Find the member, or the place to put a new one. */
for (m = q->members, prev_m = NULL;
m && strcmp(m->interface, interface);
@@ -939,7 +946,7 @@ static void rt_handle_member_record(struct call_queue *q, char *interface, const
/* Create a new one if not found, else update penalty */
if (!m) {
- if ((m = create_queue_member(interface, membername, penalty, 0))) {
+ if ((m = create_queue_member(interface, membername, penalty, paused))) {
m->dead = 0;
add_to_interfaces(interface);
if (prev_m) {
@@ -950,6 +957,7 @@ static void rt_handle_member_record(struct call_queue *q, char *interface, const
}
} else {
m->dead = 0; /* Do not delete this one. */
+ m->paused = paused;
m->penalty = penalty;
}
}
@@ -1073,7 +1081,8 @@ static struct call_queue *find_queue_by_name_rt(const char *queuename, struct as
while ((interface = ast_category_browse(member_config, interface))) {
rt_handle_member_record(q, interface,
S_OR(ast_variable_retrieve(member_config, interface, "membername"), interface),
- ast_variable_retrieve(member_config, interface, "penalty"));
+ ast_variable_retrieve(member_config, interface, "penalty"),
+ ast_variable_retrieve(member_config, interface, "paused"));
}
/* Delete all realtime members that have been deleted in DB. */