<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">Hi Razvan,</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">Thanks for reply. I will test this on my script a quick question on this is if we have multiple destinations how to define a weight of each how dispatcher will take into considerations.</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">Let say i have two destination and following entry in DB.</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">ID SOCKET WEIGHT PRIORITY</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">----------------------------------------------------------</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">1 sip:<a href="http://1.1.1.1:6060">1.1.1.1:6060</a> 100 1</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">2 sip:<a href="http://2.2.2.2:6060">2.2.2.2:6060</a> 200 2</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">3 sip:<a href="http://3.3.3.3:6060">3.3.3.3:6060</a> 300 3</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">How Load balance distribute a call let say we receive 10 cps ?</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">Any help appreciated.</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">Best Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;color:#000000">Dhaval</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 7:24 PM, Răzvan Crainea <span dir="ltr"><<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<tt>Hi, Dhaval!<br>
<br>
A use case for this algorithm is setting the pv_algo_pattern as
shown in the documentation page[1]:<br>
modparam("dispatcher", "pvar_algo_pattern", "$stat(load_%u)")<br>
<br>
This parameter indicates that whenever you are using a
ds_select_*() function with algorithm 9, OpenSIPS will check the
load for each destination, and order them based on each value.<br>
For example, consider we have two destinations: sip:1.1.1.1 and
sip:2.2.2.2. Algorithm 9 will evaluate for each destination the
following pvars:<br>
$stat(load_sip:1.1.1.1) and $stat(load_sip:2.2.2.2) and order them
based on its values. Then of course, first picks the least used
one.<br>
<br>
All that's left for you is to update the statistic accordingly.
For example:<br>
<br>
if (ds_select_dst("0", "9"))<br>
update_stat("load_sip:$dd", "+1");<br>
<br>
Hope that's clear now.<br>
</tt><tt>
<br>
[1]
<a href="http://www.opensips.org/html/docs/modules/2.1.x/dispatcher#id293975" target="_blank">http://www.opensips.org/html/docs/modules/2.1.x/dispatcher#id293975</a><br>
<br>
Best regards,</tt><br>
<pre cols="72">Răzvan Crainea
OpenSIPS Solutions
<a href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre><div><div class="h5">
<div>On 12/18/2015 01:05 PM, DHAVAL
INDRODIYA wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">Dear
All,<br>
<br>
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">I am
working on opensips dispatcher and found that dispatcher is
able to do loadbalancing in function ds_select_dst.<br>
<br>
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">I have
found a good description on DISPATCHER module itself it says
- " <b>The <span><em>pvar_algo_pattern</em></span>
parameter is used to determine the load on each server. If
the parameter is not specified, then the first entry in the
set is chosen.</b>"<br>
<br>
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">Now
the question here is how to use this load balancing and what
should be exact value we need to put in pvar_algo_pattern?<br>
<br>
How to define weight in table I mean what should be value of
weight in table it is like number of call handling capability?<br>
<br>
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">I have
found some of the reference and that some how not working i
might be using in wrong way if any one have a good example
then would be a great help for me.</div>
<br>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">BR,<br>
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;color:rgb(0,0,0)">DI</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div><span style="color:rgb(61,133,198)"><span style="font-family:verdana,sans-serif"><br>Best Regards,<br></span></span></div><b><span style="color:rgb(61,133,198)"><span style="font-family:verdana,sans-serif">Dhaval Indrodiya<br></span></span></b></div><b><span style="color:rgb(61,133,198)"><span style="font-family:verdana,sans-serif">skype: dki123sabse</span></span></b><br></div></div>
</div>