[asterisk-commits] irroot: branch irroot/distrotech-customers-1.8 r341528 - /team/irroot/distrot...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 20 05:49:01 CDT 2011


Author: irroot
Date: Thu Oct 20 05:48:57 2011
New Revision: 341528

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=341528
Log:
Add option to check state when state is unknown and optomise the checking to reduce existing load.
RB1535 AST-695

Modified:
    team/irroot/distrotech-customers-1.8/apps/app_queue.c

Modified: team/irroot/distrotech-customers-1.8/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-1.8/apps/app_queue.c?view=diff&rev=341528&r1=341527&r2=341528
==============================================================================
--- team/irroot/distrotech-customers-1.8/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-1.8/apps/app_queue.c Thu Oct 20 05:48:57 2011
@@ -957,6 +957,9 @@
 /*! \brief queues.conf [general] option */
 static int log_membername_as_agent = 0;
 
+/*! \brief queues.conf [general] option */
+static int check_state_unknown = 0;
+
 enum queue_result {
 	QUEUE_UNKNOWN = 0,
 	QUEUE_TIMEOUT = 1,
@@ -3095,12 +3098,12 @@
 	}
 
 	if (!qe->parent->ringinuse || !tmp->member->ignorebusy) {
-		if ((tmp->member->status == AST_DEVICE_UNKNOWN) || (tmp->member->status == AST_DEVICE_NOT_INUSE)) {
-			newstate = ast_parse_device_state(tmp->member->interface);
+		if (check_state_unknown && (tmp->member->status == AST_DEVICE_UNKNOWN)) {
+			newstate = ast_device_state(tmp->member->interface);
 			if (newstate != tmp->member->status) {
 				ast_log(LOG_ERROR, "Found a channel matching iterface %s while status was %i changed to %i\n",
 					tmp->member->interface, tmp->member->status, newstate);
-				update_status(qe->parent, tmp->member, newstate);
+				ast_devstate_changed_literal(newstate, tmp->member->interface);
 			}
 		}
 		if ((tmp->member->status != AST_DEVICE_NOT_INUSE) && (tmp->member->status != AST_DEVICE_UNKNOWN)) {
@@ -6732,17 +6735,25 @@
 			montype_default = 1;
 	}
 	update_cdr = 0;
-	if ((general_val = ast_variable_retrieve(cfg, "general", "updatecdr")))
+	if ((general_val = ast_variable_retrieve(cfg, "general", "updatecdr"))) {
 		update_cdr = ast_true(general_val);
+	}
 	shared_lastcall = 0;
-	if ((general_val = ast_variable_retrieve(cfg, "general", "shared_lastcall")))
+	if ((general_val = ast_variable_retrieve(cfg, "general", "shared_lastcall"))) {
 		shared_lastcall = ast_true(general_val);
+	}
 	negative_penalty_invalid = 0;
-	if ((general_val = ast_variable_retrieve(cfg, "general", "negative_penalty_invalid")))
+	if ((general_val = ast_variable_retrieve(cfg, "general", "negative_penalty_invalid"))) {
 		negative_penalty_invalid = ast_true(general_val);
+	}
 	log_membername_as_agent = 0;
-	if ((general_val = ast_variable_retrieve(cfg, "general", "log_membername_as_agent")))
+	if ((general_val = ast_variable_retrieve(cfg, "general", "log_membername_as_agent"))) {
 		log_membername_as_agent = ast_true(general_val);
+	}
+	check_state_unknown = 0;
+	if ((general_val = ast_variable_retrieve(cfg, "general", "check_state_unknown"))) {
+		check_state_unknown = ast_true(general_val);
+	}
 }
 
 /*! \brief reload information pertaining to a single member




More information about the asterisk-commits mailing list