summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2011-09-28 16:59:11 +0000
committerTerry Wilson <twilson@digium.com>2011-09-28 16:59:11 +0000
commit0ab04b53b5fdcfc17bc5f82acafc87c92ca37924 (patch)
treee31acd244af4ad3345287693f529d47ec2097869
parent89205c35e8625e4d1349e700f844823bc780f5c9 (diff)
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/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--CHANGES2
-rw-r--r--apps/app_queue.c10
-rw-r--r--configs/queues.conf.sample10
3 files changed, 20 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 8fc2c6c99..5cdcf8e46 100644
--- a/CHANGES
+++ b/CHANGES
@@ -227,6 +227,8 @@ Queue changes
* 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
------------
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 7930ca301..f1bcb8b48 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1158,6 +1158,8 @@ struct call_queue {
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 @@ static void queue_set_param(struct call_queue *q, const char *param, const char
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 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
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 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
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)
diff --git a/configs/queues.conf.sample b/configs/queues.conf.sample
index 386e89518..a74c25afc 100644
--- a/configs/queues.conf.sample
+++ b/configs/queues.conf.sample
@@ -210,6 +210,16 @@ monitor-type = MixMonitor
; 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)
;
;maxlen = 0