summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-02-15 02:52:19 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-02-15 02:52:19 +0000
commitf0495e8944977f3968b6b07936a0fc743bef63a4 (patch)
tree2dbc461aa20c531c8fa2332ca4730b19abebffbc /apps/app_queue.c
parent0a9c957764fad478405fe9ef1c8fcc9927f5ee5e (diff)
add option to avoid calling members whose channels are 'in use' (issue #6315, plus documentation)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 6692fe2fd..9d1548617 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -326,6 +326,7 @@ struct ast_call_queue {
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 @@ static void init_queue(struct ast_call_queue *q)
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 @@ static void queue_set_param(struct ast_call_queue *q, const char *param, const c
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 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies
(*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);