[OpenSIPS-Users] Remove Route Header!

morris edery morrisedery at gmail.com
Fri Jun 2 18:16:13 UTC 2023


Hello , and thanks for the reply,  i removed the  send_reply(403...)  but
now on my outbound call Route Header still exist

[image: image.png]

On Fri, Jun 2, 2023 at 6:13 AM Răzvan Crainea <razvan at opensips.org> wrote:

> 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
>
> _______________________________________________
> 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/20230602/bd498b04/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 30978 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/users/attachments/20230602/bd498b04/attachment-0001.png>


More information about the Users mailing list