[OpenSIPS-Users] load_balance not using group id in failure route

Razvan Crainea razvancrainea at opensips.org
Tue Jan 3 15:41:29 CET 2012


Hi, Steven!

This is not strange, the usual scenario is to do failover within the 
gateways from the same group. My question is that if you have only one 
resource, why don't you use the dispatcher[1] module? I think it will 
meet better your requirements, as load balancer is usually used when you 
want to dispatch requests based on multiple resources. Also, there you 
can disable the automatic failover behavior.

[1] http://www.opensips.org/html/docs/modules/1.7.x/dispatcher.html

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer


On 01/03/2012 04:31 PM, Steven Lam, KeenSystems B.V. wrote:
>
> Hi Ra(zvan,
>
> Thank you for your answer!
>
> The table was just for illustrating the problem as simple as possible...
>
> What I want to achieve is this: 3 servers for everyday use and 2 
> servers for fallback, so simple RURI rewriting won't do the trick :-(
>
> Can you tell me what the problem is with resetting the AVPs?
>
> It is good to hear it is not a bug, but this makes me thinking... in 
> this example the resources in all groups are "all". If I change the 
> one from group 2 to "foobar" and then call load_balance in the 
> failure_route like "load_balance("2","foobar")", I get a line telling 
> me resource "foobar" is not found in group 1???
>
> So in a failure_route load_balance does care about the resource and 
> does NOT care about the group number, is this not strange?
>
> Steven
>
> *From:*users-bounces at lists.opensips.org 
> [mailto:users-bounces at lists.opensips.org] *On Behalf Of *Razvan Crainea
> *Sent:* dinsdag 3 januari 2012 14:36
> *To:* users at lists.opensips.org
> *Subject:* Re: [OpenSIPS-Users] load_balance not using group id in 
> failure route
>
> Hi, Steven!
>
> This is not wrong, this is the desired behaviour in order to use the 
> failover features.
> I see that you have only one destination in group 2. Will this be the 
> final scenario? If yes, then you shouldn't use load balance, but a 
> simple RURI rewriting.
> However, if you want to use multiple gateways from failure route, 
> there is a hack you can do, but I don't recommend it. You can reset 
> the *lb_mask*, *lb_id* and *lb_grp* AVPs just before calling the 
> load_balance function.
>
> Regards,
>
> --
> Ra(zvan Crainea
> OpenSIPS Developer
>
>
> On 01/03/2012 02:34 PM, Steven Lam, KeenSystems B.V. wrote:
>
> Is nobody using this? :-(
>
> I really want to know if I'm doing something wrong here...
>
> Steven
>
> *From:*users-bounces at lists.opensips.org 
> <mailto:users-bounces at lists.opensips.org> 
> [mailto:users-bounces at lists.opensips.org] *On Behalf Of *Steven Lam, 
> KeenSystems B.V.
> *Sent:* donderdag 29 december 2011 14:48
> *To:* users at lists.opensips.org <mailto:users at lists.opensips.org>
> *Subject:* [OpenSIPS-Users] load_balance not using group id in failure 
> route
>
> Hi all,
>
> Using the load balancer on OpenSIPS 1.7.1 I found that when calling 
> load_balance in a failure_route with a group other than the one on the 
> initial call, the load_balance still uses the "old" group.
>
> For example:
>
> The table looks like this:
>
> +----+----------+------------------+-----------+
>
> | id | group_id | dst_uri          | resources |
>
> +----+----------+------------------+-----------+
>
> |  1 |        1 | sip:192.168.9.22 | all=10    |
>
> |  2 |        1 | sip:192.168.9.27 | all=20    |
>
> |  3 |        2 | sip:192.168.9.18 | all=10    |
>
> +----+----------+------------------+-----------+
>
> Script looks like this:
>
> ...
>
> if ( load_balance("1","all") ) {
>
>      xlog("==================> Destination is $du\n");
>
>      t_on_failure("1");
>
>      t_relay();
>
>      exit;
>
> }
>
> ...
>
> failure_route[1] {
>
>  lb_disable();
>
>   if ( load_balance("2","all") ) {
>
>     t_on_failure("1");
>
>     xlog("==================> New destination is $du\n");
>
>     t_relay();
>
>   } else {
>
>     t_reply("500","Error");
>
>   }
>
> }
>
> This will result in routing a INVITE to sip:192.168.9.27, when this 
> fails the INVITE will be routed to sip:192.168.9.22 _/NOT/_ 
> 192.168.9.18. To me this looks wrong.
>
> Is this by design? If so how can I force load_balance to use a uri 
> from group 2 after using one from group 1?
>
> Hope someone can give me some advice on this.
>
> Steven
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> 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/20120103/a9456090/attachment-0001.htm>


More information about the Users mailing list