[svn-commits] mmichelson: branch 1.4 r81340 - /branches/1.4/apps/app_queue.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 29 10:52:42 CDT 2007


Author: mmichelson
Date: Wed Aug 29 10:52:42 2007
New Revision: 81340

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81340
Log:
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.


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=81340&r1=81339&r2=81340
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Wed Aug 29 10:52:42 2007
@@ -318,6 +318,7 @@
 	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 @@
 	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 @@
 	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 @@
 
 	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 @@
 					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));




More information about the svn-commits mailing list