[asterisk-commits] mmichelson: trunk r82866 - in /trunk: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 18 15:10:59 CDT 2007


Author: mmichelson
Date: Tue Sep 18 15:10:59 2007
New Revision: 82866

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82866
Log:
Merged revisions 82865 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82865 | mmichelson | 2007-09-18 15:09:02 -0500 (Tue, 18 Sep 2007) | 4 lines

Moving the logic for handling an empty membername to the create_member function so that there is a common place
where this occurs instead of being spread out to several different places.


........

Modified:
    trunk/   (props changed)
    trunk/apps/app_queue.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=82866&r1=82865&r2=82866
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Tue Sep 18 15:10:59 2007
@@ -722,7 +722,10 @@
 		cur->penalty = penalty;
 		cur->paused = paused;
 		ast_copy_string(cur->interface, interface, sizeof(cur->interface));
-		ast_copy_string(cur->membername, membername, sizeof(cur->membername));
+		if(!ast_strlen_zero(membername))
+			ast_copy_string(cur->membername, membername, sizeof(cur->membername));
+		else
+			ast_copy_string(cur->membername, interface, sizeof(cur->membername));
 		if (!strchr(cur->interface, '/'))
 			ast_log(LOG_WARNING, "No location at interface '%s'\n", interface);
 		cur->status = ast_device_state(interface);
@@ -1237,7 +1240,7 @@
 
 	while ((interface = ast_category_browse(member_config, interface))) {
 		rt_handle_member_record(q, interface,
-			S_OR(ast_variable_retrieve(member_config, interface, "membername"), interface),
+			ast_variable_retrieve(member_config, interface, "membername"),
 			ast_variable_retrieve(member_config, interface, "penalty"),
 			ast_variable_retrieve(member_config, interface, "paused"));
 	}
@@ -3282,7 +3285,7 @@
 	char *queue_name;
 	char *member;
 	char *interface;
-	char *membername;
+	char *membername = NULL;
 	char *penalty_tok;
 	int penalty = 0;
 	char *paused_tok;
@@ -3524,10 +3527,6 @@
 			penalty = 0;
 		}
 	}
-
-	if (ast_strlen_zero(args.membername))
-		args.membername = args.interface;
-
 
 	switch (add_to_queue(args.queuename, args.interface, args.membername, penalty, 0, queue_persistent_members)) {
 	case RES_OKAY:
@@ -4169,8 +4168,7 @@
 						if (!ast_strlen_zero(args.membername)) {
 							membername = args.membername;
 							while (*membername && *membername < 33) membername++;
-						} else
-							membername = interface;
+						}
 
 						/* Find the old position in the list */
 						ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
@@ -4570,9 +4568,6 @@
 	else
 		paused = abs(ast_true(paused_s));
 
-	if (ast_strlen_zero(membername))
-		membername = interface;
-
 	switch (add_to_queue(queuename, interface, membername, penalty, paused, queue_persistent_members)) {
 	case RES_OKAY:
 		ast_queue_log(queuename, "MANAGER", interface, "ADDMEMBER", "%s", "");
@@ -4670,7 +4665,7 @@
 
 static int handle_queue_add_member(int fd, int argc, char *argv[])
 {
-	char *queuename, *interface, *membername;
+	char *queuename, *interface, *membername = NULL;
 	int penalty;
 
 	if ((argc != 6) && (argc != 8) && (argc != 10)) {
@@ -4701,8 +4696,6 @@
 
 	if (argc >= 10) {
 		membername = argv[9];
-	} else {
-		membername = interface;
 	}
 
 	switch (add_to_queue(queuename, interface, membername, penalty, 0, queue_persistent_members)) {




More information about the asterisk-commits mailing list