[asterisk-commits] mmichelson: branch mmichelson/queue-state r96863 - /team/mmichelson/queue-sta...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 7 10:26:15 CST 2008
Author: mmichelson
Date: Mon Jan 7 10:26:14 2008
New Revision: 96863
URL: http://svn.digium.com/view/asterisk?view=rev&rev=96863
Log:
Checkin. I've updated some realtime logic to jibe with the new state_change column in the
queue_members table. I have not tested this yet, but will quite soon.
Modified:
team/mmichelson/queue-state/apps/app_queue.c
Modified: team/mmichelson/queue-state/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/mmichelson/queue-state/apps/app_queue.c?view=diff&rev=96863&r1=96862&r2=96863
==============================================================================
--- team/mmichelson/queue-state/apps/app_queue.c (original)
+++ team/mmichelson/queue-state/apps/app_queue.c Mon Jan 7 10:26:14 2008
@@ -1288,7 +1288,7 @@
if ((m = create_queue_member(interface, membername, penalty, paused, state_interface))) {
m->dead = 0;
m->realtime = 1;
- add_to_interfaces(interface);
+ add_to_interfaces(state_interface);
ao2_link(q->members, m);
ao2_ref(m, -1);
m = NULL;
@@ -1298,6 +1298,11 @@
m->dead = 0; /* Do not delete this one. */
if (paused_str)
m->paused = paused;
+ if (strcasecmp(state_interface, m->state_interface)) {
+ remove_from_interfaces(m->state_interface);
+ ast_copy_string(m->state_interface, state_interface, sizeof(m->state_interface));
+ add_to_interfaces(m->state_interface);
+ }
m->penalty = penalty;
ao2_ref(m, -1);
}
@@ -1442,7 +1447,7 @@
ast_variable_retrieve(member_config, interface, "membername"),
ast_variable_retrieve(member_config, interface, "penalty"),
ast_variable_retrieve(member_config, interface, "paused"),
- ast_variable_retrieve(member_config, interface, "state-interface"));
+ ast_variable_retrieve(member_config, interface, "state_interface"));
}
/* Delete all realtime members that have been deleted in DB. */
@@ -1554,7 +1559,7 @@
S_OR(ast_variable_retrieve(member_config, interface, "membername"), interface),
ast_variable_retrieve(member_config, interface, "penalty"),
ast_variable_retrieve(member_config, interface, "paused"),
- ast_variable_retrieve(member_config, interface, "state-interface"));
+ ast_variable_retrieve(member_config, interface, "state_interface"));
}
/* Delete all realtime members that have been deleted in DB. */
@@ -5549,7 +5554,7 @@
case CLI_INIT:
e->command = "queue add member";
e->usage =
- "Usage: queue add member <channel> to <queue> [[[penalty <penalty>] as <membername>] state-interface <interface>]\n";
+ "Usage: queue add member <channel> to <queue> [[[penalty <penalty>] as <membername>] state_interface <interface>]\n";
return NULL;
case CLI_GENERATE:
return complete_queue_add_member(a->line, a->word, a->pos, a->n);
@@ -5563,7 +5568,7 @@
return CLI_SHOWUSAGE;
} else if ((a->argc >= 10) && strcmp(a->argv[8], "as")) {
return CLI_SHOWUSAGE;
- } else if ((a->argc == 12) && strcmp(a->argv[10], "state-interface")) {
+ } else if ((a->argc == 12) && strcmp(a->argv[10], "state_interface")) {
return CLI_SHOWUSAGE;
}
More information about the asterisk-commits
mailing list