[asterisk-commits] mmichelson: trunk r127720 - in /trunk: ./ apps/ configs/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jul 3 09:34:26 CDT 2008
Author: mmichelson
Date: Thu Jul 3 09:34:25 2008
New Revision: 127720
URL: http://svn.digium.com/view/asterisk?view=rev&rev=127720
Log:
Added a new option, "timeoutpriority" to queues.conf. A detailed
explanation of the change may be found in configs/queues.conf.sample
(closes issue #12690)
Reported by: atis
Modified:
trunk/CHANGES
trunk/apps/app_queue.c
trunk/configs/queues.conf.sample
Modified: trunk/CHANGES
URL: http://svn.digium.com/view/asterisk/trunk/CHANGES?view=diff&rev=127720&r1=127719&r2=127720
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Thu Jul 3 09:34:25 2008
@@ -163,6 +163,9 @@
-------------
* The TRANSFER queue log entry now includes the the caller's original
position in the transferred-from queue.
+ * A new configuration option, "timeoutpriority" has been added. Please see the section labeled
+ "QUEUE TIMING OPTIONS" in configs/queues.conf.sample for a detailed explanation of the option
+ as well as an explanation about timeout options in general
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 1.4.X to Asterisk 1.6.0 -------------
Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=127720&r1=127719&r2=127720
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu Jul 3 09:34:25 2008
@@ -107,7 +107,6 @@
* application, but it is now in place this way, so please adhere
* to this order!
*/
-
enum {
QUEUE_STRATEGY_RINGALL = 0,
@@ -314,6 +313,11 @@
{ QUEUE_LEAVEUNAVAIL, "LEAVEUNAVAIL" },
{ QUEUE_FULL, "FULL" },
{ QUEUE_CONTINUE, "CONTINUE" },
+};
+
+enum queue_timeout_priority {
+ TIMEOUT_PRIORITY_APP,
+ TIMEOUT_PRIORITY_CONF,
};
/*! \brief We define a custom "local user" structure because we
@@ -498,6 +502,7 @@
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 */
@@ -907,6 +912,7 @@
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 */
@@ -1295,6 +1301,12 @@
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",
@@ -3362,7 +3374,8 @@
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;
Modified: trunk/configs/queues.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/queues.conf.sample?view=diff&rev=127720&r1=127719&r2=127720
==============================================================================
--- trunk/configs/queues.conf.sample (original)
+++ trunk/configs/queues.conf.sample Thu Jul 3 09:34:25 2008
@@ -117,14 +117,51 @@
;
;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.
More information about the asterisk-commits
mailing list