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 napisal:

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 
mailto:users@lists.opensips.org>> wrote:


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 replace-session-connection  ICE=remove RTP/AVP
rtcp-mux-demux";
                 rtpengine_offer("$var(rtpengine_flags)");

              if(is_audio_on_hold()) {

                    rtpengine_play_media("callee
file=/home/ringback.wav");
                  }

             t_on_reply("1");
}

What could be wrong that inactive is not replaced by sendonly?
On a leg I can see "a=inactive" and also on b leg "a=inactive".


thank you
miha
___
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] 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("application/sdp")){
> if(search_body("a=inactive")){
>  *replace_body("^a=inactive$", "a=sendonly");*
>
> }
>
>  $var(rtpengine_flags) ="trust-address replace-origin
> replace-session-connection  ICE=remove RTP/AVP rtcp-mux-demux";
>  rtpengine_offer("$var(rtpengine_flags)");
>
>   if(is_audio_on_hold()) {
>
> rtpengine_play_media("callee file=/home/ringback.wav");
>   }
>
>  t_on_reply("1");
> }
>
> What could be wrong that inactive is not replaced by sendonly?
> On a leg I can see "a=inactive" and also on b leg "a=inactive".
>
>
> thank you
> miha
> ___
> 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] 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 
replace-session-connection  ICE=remove RTP/AVP rtcp-mux-demux";

                 rtpengine_offer("$var(rtpengine_flags)");

              if(is_audio_on_hold()) {

                    rtpengine_play_media("callee file=/home/ringback.wav");
                  }

             t_on_reply("1");
}

What could be wrong that inactive is not replaced by sendonly?
On a leg I can see "a=inactive" and also on b leg "a=inactive".


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


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, 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, any idea why I have the IP issue?
>
>
> On Wed, 25 Mar 2020 at 11:06, Mark Farmer  wrote:
>
>> 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 modifications to the reply, they are not applied.
>>
>> I set $avp(CallFlow) before sending the INVITE and check it in the reply
>> route in order to apply the rtpengine() flags but the outgoing reply has
>> the wrong media IP & codec,
>>
>> onreply_route[DROUTING_RTPENGINE] {
>>
>> ...
>>
>> if ($rs=~"(2[0-9][0-9])|(183)" && has_body("application/sdp")) {
>> xlog("CUSTOM_LOG: Processing reply $fU Gateway Attribues:
>> $var(gw_attrs)");
>> fix_nated_contact();
>> if (is_from_gw("2") && $avp(CallFlow)=="TPTY_PSTN") {
>> xlog("CUSTOM_LOG: Reply from PSTN to TPTY");
>> setflag(R_PSTN_TPTY);
>> } else if (is_from_gw("2") && $avp(CallFlow)=="PBX_PSTN")
>> {
>> xlog("CUSTOM_LOG: Reply from PSTN to PBX");
>> setflag(R_PSTN_PBX);
>> } else if (is_from_gw("3") && $avp(CallFlow)=="PBX_TPTY")
>> {
>> xlog("CUSTOM_LOG: Reply from TPTY to PBX");
>> setflag(R_TPTY_PBX);
>> } else if (is_from_gw("3") &&
>> $avp(CallFlow)=="PSTN_TPTY") {
>> xlog("CUSTOM_LOG: Reply from MSDR to PSTN");
>> setflag(R_TPTY_PSTN);
>> } else if (is_from_gw("1") && $avp(CallFlow)=="PSTN_PBX")
>> {
>> xlog("CUSTOM_LOG: Reply from PBX to PSTN");
>> setflag(R_PBX_PSTN);
>> } else if (is_from_gw("1") && $avp(CallFlow)=="TPTY_PBX")
>> {
>> xlog("CUSTOM_LOG: Reply from PBX to MSDR");
>> setflag(R_PBX_TPTY);
>> } else xlog("CUSTOM_LOG: No match in on_reply route!");
>> }
>>
>> $var(R_PSTN_TPTY) = "RTP AVP ICE=remove in-face=external
>> out-face=internal codec-mask-PCMA transcode-G722 replace-session-connection
>> replace-origin";
>> $var(R_PSTN_PBX) = "RTP AVP ICE=remove in-face=external
>> out-face=internal replace-session-connection replace-origin";
>> $var(R_TPTY_PBX) = "RTP AVP ICE=remove in-face=internal
>> out-face=internal replace-session-connection replace-origin";
>> $var(R_TPTY_PSTN) = "RTP AVP ICE=remove in-face=internal
>> out-face=external codec-mask-G722 transcode-PCMA replace-session-connection
>> replace-origin";
>> $var(R_PBX_PSTN) = "RTP AVP ICE=remove in-face=internal
>> out-face=external replace-session-connection replace-origin";
>> $var(R_PBX_TPTY) = "RTP AVP ICE=remove in-face=internal
>> out-face=internal codec-mask-PCMA transcode-G722 replace-session-connection
>> replace-origin";
>>
>> if (isflagset(R_PSTN_TPTY)) {
>> xlog("CUSTOM_LOG: Setting up media on reply using
>> variable $$R_PSTN_TPTY $R_PSTN_TPTY");
>> rtpengine_answer("$var(R_PSTN_TPTY)");
>> } else if (isflagset(R_PSTN_PBX)) {
>> xlog("CUSTOM_LOG: Setting up media on reply using
>> variable $$R__PSTN_PBX $R_PSTN_PBX");
>> rtpengine_answer("$var(R_PSTN_PBX)");
>> } else if (isflagset(R_TPTY_PBX)) {
>> xlog("CUSTOM_LOG: Setting up media on reply using
>> variable $$R_TPTY_PBX $R_TPTY_PBX");
>> rtpengine_answer("$var(R_TPTY_PBX)");
>> } else if (isflagset(R_TPTY_PSTN)) {
>> xlog("CUSTOM_LOG: Setting up media on reply using
>> variable $$R_TPTY_PSTN $R_TPTY_PSTN");
>> rtpengine_answer("$var(R_TPTY_PSTN)");
>> } else if (isflagset(R_PBX_PSTN)){
>> xlog("CUSTOM_LOG: Setting up media on reply using
>> variable $$R_PBX_PSTN $R_PBX_PSTN");
>> rtpengine_answer("$var(R_PBX_PSTN)");
>> } else if (isflagset(R_PBX_TPTY)) {
>> xlog("CUSTOM_LOG: Setting up media on reply using
>> variable $$R_PBX_TPTY $R_PBX_TPTY");
>> rtpengine_answer("$var(R_PBX_TPTY)");
>> }
>> }
>>
>>
>> On Fri, 20 Mar 2020 at 11:04, Bogdan-Andrei Iancu 
>> wrote:
>>
>>> Hi Mark,
>>>
>>> You mentio

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, any idea why I have the IP issue?


On Wed, 25 Mar 2020 at 11:06, Mark Farmer  wrote:

> 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 modifications to the reply, they are not applied.
>
> I set $avp(CallFlow) before sending the INVITE and check it in the reply
> route in order to apply the rtpengine() flags but the outgoing reply has
> the wrong media IP & codec,
>
> onreply_route[DROUTING_RTPENGINE] {
>
> ...
>
> if ($rs=~"(2[0-9][0-9])|(183)" && has_body("application/sdp")) {
> xlog("CUSTOM_LOG: Processing reply $fU Gateway Attribues:
> $var(gw_attrs)");
> fix_nated_contact();
> if (is_from_gw("2") && $avp(CallFlow)=="TPTY_PSTN") {
> xlog("CUSTOM_LOG: Reply from PSTN to TPTY");
> setflag(R_PSTN_TPTY);
> } else if (is_from_gw("2") && $avp(CallFlow)=="PBX_PSTN") {
> xlog("CUSTOM_LOG: Reply from PSTN to PBX");
> setflag(R_PSTN_PBX);
> } else if (is_from_gw("3") && $avp(CallFlow)=="PBX_TPTY") {
> xlog("CUSTOM_LOG: Reply from TPTY to PBX");
> setflag(R_TPTY_PBX);
> } else if (is_from_gw("3") && $avp(CallFlow)=="PSTN_TPTY")
> {
> xlog("CUSTOM_LOG: Reply from MSDR to PSTN");
> setflag(R_TPTY_PSTN);
> } else if (is_from_gw("1") && $avp(CallFlow)=="PSTN_PBX") {
> xlog("CUSTOM_LOG: Reply from PBX to PSTN");
> setflag(R_PBX_PSTN);
> } else if (is_from_gw("1") && $avp(CallFlow)=="TPTY_PBX") {
> xlog("CUSTOM_LOG: Reply from PBX to MSDR");
> setflag(R_PBX_TPTY);
> } else xlog("CUSTOM_LOG: No match in on_reply route!");
> }
>
> $var(R_PSTN_TPTY) = "RTP AVP ICE=remove in-face=external
> out-face=internal codec-mask-PCMA transcode-G722 replace-session-connection
> replace-origin";
> $var(R_PSTN_PBX) = "RTP AVP ICE=remove in-face=external
> out-face=internal replace-session-connection replace-origin";
> $var(R_TPTY_PBX) = "RTP AVP ICE=remove in-face=internal
> out-face=internal replace-session-connection replace-origin";
> $var(R_TPTY_PSTN) = "RTP AVP ICE=remove in-face=internal
> out-face=external codec-mask-G722 transcode-PCMA replace-session-connection
> replace-origin";
> $var(R_PBX_PSTN) = "RTP AVP ICE=remove in-face=internal
> out-face=external replace-session-connection replace-origin";
> $var(R_PBX_TPTY) = "RTP AVP ICE=remove in-face=internal
> out-face=internal codec-mask-PCMA transcode-G722 replace-session-connection
> replace-origin";
>
> if (isflagset(R_PSTN_TPTY)) {
> xlog("CUSTOM_LOG: Setting up media on reply using variable
> $$R_PSTN_TPTY $R_PSTN_TPTY");
> rtpengine_answer("$var(R_PSTN_TPTY)");
> } else if (isflagset(R_PSTN_PBX)) {
> xlog("CUSTOM_LOG: Setting up media on reply using variable
> $$R__PSTN_PBX $R_PSTN_PBX");
> rtpengine_answer("$var(R_PSTN_PBX)");
> } else if (isflagset(R_TPTY_PBX)) {
> xlog("CUSTOM_LOG: Setting up media on reply using variable
> $$R_TPTY_PBX $R_TPTY_PBX");
> rtpengine_answer("$var(R_TPTY_PBX)");
> } else if (isflagset(R_TPTY_PSTN)) {
> xlog("CUSTOM_LOG: Setting up media on reply using variable
> $$R_TPTY_PSTN $R_TPTY_PSTN");
> rtpengine_answer("$var(R_TPTY_PSTN)");
> } else if (isflagset(R_PBX_PSTN)){
> xlog("CUSTOM_LOG: Setting up media on reply using variable
> $$R_PBX_PSTN $R_PBX_PSTN");
> rtpengine_answer("$var(R_PBX_PSTN)");
> } else if (isflagset(R_PBX_TPTY)) {
> xlog("CUSTOM_LOG: Setting up media on reply using variable
> $$R_PBX_TPTY $R_PBX_TPTY");
> rtpengine_answer("$var(R_PBX_TPTY)");
> }
> }
>
>
> On Fri, 20 Mar 2020 at 11:04, Bogdan-Andrei Iancu 
> wrote:
>
>> 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 variable (rather then changing the msg), s

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 modifications to the reply, they are not applied.

I set $avp(CallFlow) before sending the INVITE and check it in the reply
route in order to apply the rtpengine() flags but the outgoing reply has
the wrong media IP & codec,

onreply_route[DROUTING_RTPENGINE] {

...

if ($rs=~"(2[0-9][0-9])|(183)" && has_body("application/sdp")) {
xlog("CUSTOM_LOG: Processing reply $fU Gateway Attribues:
$var(gw_attrs)");
fix_nated_contact();
if (is_from_gw("2") && $avp(CallFlow)=="TPTY_PSTN") {
xlog("CUSTOM_LOG: Reply from PSTN to TPTY");
setflag(R_PSTN_TPTY);
} else if (is_from_gw("2") && $avp(CallFlow)=="PBX_PSTN") {
xlog("CUSTOM_LOG: Reply from PSTN to PBX");
setflag(R_PSTN_PBX);
} else if (is_from_gw("3") && $avp(CallFlow)=="PBX_TPTY") {
xlog("CUSTOM_LOG: Reply from TPTY to PBX");
setflag(R_TPTY_PBX);
} else if (is_from_gw("3") && $avp(CallFlow)=="PSTN_TPTY") {
xlog("CUSTOM_LOG: Reply from MSDR to PSTN");
setflag(R_TPTY_PSTN);
} else if (is_from_gw("1") && $avp(CallFlow)=="PSTN_PBX") {
xlog("CUSTOM_LOG: Reply from PBX to PSTN");
setflag(R_PBX_PSTN);
} else if (is_from_gw("1") && $avp(CallFlow)=="TPTY_PBX") {
xlog("CUSTOM_LOG: Reply from PBX to MSDR");
setflag(R_PBX_TPTY);
} else xlog("CUSTOM_LOG: No match in on_reply route!");
}

$var(R_PSTN_TPTY) = "RTP AVP ICE=remove in-face=external
out-face=internal codec-mask-PCMA transcode-G722 replace-session-connection
replace-origin";
$var(R_PSTN_PBX) = "RTP AVP ICE=remove in-face=external
out-face=internal replace-session-connection replace-origin";
$var(R_TPTY_PBX) = "RTP AVP ICE=remove in-face=internal
out-face=internal replace-session-connection replace-origin";
$var(R_TPTY_PSTN) = "RTP AVP ICE=remove in-face=internal
out-face=external codec-mask-G722 transcode-PCMA replace-session-connection
replace-origin";
$var(R_PBX_PSTN) = "RTP AVP ICE=remove in-face=internal
out-face=external replace-session-connection replace-origin";
$var(R_PBX_TPTY) = "RTP AVP ICE=remove in-face=internal
out-face=internal codec-mask-PCMA transcode-G722 replace-session-connection
replace-origin";

if (isflagset(R_PSTN_TPTY)) {
xlog("CUSTOM_LOG: Setting up media on reply using variable
$$R_PSTN_TPTY $R_PSTN_TPTY");
rtpengine_answer("$var(R_PSTN_TPTY)");
} else if (isflagset(R_PSTN_PBX)) {
xlog("CUSTOM_LOG: Setting up media on reply using variable
$$R__PSTN_PBX $R_PSTN_PBX");
rtpengine_answer("$var(R_PSTN_PBX)");
} else if (isflagset(R_TPTY_PBX)) {
xlog("CUSTOM_LOG: Setting up media on reply using variable
$$R_TPTY_PBX $R_TPTY_PBX");
rtpengine_answer("$var(R_TPTY_PBX)");
} else if (isflagset(R_TPTY_PSTN)) {
xlog("CUSTOM_LOG: Setting up media on reply using variable
$$R_TPTY_PSTN $R_TPTY_PSTN");
rtpengine_answer("$var(R_TPTY_PSTN)");
} else if (isflagset(R_PBX_PSTN)){
xlog("CUSTOM_LOG: Setting up media on reply using variable
$$R_PBX_PSTN $R_PBX_PSTN");
rtpengine_answer("$var(R_PBX_PSTN)");
} else if (isflagset(R_PBX_TPTY)) {
xlog("CUSTOM_LOG: Setting up media on reply using variable
$$R_PBX_TPTY $R_PBX_TPTY");
rtpengine_answer("$var(R_PBX_TPTY)");
}
}


On Fri, 20 Mar 2020 at 11:04, Bogdan-Andrei Iancu 
wrote:

> 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 variable (rather then changing the msg), so you can change the value
> of the variable and push it into the msg afterwards.
>
> PS: why do you do record_route_set() + record_route() in the same time ???
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Summit, Amsterdam, May 2020
>   https://www.opensips.org/events/Summit-2020Amsterdam/
>
> On 3/19/20 1:21 PM, Mark Farmer wrote:
>
> 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 wha

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 variable (rather then changing the msg), so you can change the 
value of the variable and push it into the msg afterwards.


PS: why do you do record_route_set() + record_route() in the same time ???

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit, Amsterdam, May 2020
  https://www.opensips.org/events/Summit-2020Amsterdam/

On 3/19/20 1:21 PM, Mark Farmer wrote:

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("CUSTOM_LOG: Call to Microsoft - Adjusting SIP 
Headers & SDP");

set_advertised_address("$var(fqdn)");
record_route_preset("my.fqdn:5061;transport=tls", "XXX.XXX.XXX.XXX:5060");
                add_rr_param(";r2=on");
                record_route();
                if (replace_body("a=setup:actpass","")) {
                        xlog("CUSTOM_LOG: Removed a=setup:actpass line 
from SDP");

                }
}

I have also tried:

if (replace_body("a=setup:actpass\r",""))
and
if (replace_body("a=setup:actpass\r\n",""))

Many thanks
Mark.


___
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] 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("CUSTOM_LOG: Call to Microsoft - Adjusting SIP Headers
& SDP");
set_advertised_address("$var(fqdn)");
record_route_preset("my.fqdn:5061;transport=tls",
"XXX.XXX.XXX.XXX:5060");
add_rr_param(";r2=on");
record_route();
if (replace_body("a=setup:actpass","")) {
xlog("CUSTOM_LOG: Removed a=setup:actpass line from
SDP");
}
}

I have also tried:

if (replace_body("a=setup:actpass\r",""))
and
if (replace_body("a=setup:actpass\r\n",""))

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


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 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 
mailto:bog...@opensips.org>> wrote:


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 wrote:

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.


___
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] 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 wrote:
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.


___
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] 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:

>  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 Developerhttp://www.opensips-solutions.com
>
> On 02.01.2015 17:06, John Nash wrote:
>
>  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.
>
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://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] 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.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users