[asterisk-commits] tilghman: branch 1.4 r273639 - /branches/1.4/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 2 10:46:33 CDT 2010


Author: tilghman
Date: Fri Jul  2 10:46:27 2010
New Revision: 273639

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=273639
Log:
If all members are paused, the wrong status is indicated.

(closes issue #17576)
 Reported by: ramonpeek
 Patches: 
       diff.txt uploaded by ramonpeek (license 266)
 Tested by: ramonpeek

Modified:
    branches/1.4/apps/app_queue.c

Modified: branches/1.4/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=273639&r1=273638&r2=273639
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Fri Jul  2 10:46:27 2010
@@ -574,6 +574,7 @@
 	struct member *member;
 	struct ao2_iterator mem_iter;
 	enum queue_member_status result = QUEUE_NO_MEMBERS;
+	int allpaused = 1;
 
 	ao2_lock(q);
 	mem_iter = ao2_iterator_init(q->members, 0);
@@ -586,6 +587,8 @@
 		if (member->paused) {
 			ao2_ref(member, -1);
 			continue;
+		} else {
+			allpaused = 0;
 		}
 
 		switch (member->status) {
@@ -605,6 +608,10 @@
 	}
 	ao2_iterator_destroy(&mem_iter);
 	ao2_unlock(q);
+
+    if (allpaused) {
+        result = QUEUE_NO_REACHABLE_MEMBERS;
+    }
 	return result;
 }
 




More information about the asterisk-commits mailing list