[asterisk-commits] mmichelson: branch 1.4 r74120 - /branches/1.4/apps/app_queue.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jul 9 13:32:50 CDT 2007
Author: mmichelson
Date: Mon Jul 9 13:32:50 2007
New Revision: 74120
URL: http://svn.digium.com/view/asterisk?view=rev&rev=74120
Log:
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)
Modified:
branches/1.4/apps/app_queue.c
Modified: branches/1.4/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_queue.c?view=diff&rev=74120&r1=74119&r2=74120
==============================================================================
--- branches/1.4/apps/app_queue.c (original)
+++ branches/1.4/apps/app_queue.c Mon Jul 9 13:32:50 2007
@@ -2357,8 +2357,7 @@
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;
@@ -3465,8 +3464,20 @@
}
break;
}
+ ast_log(LOG_DEBUG, "Status update 3\n");
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)) {
@@ -3510,16 +3521,7 @@
ast_queue_log(args.queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%s|%d", qe.digits, qe.pos);
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", qe.pos);
- 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.
More information about the asterisk-commits
mailing list