[OpenSIPS-Users] do_routing with failover to shorter prefix

Răzvan Crainea razvan at opensips.org
Wed Jul 1 06:31:50 EST 2020


Hi, Vic!

You should use the `F` flag for the do_routing() call. Please check 
documentation[1] for more details.

[1] https://opensips.org/docs/modules/3.1.x/drouting#func_do_routing

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 6/25/20 5:59 PM, Ben Newlin wrote:
> Yes, our configuration calls do_routing multiple times for different 
> failover cases. You may want to verify this but I believe that the 
> additional calls will append to the relevant AVPs used by the module, so 
> if you haven’t routed to all destinations, you may need to clear out the 
> AVPs prior to calling it again. I’m not positive on that part though; it 
> may overwrite existing values.
> 
> We created a little helper route to do this:
> 
> route[clear_dr_avps]
> 
> {
> 
>    avp_delete("$avp(dr_ruri)/g");
> 
>    avp_delete("$avp(dr_gw_id)/g");
> 
>    avp_delete("$avp(dr_gw_prfx)/g");
> 
>    avp_delete("$avp(dr_rule_id)/g");
> 
>    avp_delete("$avp(dr_rule_prfx)/g");
> 
>    avp_delete("$avp(dr_carr_id)/g");
> 
> }
> 
> Ben Newlin
> 
> *From: *Users <users-bounces at lists.opensips.org> on behalf of Vic Jolin 
> <adjolin at gmail.com>
> *Reply-To: *OpenSIPS users mailling list <users at lists.opensips.org>
> *Date: *Thursday, June 25, 2020 at 10:49 AM
> *To: *"users at lists.opensips.org" <users at lists.opensips.org>
> *Subject: *[OpenSIPS-Users] do_routing with failover to shorter prefix
> 
> Hi,
> 
> So I have this in my opensips.cfg
> 
> if ( !do_routing($(avp(drgID){s.int 
> <http://s.int>}),,,,,$var(gw_attributes)) ) {
> send_reply(404,"No Route found");
> exit;
> }
> 
> And I know that do_routing will match on the longer prefix on dr_rules 
> table first.
> 
> My question is
> 
> Now after failing on all the routes, can we still do another do_routing 
> with shorter prefix matching?
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 



More information about the Users mailing list