[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:58:21 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:58 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.
====================================================================== 

---------------------------------------------------------------------- 
 julianjm - 10-11-07 16:58  
---------------------------------------------------------------------- 
There it goes. It's been made against revision 85485.

Julian J. M. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-11-07 16:58  julianjm       Note Added: 0071844                          
======================================================================




More information about the asterisk-bugs mailing list