[SR-Users] s.replace Transformation and Newline

Carsten Bock carsten at ng-voice.com
Mon May 18 17:58:26 CEST 2020


Hi Daniel,

Unfortunately, I already had replaced that. While I had the two \\ in
config, I also had two \\ in the SDP...

Thanks,
Carsten


Daniel-Constantin Mierla <miconda at gmail.com> schrieb am Mo., 18. Mai 2020,
17:49:

> Hello,
>
> I see you have two backslashes \\ for r and n. Have you tried with only
> one?
>
> \\ is supposed to be \ character.
>
> Cheers,
> Daniel
> On 18.05.20 16:32, Carsten Bock wrote:
>
> Hi,
>
> I am trying the following:
> - extract the message body
> - replace some content
> - store it in a hashtable
> - send it out in a reply in later request
>
> I do the following:
>
> [...]
> $sht(sdp=>$ci) = $(rb{s.replace,a=sendrecv,a=sendrecv\\r\\na=curr:qos
> local none});
> [...]
> set_reply_body("$sht(sdp=>$ci)", "application/sdp");
> send_reply("200", "OK");
> [...]
>
> It works like a charm, however I'm facing one small issue:
>
> My SDP looks like this:
> [...]
> a=rtpmap:8 PCMA/8000
> a=sendrecv\r\na=curr:qos local none
> a=rtcp:34949
> [...]
>
> It seems that s.replace is escaping characters.
>
> Anyone any ideas?
>
> Thanks,
> Carsten
>
>
>
>
>
>
>
>
>
> $var(x) = "abababa";
> $(var(x){s.replace,a,c} => "cbcbcbc"
> --
>
> Carsten Bock I CTO & Founder
>
> ng-voice GmbH
>
> Trostbrücke 1 I 20457 Hamburg I Germany
> T +49 40 524 75 93-40 | M +49 179 2021244 I www.ng-voice.com
>
> Registry Office at Local Court Hamburg, HRB 120189
> Managing Directors: Dr. David Bachmann, Carsten Bock
>
> _______________________________________________
> Kamailio (SER) - Users Mailing Listsr-users at lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200518/78d9fbf6/attachment-0001.html>


More information about the sr-users mailing list