* to this order!
*/
-
enum {
QUEUE_STRATEGY_RINGALL = 0,
QUEUE_STRATEGY_LEASTRECENT,
{ QUEUE_CONTINUE, "CONTINUE" },
};
+enum queue_timeout_priority {
+ TIMEOUT_PRIORITY_APP,
+ TIMEOUT_PRIORITY_CONF,
+};
+
/*! \brief We define a custom "local user" structure because we
* use it not only for keeping track of what is in use but
* also for keeping track of who we're dialing.
int timeout; /*!< How long to wait for an answer */
int weight; /*!< Respective weight */
int autopause; /*!< Auto pause queue members if they fail to answer */
+ int timeoutpriority; /*!< Do we allow a fraction of the timeout to occur for a ring? */
/* Queue strategy things */
int rrpos; /*!< Round Robin - position */
q->periodicannouncefrequency = 0;
q->randomperiodicannounce = 0;
q->numperiodicannounce = 0;
+ q->timeoutpriority = TIMEOUT_PRIORITY_APP;
if (!q->members) {
if (q->strategy == QUEUE_STRATEGY_LINEAR)
/* linear strategy depends on order, so we have to place all members in a single bucket */
q->timeoutrestart = ast_true(val);
} else if (!strcasecmp(param, "defaultrule")) {
ast_string_field_set(q, defaultrule, val);
+ } else if (!strcasecmp(param, "timeoutpriority")) {
+ if (!strcasecmp(val, "conf")) {
+ q->timeoutpriority = TIMEOUT_PRIORITY_CONF;
+ } else {
+ q->timeoutpriority = TIMEOUT_PRIORITY_APP;
+ }
} else if (failunknown) {
if (linenum >= 0) {
ast_log(LOG_WARNING, "Unknown keyword in queue '%s': %s at line %d of queues.conf\n",
ast_free(tmp);
}
}
- if (qe->expire && (!qe->parent->timeout || (qe->expire - now) <= qe->parent->timeout))
+
+ if (qe->expire && (!qe->parent->timeout || (qe->parent->timeoutpriority == TIMEOUT_PRIORITY_APP && (qe->expire - now) <= qe->parent->timeout)))
to = (qe->expire - now) * 1000;
else
to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
;
;context = qoutcon
;
-; How long do we let the phone ring before we consider this a timeout...
+;----------------------QUEUE TIMING OPTIONS------------------------------------
+; A Queue has two different "timeout" values associated with it. One is the
+; timeout parameter configured in queues.conf. This timeout specifies the
+; amount of time to try ringing a member's phone before considering the
+; member to be unavailable. The other timeout value is the second argument
+; to the Queue() application. This timeout represents the absolute amount
+; of time to allow a caller to stay in the queue before the caller is
+; removed from the queue. In certain situations, these two timeout values
+; may clash. For instance, if the timeout in queues.conf is set to 5 seconds,
+; the retry value in queues.conf is set to 4, and the second argument to Queue()
+; is 10, then the following may occur:
+;
+; A caller places a call to a queue.
+; The queue selects a member and attempts to ring that member.
+; The member's phone is rung for 5 seconds and he does not answer.
+; The retry time of 4 seconds occurs.
+; The queue selects a second member to call.
+;
+; How long does that second member's phone ring? Does it ring for 5 seconds
+; since the timeout set in app_queue is 5 seconds? Does it ring for 1 second since
+; the caller has been in the queue for 9 seconds and is supposed to be removed after
+; being in the queue for 10 seconds? This is configurable with the timeoutpriority
+; option. By setting the timeoutpriority to "conf" then you are saying that you would
+; rather use the time specified in the configuration file even if it means having the
+; caller stay in the queue longer than the time specified in the application argument.
+; For the scenario described above, timeoutpriority=conf would result in the second
+; member's phone ringing for 5 seconds. By specifying "app" as the value for
+; timeoutpriority, you are saying that the timeout specified as the argument to the
+; Queue application is more important. In the scenario above, timeoutpriority=app
+; would result in the second member's phone ringing for 1 second.
+;
+; There are a few exceptions to the priority rules. For instance, if the configuration
+; file timeout is set to 0, but the application argument timeout is non-zero, then the
+; timeoutpriority is ignored and the application argument is used as the timeout. Furthermore,
+; if no application argument timeout is specified, then the timeoutpriority option is
+; ignored and the configuration file timeout is always used when calling queue members.
+;
+; The default value for timeoutpriority is "app" since this was how previous versions of
+; Asterisk behaved.
;
;timeout = 15
-;
-; How long do we wait before trying all the members again?
-;
;retry = 5
+;timeoutpriority = app|conf
;
+;-----------------------END QUEUE TIMING OPTIONS---------------------------------
; Weight of queue - when compared to other queues, higher weights get
; first shot at available channels when the same channel is included in
; more than one queue.