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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 20 13:09:33 CDT 2011


Author: irroot
Date: Thu Oct 20 13:09:29 2011
New Revision: 341587

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=341587
Log:
Backport autopause on busy/unavail
final chages to state_change code

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=341587&r1=341586&r2=341587
==============================================================================
--- team/irroot/distrotech-customers-1.8/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-1.8/apps/app_queue.c Thu Oct 20 13:09:29 2011
@@ -1161,6 +1161,8 @@
 	unsigned int realtime:1;
 	unsigned int found:1;
 	unsigned int relativeperiodicannounce:1;
+	unsigned int autopausebusy:1;
+	unsigned int autopauseunavail:1;
 	enum empty_conditions joinempty;
 	enum empty_conditions leavewhenempty;
 	int announcepositionlimit;          /*!< How many positions we announce? */
@@ -2043,6 +2045,10 @@
 		q->autopause = autopause2int(val);
 	} else if (!strcasecmp(param, "autopausedelay")) {
 		q->autopausedelay = atoi(val);
+	} else if (!strcasecmp(param, "autopausebusy")) {
+		q->autopausebusy = ast_true(val);
+	} else if (!strcasecmp(param, "autopauseunavail")) {
+		q->autopauseunavail = ast_true(val);
 	} else if (!strcasecmp(param, "maxlen")) {
 		q->maxlen = atoi(val);
 		if (q->maxlen < 0)
@@ -3101,8 +3107,8 @@
 		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);
+				ast_log(LOG_WARNING, "Found a channel matching iterface %s while status was %s changed to %s\n",
+					tmp->member->interface, ast_devstate2str(tmp->member->status), ast_devstate2str(newstate));
 				ast_devstate_changed_literal(newstate, tmp->member->interface);
 			}
 		}
@@ -3785,7 +3791,7 @@
 							do_hang(o);
 							endtime = (long) time(NULL);
 							endtime -= starttime;
-							rna(endtime * 1000, qe, on, membername, 0);
+							rna(endtime * 1000, qe, on, membername, qe->parent->autopausebusy);
 							if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
 								if (qe->parent->timeoutrestart)
 									*to = orig;
@@ -3803,7 +3809,7 @@
 								ast_cdr_busy(in->cdr);
 							endtime = (long) time(NULL);
 							endtime -= starttime;
-							rna(endtime * 1000, qe, on, membername, 0);
+							rna(endtime * 1000, qe, on, membername, qe->parent->autopauseunavail);
 							do_hang(o);
 							if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
 								if (qe->parent->timeoutrestart)
@@ -6727,8 +6733,9 @@
 		queue_persistent_members = ast_true(general_val);
 	}
 	autofill_default = 0;
-	if ((general_val = ast_variable_retrieve(cfg, "general", "autofill")))
+	if ((general_val = ast_variable_retrieve(cfg, "general", "autofill"))) {
 		autofill_default = ast_true(general_val);
+	}
 	montype_default = 0;
 	if ((general_val = ast_variable_retrieve(cfg, "general", "monitor-type"))) {
 		if (!strcasecmp(general_val, "mixmonitor"))
@@ -8657,15 +8664,12 @@
 */
 static struct member *find_member_by_queuename_and_interface(const char *queuename, const char *interface)
 {
-	struct member tmpmem, *mem = NULL;
+	struct member *mem = NULL;
 	struct call_queue *q;
 
-	ast_copy_string(tmpmem.interface, interface, sizeof(tmpmem.interface));
 	if ((q = load_realtime_queue(queuename))) {
 		ao2_lock(q);
-		if ((mem = ao2_find(q->members, &tmpmem, OBJ_POINTER))) {
-			ao2_ref(mem, -1);
-		}
+		mem = ao2_find(q->members, interface, OBJ_KEY);
 		ao2_unlock(q);
 		queue_t_unref(q, "Expiring temporary reference.");
 	}




More information about the asterisk-commits mailing list