aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-29 15:52:42 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-29 15:52:42 +0000
commit47beeb2ede00ca09b75e9d2ed3bece756bd81086 (patch)
treead9172c8bf5b8d40638d29c4cb71dc53d3b3ddcd /apps
parentfc500f13557b87d4f2de37d2255ad7c27cd1ef98 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@81340 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 56ab9fc73..7d0f3a3cd 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 */
@@ -954,6 +955,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;
@@ -1081,10 +1083,10 @@ static struct call_queue *find_queue_by_name_rt(const char *queuename, struct as
if (q->strategy == QUEUE_STRATEGY_ROUNDROBIN)
rr_dep_warning();
- /* 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;
}
@@ -1138,9 +1140,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;
}
@@ -4026,6 +4028,8 @@ static int __queues_show(struct mansession *s, int manager, int fd, int argc, ch
ast_build_string(&max, &max_left, " with penalty %d", mem->penalty);
if (mem->dynamic)
ast_build_string(&max, &max_left, " (dynamic)");
+ if (mem->realtime)
+ ast_build_string(&max, &max_left, " (realtime)");
if (mem->paused)
ast_build_string(&max, &max_left, " (paused)");
ast_build_string(&max, &max_left, " (%s)", devstate2str(mem->status));