<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello,</p>
<p>I see you have two backslashes \\ for r and n. Have you tried
with only one?</p>
<p>\\ is supposed to be \ character.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div class="moz-cite-prefix">On 18.05.20 16:32, Carsten Bock wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOCjumEo_WS7ZxcwFZxc8A2PF6tLV99SR=9LrjWSDB8G4m9Xag@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>I am trying the following:</div>
<div>- extract the message body</div>
<div>- replace some content</div>
<div>- store it in a hashtable</div>
<div>- send it out in a reply in later request</div>
<div><br>
</div>
<div>I do the following:<br>
</div>
<div><br>
</div>
<div>[...]<br>
</div>
<div>$sht(sdp=>$ci) =
$(rb{s.replace,a=sendrecv,a=sendrecv\\r\\na=curr:qos local
none});<br>
</div>
<div>[...]</div>
<div>set_reply_body("$sht(sdp=>$ci)", "application/sdp");<br>
send_reply("200", "OK");<br>
[...]<br>
</div>
<div><br>
</div>
<div>It works like a charm, however I'm facing one small issue:</div>
<div><br>
</div>
<div>My SDP looks like this:</div>
<div>[...]<br>
</div>
<div>a=rtpmap:8 PCMA/8000<br>
</div>
<div>a=sendrecv\r\na=curr:qos local none<br>
</div>
<div>a=rtcp:34949</div>
<div>[...]<br>
</div>
<div><br>
</div>
<div>It seems that s.replace is escaping characters.</div>
<div><br>
</div>
<div>Anyone any ideas?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Carsten</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>$var(x) = "abababa";<br>
$(var(x){s.replace,a,c} => "cbcbcbc"<br>
</div>
--<br>
<br>
Carsten Bock I CTO & Founder<br>
<br>
ng-voice GmbH<br>
<br>
Trostbrücke 1 I 20457 Hamburg I Germany<br>
T +49 40 524 75 93-40 | M +49 179 2021244 I <a
href="http://www.ng-voice.com" moz-do-not-send="true">www.ng-voice.com</a><br>
<br>
Registry Office at Local Court Hamburg, HRB 120189<br>
Managing Directors: Dr. David Bachmann, Carsten Bock</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
</body>
</html>