[svn-commits] jrose: branch 11 r373318 - in /branches/11: ./ apps/app_queue.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Sep 21 10:31:10 CDT 2012


Author: jrose
Date: Fri Sep 21 10:31:06 2012
New Revision: 373318

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=373318
Log:
app_queue: Make queue reload members and variants of that work

Prior to this patch, 'queue reload members' cli command did not
work at all. This also affects the manager function 'QueueReload'
when supplied with the 'members: yes' field.

(closes issue AST-956)
Reported by: John Bigelow
........

Merged revisions 373298 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 373300 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    branches/11/   (props changed)
    branches/11/apps/app_queue.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: branches/11/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/apps/app_queue.c?view=diff&rev=373318&r1=373317&r2=373318
==============================================================================
--- branches/11/apps/app_queue.c (original)
+++ branches/11/apps/app_queue.c Fri Sep 21 10:31:06 2012
@@ -7783,6 +7783,7 @@
 	}
 	if (member_reload) {
 		ao2_callback(q->members, OBJ_NODATA, mark_member_dead, NULL);
+		q->found = 1;
 	}
 
 	/* On the first pass we just read the parameters of the queue */
@@ -7819,6 +7820,17 @@
 		ao2_unlock(q);
 	}
 	queue_t_unref(q, "Expiring creation reference");
+}
+
+static int remove_members_and_mark_unfound(void *obj, void *arg, int flags)
+{
+	struct call_queue *q = obj;
+	char *queuename = arg;
+	if (!q->realtime && (ast_strlen_zero(queuename) || !strcasecmp(queuename, q->name))) {
+		q->found = 0;
+
+	}
+	return 0;
 }
 
 static int mark_dead_and_unfound(void *obj, void *arg, int flags)
@@ -7861,6 +7873,7 @@
 	char *cat;
 	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 	const int queue_reload = ast_test_flag(mask, QUEUE_RELOAD_PARAMETERS);
+	const int member_reload = ast_test_flag(mask, QUEUE_RELOAD_MEMBER);
 
 	if (!(cfg = ast_config_load("queues.conf", config_flags))) {
 		ast_log(LOG_NOTICE, "No call queueing config file (queues.conf), so no call queues\n");
@@ -7880,6 +7893,10 @@
 	 * with the other queue parameters at all*/
 	if (queue_reload) {
 		ao2_callback(queues, OBJ_NODATA | OBJ_NOLOCK, mark_dead_and_unfound, (char *) queuename);
+	}
+
+	if (member_reload) {
+		ao2_callback(queues, OBJ_NODATA, remove_members_and_mark_unfound, (char *) queuename);
 	}
 
 	/* Chug through config file */




More information about the svn-commits mailing list