[OpenSIPS-Users] About usint integer variable

Ali Pey alipey at gmail.com
Wed May 9 15:53:59 CEST 2012


Consider using the Dispatcher or Load Balancer Modules. They give you a lot
more flexibility and many more features in traffic distribution:

http://www.opensips.org/html/docs/modules/1.8.x/dispatcher.html

http://www.opensips.org/html/docs/modules/1.8.x/load_balancer.html

Regards,
Ali

On Wed, May 9, 2012 at 1:28 AM, prasad kelkar <durga144 at gmail.com> wrote:

> hello,
> I used statistic module according to
> "http://www.opensips.org/html/docs/modules/devel/statistics".
> I wrote following code to do round robin distribution of calls between
> two servers.
> if (is_method("INVITET"))
>        {
>        $var(reg_counter) = "count";
>
>        #if($stat(count)==1)
>        if(!$var(reg_counter))
>        {
>                forward("172.29.9.131:5060");
>                update_stat("count", "1");
>
>                exit();
>        }
>        else
>        {
>                forward("172.29.9.136:5060");
>                #update_stat("count", "1");
>                reset_stat("count");
>                exit;
>        }
>        if($stat(count))
>        {
>                forward("172.29.9.131:5060");
>                $stat(count) = 0;
>
>                exit();
>        }
>        else
>        {
>                forward("172.29.9.136:5060");
>                #stat(count) = 1;
>                exit;
>        }
>        }
>
> In both stat(count) and $var(reg_counter) = "count" It is executing
> only else part.
> how to use variable count to compare values?
> can this count variable be used for this purpose? or is there any other
> way.
> I am doing it stateless mode.
> Please help me.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120509/9d252193/attachment.htm>


More information about the Users mailing list