<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br>thank you Juha, I understand the purpose and that is how I intend to use it, [more weights for gws with more capacity]<br><br>but I guess I should have rephrase my question as: what is the purpose of the "randomized" weight value then? when you randomize it then the weight parameter becomes useless.<br><br>example: <br>3 gws inside same group, and assuming the higher the weight the higher the capacity<br><br>&nbsp;gw 1 with weight 20<br>&nbsp;gw 2 with weight 30<br>&nbsp;gw 3 with weight 60<br><br>I would like to send more calls to gw 3, then gw 2 then gw 1<br>but if when I do a load_gws, and I randomize the weight (meaning I get a random value out of the possible 20, 30 and 60, then pick the gw with that random value, for example rand() returns 20, then I really obtain gw 2) then there is no guarantee that the order would be like I want it.<br><br>At least that is how I understand the "randomize" factor on this logic,&nbsp; do I get it wrong? If so please advise.<br><br>txs a lot<br><br><br><br><div>
<div>&nbsp;</div></div><br><br><div><hr id="stopSpelling">From: fborot@hotmail.com<br>To: users@lists.kamailio.org<br>Subject: RE: LCR weight parameter<br>Date: Tue, 22 Nov 2011 07:33:23 -0500<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>

<div dir="ltr">
<br>Thanks Juha, I figured that the avp reordering would be something like that.<br><br>The help file for versions 3.1 and 3.2 also says "randomized weight", does it really work on those versions?<br><div>
<div>&nbsp;</div></div>this is from 3.2<br><br>***********************<br>When the function load_gws() is called, matching gateways (that are not currently designated as defunct) are ordered for forwarding purposes as follows:<br><br>&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1) according to longest user part match<br>&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2) according to tuple's priority<br>&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3) according to tuple's randomized weight<br>&nbsp;<br>**********************<br><br>or do you mean the "priority" column on the "lcr_rule_target" table&nbsp; instead?<br><br>This may be a dumb question but since I don't get it I have to ask: what is the purpose of the weight value then?<br><br>thank you<br>fborot<br><br><br><br><br><br><div><hr id="ecxstopSpelling">From: fborot@hotmail.com<br>To: users@lists.kamailio.org<br>Subject: LCR weight parameter<br>Date: Tue, 22 Nov 2011 06:39:44 -0500<br><br>



<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}
</style>

<div dir="ltr">
Hello<br><br>On kamailio 1.5.2, I need to choose the gw from a group according to its weight. After trying unsuccessfully with different values I realized that the help guide says that the load_gw functions can return gateways according to "gateway's randomized weight within its
        group". So, I have these questions:<br><br>1- since it is "randomized", does this mean that the weight parameter actually can not guarantee that the weight value can decide how gateways are ordered?<br>2- once I have the gws on the avp, is it posible to re-order them? if so, how?<br><br>thank you very much<br><br>fborot<br><br><div>
<div>&nbsp;</div></div>                                               </div></div>                                               </div></div>                                               </div></body>
</html>