[asterisk-commits] trunk r10163 - in /trunk: apps/app_queue.c configs/queues.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 14 19:52:20 MST 2006


Author: kpfleming
Date: Tue Feb 14 20:52:19 2006
New Revision: 10163

URL: http://svn.digium.com/view/asterisk?rev=10163&view=rev
Log:
add option to avoid calling members whose channels are 'in use' (issue #6315, plus documentation)

Modified:
    trunk/apps/app_queue.c
    trunk/configs/queues.conf.sample

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?rev=10163&r1=10162&r2=10163&view=diff
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Tue Feb 14 20:52:19 2006
@@ -326,6 +326,7 @@
 	unsigned int joinempty:2;
 	unsigned int eventwhencalled:1;
 	unsigned int leavewhenempty:2;
+	unsigned int ringinuse:1;
 	unsigned int reportholdtime:1;
 	unsigned int wrapped:1;
 	unsigned int timeoutrestart:1;
@@ -575,6 +576,7 @@
 	q->announceholdtime = 0;
 	q->roundingseconds = 0; /* Default - don't announce seconds */
 	q->servicelevel = 0;
+	q->ringinuse = 1;
 	q->moh[0] = '\0';
 	q->announce[0] = '\0';
 	q->context[0] = '\0';
@@ -626,6 +628,8 @@
 		q->timeout = atoi(val);
 		if (q->timeout < 0)
 			q->timeout = DEFAULT_TIMEOUT;
+	} else if (!strcasecmp(param, "ringinuse")) {
+		q->ringinuse = ast_true(val);
 	} else if (!strcasecmp(param, "monitor-join")) {
 		q->monjoin = ast_true(val);
 	} else if (!strcasecmp(param, "monitor-format")) {
@@ -1378,7 +1382,16 @@
 		(*busies)++;
 		return 0;
 	}
-	
+
+	if (!qe->parent->ringinuse && (tmp->member->status == AST_DEVICE_INUSE)) {
+		if (option_debug)
+			ast_log(LOG_DEBUG, "%s in use, can't receive call\n", tmp->interface);
+		if (qe->chan->cdr)
+			ast_cdr_busy(qe->chan->cdr);
+		tmp->stillgoing = 0;
+		return 0;
+	}
+
 	if (tmp->member->paused) {
 		if (option_debug)
 			ast_log(LOG_DEBUG, "%s paused, can't receive call\n", tmp->interface);

Modified: trunk/configs/queues.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/queues.conf.sample?rev=10163&r1=10162&r2=10163&view=diff
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Tue Feb 14 20:52:19 2006
@@ -174,6 +174,12 @@
 ;
 ; reportholdtime = no
 ;
+; If you want the queue to avoid sending calls to members whose devices are
+; known to be 'in use' (via the channel driver supporting that device state)
+; uncomment this option. (Note: only the SIP channel driver currently is able
+; to report 'in use'.)
+;
+; ringinuse = no
 ;
 ; If you wish to have a delay before the member is connected to the caller (or
 ; before the member hears any announcement messages), set this to the number of



More information about the asterisk-commits mailing list