[asterisk-commits] russell: branch 1.4 r53035 -
/branches/1.4/apps/app_queue.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Jan 31 10:34:23 MST 2007
Author: russell
Date: Wed Jan 31 11:34:22 2007
New Revision: 53035
URL: http://svn.digium.com/view/asterisk?view=rev&rev=53035
Log:
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)
Modified:
branches/1.4/apps/app_queue.c
Modified: branches/1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=53035&r1=53034&r2=53035
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Wed Jan 31 11:34:22 2007
@@ -921,10 +921,11 @@
}
}
-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 @@
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 @@
/* 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 @@
}
} else {
m->dead = 0; /* Do not delete this one. */
+ m->paused = paused;
m->penalty = penalty;
}
}
@@ -1073,7 +1081,8 @@
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. */
More information about the asterisk-commits
mailing list