summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2007-08-29 15:57:27 +0000
committerMark Michelson <mmichelson@digium.com>2007-08-29 15:57:27 +0000
commita9bec2f6697028af357ca218b0ecbac72dcfa2d4 (patch)
tree26a1c90fc8fd5b0c31e61fb9d133b57bd6825aec /apps
parent6bdc66e9b0fb6df15e7ac8883b5f8e83c9891c51 (diff)
Merged revisions 81340 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r81340 | mmichelson | 2007-08-29 10:52:42 -0500 (Wed, 29 Aug 2007) | 8 lines This fix creates a more accurate way of detecting whether realtime members were deleted. (closes issue 10541, reported by Alric, patched by me) The REALLY nice things about this patch is that queue members now have a "realtime" field which will be true if the member is a realtime member. This means we can check this value prior to certain processing if it should ONLY be done for realtime members. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index a93147cac..bc1c9c1ee 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -318,6 +318,7 @@ struct member {
int penalty; /*!< Are we a last resort? */
int calls; /*!< Number of calls serviced by this member */
int dynamic; /*!< Are we dynamically added? */
+ int realtime; /*!< Is this member realtime? */
int status; /*!< Status of queue member */
int paused; /*!< Are we paused (not accepting calls)? */
time_t lastcall; /*!< When last successful call was hungup */
@@ -1049,6 +1050,7 @@ static void rt_handle_member_record(struct call_queue *q, char *interface, const
if (!m) {
if ((m = create_queue_member(interface, membername, penalty, paused))) {
m->dead = 0;
+ m->realtime = 1;
add_to_interfaces(interface);
if (prev_m) {
prev_m->next = m;
@@ -1173,10 +1175,10 @@ static struct call_queue *find_queue_by_name_rt(const char *queuename, struct as
queue_set_param(q, tmp_name, v->value, -1, 0);
}
- /* Temporarily set non-dynamic members dead so we can detect deleted ones.
+ /* Temporarily set realtime members dead so we can detect deleted ones.
* Also set the membercount correctly for realtime*/
for (m = q->members; m; m = m->next, q->membercount++) {
- if (!m->dynamic)
+ if (m->realtime)
m->dead = 1;
}
@@ -1278,9 +1280,9 @@ static void update_realtime_members(struct call_queue *q)
ast_mutex_lock(&q->lock);
- /* Temporarily set non-dynamic members dead so we can detect deleted ones.*/
+ /* Temporarily set realtime members dead so we can detect deleted ones.*/
for (m = q->members; m; m = m->next) {
- if (!m->dynamic)
+ if (m->realtime)
m->dead = 1;
}
@@ -4188,8 +4190,9 @@ static int __queues_show(struct mansession *s, int fd, int argc, char **argv)
ast_str_set(&out, 0, " %s", mem->interface);
if (mem->penalty)
ast_str_append(&out, 0, " with penalty %d", mem->penalty);
- ast_str_append(&out, 0, "%s%s (%s)",
+ ast_str_append(&out, 0, "%s%s%s (%s)",
mem->dynamic ? " (dynamic)" : "",
+ mem->realtime ? " (realtime)" : "",
mem->paused ? " (paused)" : "",
devstate2str(mem->status));
if (mem->calls)