<div dir="ltr">Hi Daniel,<div><br></div><div>thanks! This works!</div><div><br></div><div>Thanks again, Kamailio is great!</div><div>Carsten</div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">--</div><div dir="ltr">Carsten Bock I CTO & Founder</div><div dir="ltr"><br><p style="margin:0cm 0cm 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial"><span lang="EN-US" style="color:black">ng-voice GmbH</span><span lang="EN-US" style="color:rgb(0,112,192)"><u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm;background-image:initial;background-position:initial;background-repeat:initial"><span lang="EN-US" style="color:black">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/" style="color:rgb(17,85,204)" target="_blank"><span style="color:black">www.ng-voice.com</span></a><u></u><u></u></span></p><p style="margin:0cm 0cm 0.0001pt;background-image:initial;background-position:initial;background-repeat:initial"><span lang="EN-US" style="color:black">Registry Office at Local Court Hamburg, HRB 120189<br>Managing Directors: Dr. David Bachmann, Carsten Bock</span></p></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Mo., 18. Mai 2020 um 22:17 Uhr schrieb Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Can you try with a variable:</p>
<p>$var(x) = "a=sendrecv\r\na=curr:qos local none";</p>
<p>and use it inside the s.replace transformation.</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>On 18.05.20 19:21, Carsten Bock wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">Sorry for the confusion - my initial example
contained a typo. The right version:
<div dir="auto"><br>
</div>
<div dir="auto">
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">[...]<br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">$sht(sdp=>$ci) =
$(rb{s.replace,a=sendrecv,a=sendrecv\r\na=curr:qos local
none});<br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">[...]</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">set_reply_body("$sht(sdp=>$ci)",
"application/sdp");<br>
send_reply("200", "OK");<br>
[...]<br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">It works like a charm, however I'm facing one
small issue:</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">My SDP looks like this:</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">[...]<br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">a=rtpmap:8 PCMA/8000<br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">a=sendrecv\r\na=curr:qos local none<br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">a=rtcp:34949</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">[...]</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">Thanks,</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">Carsten</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto"><br>
</div>
<div style="font-family:sans-serif;font-size:12.8px" dir="auto">P.S.: Never write emails between two meetings...</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>>
schrieb am Mo., 18. Mai 2020, 18:35:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hello,</p>
<p>is not clear to me: so when you had it with one
backslash, it was the two chars '\n' in sdp, when it was
\\n was it with 2 backslashes (3 chars)?</p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>On 18.05.20 17:58, Carsten Bock wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">
<div>Hi Daniel,
<div dir="auto"><br>
</div>
<div dir="auto">Unfortunately, I already had replaced
that. While I had the two \\ in config, I also had
two \\ in the SDP...</div>
<div dir="auto"><br>
</div>
<div dir="auto">Thanks,</div>
<div dir="auto">Carsten </div>
<br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Daniel-Constantin
Mierla <<a href="mailto:miconda@gmail.com" rel="noreferrer" target="_blank">miconda@gmail.com</a>>
schrieb am Mo., 18. Mai 2020, 17:49:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<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>On 18.05.20 16:32, Carsten Bock wrote:<br>
</div>
<blockquote type="cite">
<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" rel="noreferrer noreferrer" target="_blank">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></fieldset>
<pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a href="mailto:sr-users@lists.kamailio.org" rel="noreferrer noreferrer" target="_blank">sr-users@lists.kamailio.org</a>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" rel="noreferrer noreferrer" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" rel="noreferrer noreferrer" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" rel="noreferrer noreferrer" target="_blank">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" rel="noreferrer noreferrer" target="_blank">https://www.paypal.me/dcmierla</a></pre>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" rel="noreferrer" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" rel="noreferrer" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" rel="noreferrer" target="_blank">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" rel="noreferrer" target="_blank">https://www.paypal.me/dcmierla</a></pre>
</div>
</blockquote>
</div>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" target="_blank">https://www.paypal.me/dcmierla</a></pre>
</div>
</blockquote></div>