[asterisk-commits] mjordan: trunk r396949 - in /trunk: ./ apps/app_queue.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 19 19:08:34 CDT 2013
Author: mjordan
Date: Mon Aug 19 19:08:33 2013
New Revision: 396949
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=396949
Log:
Let Queue wrap up time influence member availability
Queue members who happen to be in multiple queues at the same time may not
have any wrap up time. This problem occurred due to a code change in Asterisk
11.3.0 that unified device state tracking of Queue members in multiple
Queues (which fixed some other problems, but unfortunately caused this one).
This patch fixes the behavior by having the is_member_available function
check the queue's wrap up time and the time of the member's last call, such
that for a particular queue, the member won't be considered available if their
last call is within the wrap up time.
(closes issue ASTERISK-22189)
Reported by: Tony Lewis
Tested by: Tony Lewis
........
Merged revisions 396948 from http://svn.asterisk.org/svn/asterisk/branches/11
Modified:
trunk/ (props changed)
trunk/apps/app_queue.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=396949&r1=396948&r2=396949
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon Aug 19 19:08:33 2013
@@ -2064,7 +2064,7 @@
* \retval 1 if the member is available
* \retval 0 if the member is not available
*/
-static int is_member_available(struct member *mem)
+static int is_member_available(struct call_queue *q, struct member *mem)
{
int available = 0;
@@ -2089,6 +2089,10 @@
break;
}
+ /* Let wrapuptimes override device state availability */
+ if (mem->lastcall && q->wrapuptime && (time(NULL) - q->wrapuptime < mem->lastcall)) {
+ available = 0;
+ }
return available;
}
@@ -2139,7 +2143,7 @@
/* check every member until we find one NOT_INUSE */
if (!avail) {
- avail = is_member_available(m);
+ avail = is_member_available(q, m);
}
if (avail && found_member) {
/* early exit as we've found an available member and the member of interest */
@@ -3703,7 +3707,7 @@
mem_iter = ao2_iterator_init(q->members, 0);
while ((mem = ao2_iterator_next(&mem_iter))) {
- avl += is_member_available(mem);
+ avl += is_member_available(q, mem);
ao2_ref(mem, -1);
/* If autofill is not enabled or if the queue's strategy is ringall, then
@@ -6227,7 +6231,7 @@
member_add_to_queue(q, new_member);
queue_publish_member_blob(queue_member_added_type(), queue_member_blob_create(q, new_member));
- if (is_member_available(new_member)) {
+ if (is_member_available(q, new_member)) {
ast_devstate_changed(AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, "Queue:%s_avail", q->name);
}
@@ -6313,7 +6317,7 @@
dump_queue_members(q);
}
- if (is_member_available(mem)) {
+ if (is_member_available(q, mem)) {
ast_devstate_changed(AST_DEVICE_NOT_INUSE, AST_DEVSTATE_CACHABLE, "Queue:%s_avail", q->name);
} else if (!num_available_members(q)) {
ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "Queue:%s_avail", q->name);
More information about the asterisk-commits
mailing list