[OpenSIPS-Users] Remove Route Header!

Răzvan Crainea razvan at opensips.org
Fri Jun 2 10:11:02 UTC 2023


Hi, Morris!

The code you are trying to run removes the Route header for the outgoing 
message, but the inbound/received INVITE still has the Route header, 
hence loose_route() sees it and denies it.
Do note that loose_route() itself removes the route, if its preloaded, 
so if you do want to accept preloaded routes, simply don't drop them :) 
(i.e. comment the send_reply(403...))

Best regards,

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

On 6/1/23 20:06, morris edery wrote:
> Hello Team,
> I am trying to remove Route Header (seems like preloaded) 
> remove_hf("Route")  but  it's not being removed.
> 
> i tried to put it in several places on the code but no success
> 
>    if (is_method("INVITE"))
>                  {
>                    if (is_present_hf("Route"))
>                    {
>                      xlog("removing Route Header: $(hdr(Route)[0])\n");
> 
>                       remove_hf("Route");
>                      xlog ( "Route Header still present?: 
> $(hdr(Route)[0])\n");
>                    }
>                   route(RELAY);
>                  }
> 
> 
> instead of it goes to
> 
> 
>      if (loose_route())
>                  {
>                    xlog("L_ERR","Attempt to route with preloaded Route's 
> [$fu/$tu/$ru/$ci]")
>                      if (!is_method("ACK")){
>                       send_reply("403","Preload Route denied");
>                      exit;
>                      }
>                  }
> 
> 
> 
> opensips 2.4.8
> 
> 
> what i am doing wrong ?
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list