Re: [OpenSIPS-Users] Remove Route Header!

2023-06-08 Thread Răzvan Crainea
Perhaps you are adding it yourself somewhere in the script. Are you 
calling record_route() in the script?


Best regards,

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

On 6/2/23 23:19, morris edery wrote:

i put the remove_hf()  below

it will remove from the header   Contact and User-Agent and will rename 
the new User-Agent but Route won't remove and still appear on the 
outgoing invite message


route[RELAY] {

      remove_hf("Route");
      remove_hf("Contact");
      remove_hf("User-Agent");
      append_hf("User-Agent: New Agent");

     if (!t_relay()) {
          sl_reply_error();
             }
             exit;
     }

On Fri, Jun 2, 2023 at 6:13 AM Răzvan Crainea > 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@lists.opensips.org 
 > http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Remove Route Header!

2023-06-08 Thread morris edery
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  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@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Remove Route Header!

2023-06-02 Thread morris edery
i put the remove_hf()  below

it will remove from the header   Contact and User-Agent and will rename the
new User-Agent but Route won't remove and still appear on the outgoing
invite message

route[RELAY] {

 remove_hf("Route");
 remove_hf("Contact");
 remove_hf("User-Agent");
 append_hf("User-Agent: New Agent");


if (!t_relay()) {
 sl_reply_error();
}

exit;
}

On Fri, Jun 2, 2023 at 6:13 AM Răzvan Crainea  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@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Remove Route Header!

2023-06-02 Thread Răzvan Crainea

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@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Remove Route Header!

2023-06-01 Thread morris edery
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@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Remove Route Header before forwarding

2019-04-08 Thread John Quick
Sunil,

I see that you didn't get a reply yet to your query.
I have been using the path header in a setup that has two OpenSIPS Proxies -
1) Edge Proxy which adds the header and 2) The Registrar Server
In my setup, I use the loose_route() function in the Edge Proxy to remove
the route header added to INVITE by the Registrar, following lookup.

Something like this:
  if (has_totag()) {
 if (loose_route()) {
 ...

The loose_route() function will remove the route header provided it
described a route to itself. This is the normal situation.
It will also set the destination if the route header contained a
"received=.." parameter. Both of these actions are useful.

If the INVITE then fails, you should be able to catch it in a failure_route
section and from there you could deal with redirection to another
destination.

Hope this helps.

John Quick
Smartvox Limited



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Remove Route Header before forwarding

2019-03-31 Thread Sunil More
Hello Team,

Was checking for an update.

Regards,
Sunil More

On Fri, Mar 29, 2019, 8:07 AM Sunil More  wrote:

> Hi All,
> I am trying to route an inbound call to a registered subscriber with a
> failover to PSTN. The subscriber is registers to my Opensips box via
> another Opensips box. I am using path function to add path to the
> subscribers registration. When I lookup , a Route header is added to the
> INVITE message. However if the subscriber had lost network during this
> lookup the call fails with 408 as progress timeout. At this point when i
> try to failover the call to PSTN network , the Route header causes issues
> with other sip providers and the call fails. I want to remove Route Header
> before forwarding the call.
>
> Could anyone suggest me a method. I have already tried remove_hf , it did
> not work.
>
>
> Thanking You,
> Sunil More
> Ph : 9503338275
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Remove Route Header before forwarding

2019-03-28 Thread Sunil More
Hi All,
I am trying to route an inbound call to a registered subscriber with a
failover to PSTN. The subscriber is registers to my Opensips box via
another Opensips box. I am using path function to add path to the
subscribers registration. When I lookup , a Route header is added to the
INVITE message. However if the subscriber had lost network during this
lookup the call fails with 408 as progress timeout. At this point when i
try to failover the call to PSTN network , the Route header causes issues
with other sip providers and the call fails. I want to remove Route Header
before forwarding the call.

Could anyone suggest me a method. I have already tried remove_hf , it did
not work.


Thanking You,
Sunil More
Ph : 9503338275
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Remove "Route" header in initial (out dialog) INVITE request before forwarding

2018-09-20 Thread Bogdan-Andrei Iancu

Hi Ravi,

why do you say the remove_hf() doesn't work ? do you still see the 
incoming Route hdr in the outbound message ??


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  http://www.opensips-solutions.com
OpenSIPS Bootcamp 2018
  http://opensips.org/training/OpenSIPS_Bootcamp_2018/

On 09/10/2018 08:14 AM, Ravi wrote:


Hello,

I am using opensips (2.3)as Proxy service and my requirement is to  
remove “Route” header in initial (out dialog) INVITE request before 
forwarding to next Hop. This is because I don’t want to follow the 
route set from End Point as I have my internal route.


I tried option “remove_hf("Route")”  from configuration but  still 
Route header is not being removed when forwarding to next Hop.


I cannot use “loose_route” which only remove Route header when matched 
 self  but my requirement is to remove all Route header (if present 
multiple). Please suggest on  how can I do that.


Regards,

V Ravi Kumar



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Remove "Route" header in initial (out dialog) INVITE request before forwarding

2018-09-09 Thread Ravi
Hello,

 

I am using opensips (2.3) as Proxy service and my requirement is to  remove
"Route" header in initial (out dialog) INVITE request before forwarding to
next Hop. This is because I don't want to follow the route set from End
Point as I have my internal route. 

 

I tried option "remove_hf("Route")"  from configuration but  still Route
header is not being removed when forwarding to next Hop. 

 

I cannot use "loose_route" which only remove Route header when matched  self
but my requirement is to remove all Route header (if present multiple).
Please suggest on  how can I do that.

 

Regards,

V Ravi Kumar

 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Remove "Route" header in initial (out dialog) INVITE request before forwarding

2018-09-08 Thread Ravi
Hello,

 

I am using opensips as Proxy service and my requirement is to  remove
"Route" header in initial (out dialog) INVITE request before forwarding to
next Hop. This is because I don't want to follow the route set from End
Point as I have my internal route.

 

I tried option "remove_hf("Route")"  from configuration but  still Route
header is not being removed when forwarding to next Hop. 

 

I cannot use "loose_route" which only remove Route header when matched  self
but my requirement is to remove all Route header (if present multiple).
Please suggest on  how can I do that.

 

Regards,

V Ravi Kumar

 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users