[asterisk-commits] mmichelson: branch 1.6.0 r179222 - /branches/1.6.0/apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 1 16:07:14 CST 2009


Author: mmichelson
Date: Sun Mar  1 16:07:09 2009
New Revision: 179222

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179222
Log:
Add error checking when updating the "paused" field of a realtime queue member.

This code already existed in trunk and 1.6.1, but was not in 1.6.0 prior to
this commit.


(closes issue #14338)
Reported by: fiddur
Patches:
      14338.patch uploaded by mmichelson (license 60)
Tested by: fiddur


Modified:
    branches/1.6.0/apps/app_queue.c

Modified: branches/1.6.0/apps/app_queue.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.0/apps/app_queue.c?view=diff&rev=179222&r1=179221&r2=179222
==============================================================================
--- branches/1.6.0/apps/app_queue.c (original)
+++ branches/1.6.0/apps/app_queue.c Sun Mar  1 16:07:09 2009
@@ -4131,6 +4131,7 @@
 	struct call_queue *q;
 	struct member *mem;
 	struct ao2_iterator queue_iter;
+	int failed;
 
 	/* Special event for when all queues are paused - individual events still generated */
 	/* XXX In all other cases, we use the membername, but since this affects all queues, we cannot */
@@ -4146,13 +4147,23 @@
 				if (mem->paused == paused) {
 					ast_debug(1, "%spausing already-%spaused queue member %s:%s\n", (paused ? "" : "un"), (paused ? "" : "un"), q->name, interface);
 				}
+				
+				failed = 0;
+				if (mem->realtime) {
+					failed = update_realtime_member_field(mem, q->name, "paused", paused ? "1" : "0");
+				}
+
+				if (failed) {
+					ast_log(LOG_WARNING, "Failed %spausing realtime queue member %s:%s\n", (paused ? "" : "un"), q->name, interface);
+					ao2_ref(mem, -1);
+					ao2_unlock(q);
+					continue;
+				}
+
 				mem->paused = paused;
 
 				if (queue_persistent_members)
 					dump_queue_members(q);
-
-				if (mem->realtime)
-					update_realtime_member_field(mem, q->name, "paused", paused ? "1" : "0");
 
 				ast_queue_log(q->name, "NONE", mem->membername, (paused ? "PAUSE" : "UNPAUSE"), "%s", S_OR(reason, ""));
 				




More information about the asterisk-commits mailing list