[asterisk-bugs] [Asterisk 0010942]: [PATCH] Add a new queue strategy: weighted random (wrandom)

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Oct 11 16:09:22 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10942 
====================================================================== 
Reported By:                julianjm
Assigned To:                putnopvut
====================================================================== 
Project:                    Asterisk
Issue ID:                   10942
Category:                   Applications/app_queue
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!): 85355 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             10-10-2007 17:43 CDT
Last Modified:              10-11-2007 16:09 CDT
====================================================================== 
Summary:                    [PATCH] Add a new queue strategy: weighted random
(wrandom)
Description: 
Random strategy, but using penaly as a weight. Basically, the higher the
penalty, the less probability to receive calls from the queue.

[600]
strategy=wrandom
member=SIP/100,0
member=SIP/101,1
member=SIP/102,2

When calculating the metric for each round, we use this formula:
metric=ast_random() % ((penalty+1)*1000)

penalty 0 => metric between 0 and 999
penalty 1 => metric between 0 and 1999
penalty 2 => metric between 0 and 2999

The member with lower metric gets the next call.
====================================================================== 

---------------------------------------------------------------------- 
 putnopvut - 10-11-07 16:09  
---------------------------------------------------------------------- 
This makes for an interesting interpretation of a queue member's penalty!
The only complaint I have about this is that since this is a new feature,
this will go into Asterisk trunk, not 1.4. If you don't mind making a patch
against trunk, that would be excellent.

I'm going to go ahead and mark this as ready for testing. If I don't hear
complaints about the patch I'll commit in a week or two, along with a
revised queues.conf.sample which will have an explanation of the wrandom
strategy.

Thanks very much for the contribution! 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-11-07 16:09  putnopvut      Note Added: 0071839                          
======================================================================




More information about the asterisk-bugs mailing list