[asterisk-bugs] [Asterisk 0013220]: [patch] Calls in high-weighted queue block low-weighted

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Mar 30 11:47:24 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13220 
====================================================================== 
Reported By:                garychen
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   13220
Category:                   Applications/app_queue
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.4.19 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-08-01 08:28 CDT
Last Modified:              2009-03-30 11:47 CDT
====================================================================== 
Summary:                    [patch] Calls in high-weighted queue block
low-weighted
Description: 
I have two queues, weighted 4 and 5. High priority calls are placed in
Q6002, while low priority ones in Q6001.

All agents are member of both queues.

The problem is whenever there's a high priority call ringing on an agent
(the agent not answer the call), low priority calls not routed to any idle
agents. They are blocked.
====================================================================== 

---------------------------------------------------------------------- 
 (0102403) svnbot (reporter) - 2009-03-30 11:47
 http://bugs.digium.com/view.php?id=13220#c102403 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 185088

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_queue.c

------------------------------------------------------------------------
r185088 | mmichelson | 2009-03-30 11:47:22 -0500 (Mon, 30 Mar 2009) | 52
lines

Merged revisions 185072 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r185072 | mmichelson | 2009-03-30 11:26:48 -0500 (Mon, 30 Mar 2009) | 45
lines
  
  Merged revisions 185031 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r185031 | mmichelson | 2009-03-30 11:17:35 -0500 (Mon, 30 Mar 2009) |
39 lines
    
    Fix queue weight behavior so that calls in low-weight queues are not
inappropriately blocked.
    
    (This is copied and pasted from the review request I made for this
patch)
    
    Asterisk has some odd behavior when queue weights are used. The
current logic used when
    potentially calling a queue member is:
    
    If the member we are going to call is part of another queue and _that
other queue has any 
    callers in it_ and has a higher weight than the queue we are calling
from, then don't try 
    to contact that member. The issue here is what I have marked with
underscores. If the 
    higher-weighted queue has any callers in it at all, then the queue
member will be unreachable 
    from the lower-weighted queue. This has the potential to be really
really bad if using a 
    queue strategy, such as leastrecent or fewestcalls, with the potential
to call the same 
    member repeatedly.
    
    The fix proposed by garychen on issue 13220 is very simple and, as far
as I can see, works 
    well for this situation. With this set of changes, the logic used
becomes:
    
    If the member we are going to call is part of another queue, the other
queue has a higher 
    weight than the queue we are calling from, and the higher weight queue
has at least as many 
    callers as available members, then do not try to contact the queue
member. If the higher 
    weighted queue has fewer callers than available members, then there is
no reason to deny 
    the call to this member since the other queue can afford to spare a
member.
    
    Since the fix involved writing a generic function for determining the
number of available 
    members in the queue, I also modified the is_our_turn function to make
use of the new 
    num_available_members function to determine if it is our turn to try
calling a member. There 
    is one small behavior change. Before writing this patch, if you had
autofill disabled, then 
    if you were the head caller in a queue, you would automatically be
told that it was your 
    turn to try calling a member. This did not take into account whether
there were actually any 
    queue members available to take the call. Now we actually make sure
there is at least one 
    member available to take the call if autofill is disabled.
    
    (closes issue http://bugs.digium.com/view.php?id=13220)
    Reported by: garychen
    
    Review: http://reviewboard.digium.com/r/202/
  ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=185088 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-03-30 11:47 svnbot         Checkin                                      
2009-03-30 11:47 svnbot         Note Added: 0102403                          
======================================================================




More information about the asterisk-bugs mailing list