[asterisk-commits] twilson: trunk r338187 - in /trunk: ./ apps/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 28 11:59:18 CDT 2011


Author: twilson
Date: Wed Sep 28 11:59:11 2011
New Revision: 338187

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338187
Log:
Add autopausebusy and autopauseunavail queue options

Make it possible to autopause on a busy or unavailable response from
a device.

(closes issue ASTERISK-16112)
Reported by: jlpedrosa
Patches:
	autopausebusy.txt by twilson

Review: https://reviewboard.asterisk.org/r/1399/

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

Modified: trunk/CHANGES
URL: http://svnview.digium.com/svn/asterisk/trunk/CHANGES?view=diff&rev=338187&r1=338186&r2=338187
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Wed Sep 28 11:59:11 2011
@@ -227,6 +227,8 @@
  * Added member option ignorebusy this when set and ringinuse is not
    will allow per member control of multiple calls as ringinuse does for
    the Queue.
+ * Added queue options autopausebusy and autopauseunavail for automatically
+   pausing a queue member when their device reports busy or congestion.
 
 Applications
 ------------

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=338187&r1=338186&r2=338187
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Sep 28 11:59:11 2011
@@ -1158,6 +1158,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? */
@@ -2040,6 +2042,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)
@@ -3782,7 +3788,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;
@@ -3800,7 +3806,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)

Modified: trunk/configs/queues.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/queues.conf.sample?view=diff&rev=338187&r1=338186&r2=338187
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Wed Sep 28 11:59:11 2011
@@ -209,6 +209,16 @@
 ; Autopausedelay delay autopause for autopausedelay seconds from the
 ; last call if a member has not taken a call the delay has no effect.
 ;autopausedelay=60
+;
+; Autopausebusy controls whether or not a queue member is set as paused
+; automatically upon the member device reporting busy. The autopausedelay
+; option applies. Defaults to 'no'.
+;autopausebusy=no
+;
+; Autopauseunavail controls whether or not a queue member is set as paused
+; automatically upon the member device reporting congestion. The autopausedely
+; option applies. Defaults to 'no'.
+;autopauseunavail=no
 ;
 ; Maximum number of people waiting in the queue (0 for unlimited)
 ;




More information about the asterisk-commits mailing list