[OpenSIPS-Users] limiting the number of gateways tried in lcr module

Brett Nemeroff brett at nemeroff.com
Thu May 28 15:03:14 CEST 2009


I don't entirely remember the way the arming of the flags works and how they
persist across failure_routes. Maybe someone can comment on that?
Instead of using flags, call:
               $avp(i:500) = 1; # Initialize counter of failed attempts

from your main route block, before failure route is called.

Let us know how that works for you..
-Brett

On Thu, May 28, 2009 at 7:34 AM, Andrew Pogrebennyk <
andrew.pogrebennyk at portaone.com> wrote:

> Brett Nemeroff wrote:
>
>> You should be able to track this with avps. What version are you running?
>> I
>> know that in at least the newer versions of opensips, this
>> is definitely supported:http://www.opensips.org/Resources/DocsCoreVar14
>> "The AVPS will be visible in all routes where any message (reply or
>> request)
>> of the transaction will be processed - branch_route , failure_route,
>> onreply_route (for this last route you need to enable the TM parameter *
>> onreply_avp_mode*)."
>>
>
> Thanks. I don't have the config or the logs at hand at this moment but I
> tried something like this yesterday:
>
> failure_route[1] {
>        if (!isflagset(31)) {
>                $avp(i:500) = 1; # Initialize counter of failed attempts
>                setflag(31);
>        } else {
>                $avp(i:500) = $avp(i:500) + 1; # OR:
>                # avp_op("$avp(i:500)", "add/1");
>        }
>        if ($avp(i:500) > 2) {
>                t_reply("503", "Couldn't complete the call");
>                exit;
>        }
>        if (next_gw()) {
>                t_on_failure("1");
>                t_relay();
>        } else {
>                t_reply("503", "No gateways");
>                exit;
>        };
> }
>
> As a result of incrementing AVP variable, no matter which way, the OpenSIPS
> sends out some junk and then crashes... I'm using 1.4.4.
>
> --
> Sincerely,
> Andrew Pogrebennyk
> PortaOne, Inc., QA Engineer
> andrew.pogrebennyk at portaone.com
> Tel: +1-866-SIP VOIP (+1 866 747 8647) ext. 7133
>
> Meet us on June 1-3 at ITW, Booth 802
> Marriott Wardman Park Hotel, Washington, DC
> http://www.internationaltelecomsweek.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090528/8d83e239/attachment.htm 


More information about the Users mailing list