[Home]

Summary:ASTERISK-05710: [patch] queue weight feature is broken
Reporter:peter (peter)Labels:
Date Opened:2005-11-25 14:50:15.000-0600Date Closed:2008-01-15 16:02:47.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20051129__bug5863.diff.txt
Description:There is a bug in app_queue.c function compare_weight.

The problem is in the loop the compares what members are in the selected queue to the passed in member.  

What is happening is that each queue has allocated it own memory for struct member for the same agent/person.  So the if statement will always be false unless it is the same queue, and that will not happen either.

To reproduce:
- Create three queues with different weights
- Add the same agent into each of the queue
- Make the agent busy so they don't get the call
- Add a call to each of the queues
- Make the agent available
- The order the agent receives the calls will not match the order of queue weights

I think the fix would be instead of compare mem to member, compare mem->interface to member->interface
Comments:By: Russell Bryant (russell) 2005-11-30 19:20:51.000-0600

fixed in the trunk and 1.2 branch.  It will be in the 1.2.1 release.  Thanks guys!

By: Digium Subversion (svnbot) 2008-01-15 16:02:47.000-0600

Repository: asterisk
Revision: 7248

U   trunk/apps/app_queue.c

------------------------------------------------------------------------
r7248 | russell | 2008-01-15 16:02:46 -0600 (Tue, 15 Jan 2008) | 3 lines

fix queue weight feature - compare member interfaces instead of pointers to
the members, since each queue has its own list of members. (issue ASTERISK-5710)

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

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

By: Digium Subversion (svnbot) 2008-01-15 16:02:47.000-0600

Repository: asterisk
Revision: 7249

U   branches/1.2/apps/app_queue.c

------------------------------------------------------------------------
r7249 | russell | 2008-01-15 16:02:47 -0600 (Tue, 15 Jan 2008) | 3 lines

fix queue weight feature - compare member interfaces instead of pointers to
the members, since each queue has its own list of members. (issue ASTERISK-5710)

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

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