Re: [SR-Users] help with string modification

2016-12-01 Thread Sergey Basov
Hi, All. One more question related to remove_hf... I have added route: # Fix user-agent and server route[RemoveHeader] { remove_hf("server"); remove_hf("user-agent"); return; } I use it form request_route { route(RemoveHeader); . } failure_route[--- all what i

Re: [SR-Users] help with string modification

2016-11-28 Thread Daniel Tryba
On Fri, Nov 25, 2016 at 06:55:34PM +0200, Sergey Basov wrote: > Is it safe to use remove_hf("User-Agent") without check if this header > exist? > or better use if(is_present_hf("User-Agent")) { remove_hf("User-Agent"); } ? Just remove_hf is enough. is_present_hf/remove_hf might be more readable th

Re: [SR-Users] help with string modification

2016-11-25 Thread Sergey Basov
Thank you Daniel. Is it safe to use remove_hf("User-Agent") without check if this header exist? or better use if(is_present_hf("User-Agent")) { remove_hf("User-Agent"); } ? Thank you. 25 нояб. 2016 г. 2:56 PM пользователь "Daniel Tryba" написал: > On Fri, Nov 25, 2016 at 02:08:07PM +0200, Serg

Re: [SR-Users] help with string modification

2016-11-25 Thread Daniel Tryba
On Fri, Nov 25, 2016 at 02:08:07PM +0200, Sergey Basov wrote: > Hello All. > > I have some troubles with upstream sip switch. > It ignores SIP packets which contains: > > User-Agent: FPBX-2.11.0(11.17.1) > or > Server: User-Agent: FPBX-2.11.0(11.17.1) > > If space is present before first "(" the

[SR-Users] help with string modification

2016-11-25 Thread Sergey Basov
Hello All. I have some troubles with upstream sip switch. It ignores SIP packets which contains: User-Agent: FPBX-2.11.0(11.17.1) or Server: User-Agent: FPBX-2.11.0(11.17.1) If space is present before first "(" then sip switch works as expected So my question is: how corektly make analyze and m