Re: [OpenSIPS-Users] replace_body() issue

2021-06-18 Thread Miha via Users
I have without ^ and $ before, i have now tried again like you suggested but it does not work. It goes in the if loop ("search_body") but it does not replace inactive with sendonly. I have also look at return code from replace_body and it gives me "-1". Stas Kobzar je 6/18/2021 ob 1:04 PM napis

Re: [OpenSIPS-Users] replace_body() issue

2021-06-18 Thread Stas Kobzar
Hello, Just do not use ^ and $ in the search pattern. It is probably trying to match the whole SDP packet, not single line. On Fri, Jun 18, 2021 at 5:09 AM Miha via Users wrote: > Hello > > have issue with replace_body as it does not change SDP. > My code looks like this: > > if (has_body("appl

[OpenSIPS-Users] replace_body() issue

2021-06-18 Thread Miha via Users
Hello  have issue with replace_body as it does not change SDP. My code looks like this: if (has_body("application/sdp")){             if(search_body("a=inactive")){ *replace_body("^a=inactive$", "a=sendonly");*             }                  $var(rtpengine_flags) ="trust-address replace-origin

Re: [OpenSIPS-Users] replace_body()

2020-03-25 Thread Mark Farmer
I fixed it! :) Sadly it was again my own mistake! I had written in-iface as in-face and out-face as out-face. I think I need an eye test!. Thanks Mark. On Wed, 25 Mar 2020 at 12:33, Mark Farmer wrote: > Now that I've corrected my silly xlog() lines I've got it partially > working, transcodin

Re: [OpenSIPS-Users] replace_body()

2020-03-25 Thread Mark Farmer
Now that I've corrected my silly xlog() lines I've got it partially working, transcoding is working (correct codecs passed in either direction). However the connection & origin IP addresses are incorrect. I tried reversing the in-face & out-face flags but that made no difference. Nearly there, an

Re: [OpenSIPS-Users] replace_body()

2020-03-25 Thread Mark Farmer
Hi Bogdan, thanks for the reply. That was what I ended up trying to do, hence the other question about deleting a line from a pvar but that's another thread. However, I do have a related question. Does the body modification also apply to a reply? The issue I have now is that when I try to apply m

Re: [OpenSIPS-Users] replace_body()

2020-03-20 Thread Bogdan-Andrei Iancu
Hi Mark, You mentioned calling rtpengine before? if so, note that you cannot have more than one change over the same part of the body. And rtpengine is replacing the whole body, so you cannot change a prev change. What you have to do is to tell rtpengine_offer() to provide the new body into a

[OpenSIPS-Users] replace_body()

2020-03-19 Thread Mark Farmer
Hi everyone I am trying to remove a line from the SDP resulting from rtpengine_offer() but it's not working for me. Can anyone tell me what I am doing wrong please? if (is_from_gw("2")) { remove_hf("Contact","g"); insert_hf("Contact: \r\n"); xlog("C

Re: [OpenSIPS-Users] replace_body function question

2015-01-06 Thread Bogdan-Andrei Iancu
Try replace_body_all("^s=xyz$","s=abc") to force also an end of header. Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 06.01.2015 18:03, John Nash wrote: Yes!!..It works. I used EOH because in actual implementation I need to use some regular ex

Re: [OpenSIPS-Users] replace_body function question

2015-01-06 Thread Bogdan-Andrei Iancu
Hi John, I guess you want to replace a line in the message body with replace_body_all(), right ? Give it a test without the EOH : replace_body_all("^s=xyz","s=abc"); Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 02.01.2015 17:06, John Nash w

Re: [OpenSIPS-Users] replace_body function question

2015-01-06 Thread John Nash
Yes!!..It works. I used EOH because in actual implementation I need to use some regular expression ( So that it can change s= line to "xyz" no matter what the original value.) but with EOH (even with hard coded value) it does not work. On Tue, Jan 6, 2015 at 9:28 PM, Bogdan-Andrei Iancu wrote: >

[OpenSIPS-Users] replace_body function question

2015-01-02 Thread John Nash
Has there been some recent changes to this function? I used this function in version 1.6 fine but now not seem to be working. I am trying very simple .. replace_body_all("^s=xyz\r\n","s=abc\r\n"); But it does not work. I tried " strip_body()" and it worked as expected. ___