diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-09 18:37:09 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-09 18:37:09 +0000 |
commit | 19164c001b98518c3b4675d079e7e29d80b0143f (patch) | |
tree | c393a412fff029732c9d255e8260aeb2b5eda37a /apps | |
parent | 9fb29f223f1e74f0ec51ccf71fc4fc4eaa2575ad (diff) |
Merged revisions 74120 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r74120 | mmichelson | 2007-07-09 13:32:50 -0500 (Mon, 09 Jul 2007) | 6 lines
The n option for Queue should make the queue exit immediately after failure to reach any members and should not
be dependent on the timeout value passed to Queue
(closes issue #10127, reported by bcnit, repaired by me)
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@74121 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_queue.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index ce38d2fff..1efc3531c 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -2477,8 +2477,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_DISCONNECT); break; case 'n': - if ((now - qe->start >= qe->parent->timeout)) - *go_on = 1; + *go_on = 1; break; case 'i': forwardsallowed = 0; @@ -3650,6 +3649,17 @@ check_turns: stat = get_member_status(qe.parent, qe.max_penalty); + /* exit after 'timeout' cycle if 'n' option enabled */ + if (go_on) { + if (option_verbose > 2) + ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n"); + ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d", qe.pos); + record_abandoned(&qe); + reason = QUEUE_TIMEOUT; + res = 0; + break; + } + /* leave the queue if no agents, if enabled */ if (qe.parent->leavewhenempty && (stat == QUEUE_NO_MEMBERS)) { record_abandoned(&qe); @@ -3699,17 +3709,7 @@ check_turns: qe.digits, qe.pos, qe.opos, (long) time(NULL) - qe.start); break; } - /* exit after 'timeout' cycle if 'n' option enabled */ - if (go_on) { - if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Exiting on time-out cycle\n"); - ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", - qe.pos, qe.opos, (long) time(NULL) - qe.start); - record_abandoned(&qe); - reason = QUEUE_TIMEOUT; - res = 0; - break; - } + /* Since this is a priority queue and * it is not sure that we are still at the head * of the queue, go and check for our turn again. |