Consider using the Dispatcher or Load Balancer Modules. They give you a lot more flexibility and many more features in traffic distribution:<div><br></div><div><a href="http://www.opensips.org/html/docs/modules/1.8.x/dispatcher.html">http://www.opensips.org/html/docs/modules/1.8.x/dispatcher.html</a> </div>
<div><br></div><div><a href="http://www.opensips.org/html/docs/modules/1.8.x/load_balancer.html">http://www.opensips.org/html/docs/modules/1.8.x/load_balancer.html</a> </div><div><br>Regards,<br>Ali<br><br><div class="gmail_quote">
On Wed, May 9, 2012 at 1:28 AM, prasad kelkar <span dir="ltr">&lt;<a href="mailto:durga144@gmail.com" target="_blank">durga144@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hello,<br>
I used statistic module according to<br>
&quot;<a href="http://www.opensips.org/html/docs/modules/devel/statistics" target="_blank">http://www.opensips.org/html/docs/modules/devel/statistics</a>&quot;.<br>
I wrote following code to do round robin distribution of calls between<br>
two servers.<br>
if (is_method(&quot;INVITET&quot;))<br>
        {<br>
        $var(reg_counter) = &quot;count&quot;;<br>
<br>
        #if($stat(count)==1)<br>
        if(!$var(reg_counter))<br>
        {<br>
                forward(&quot;<a href="http://172.29.9.131:5060" target="_blank">172.29.9.131:5060</a>&quot;);<br>
                update_stat(&quot;count&quot;, &quot;1&quot;);<br>
<br>
                exit();<br>
        }<br>
        else<br>
        {<br>
                forward(&quot;<a href="http://172.29.9.136:5060" target="_blank">172.29.9.136:5060</a>&quot;);<br>
                #update_stat(&quot;count&quot;, &quot;1&quot;);<br>
                reset_stat(&quot;count&quot;);<br>
                exit;<br>
        }<br>
        if($stat(count))<br>
        {<br>
                forward(&quot;<a href="http://172.29.9.131:5060" target="_blank">172.29.9.131:5060</a>&quot;);<br>
                $stat(count) = 0;<br>
<br>
                exit();<br>
        }<br>
        else<br>
        {<br>
                forward(&quot;<a href="http://172.29.9.136:5060" target="_blank">172.29.9.136:5060</a>&quot;);<br>
                #stat(count) = 1;<br>
                exit;<br>
        }<br>
        }<br>
<br>
In both stat(count) and $var(reg_counter) = &quot;count&quot; It is executing<br>
only else part.<br>
how to use variable count to compare values?<br>
can this count variable be used for this purpose? or is there any other way.<br>
I am doing it stateless mode.<br>
Please help me.<br>
<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" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br></div>