<div dir="ltr">Hi Timo<div><br></div><div>We had some issues changing the $rU as well.</div><div><br></div><div>In the end we wrote a perl function to do it:</div><div><br></div><div><div>sub rewrite_uri {</div><div>    my $m = shift;</div><div>    my $uri = shift;</div><div><span style="white-space:pre">    </span>$m->rewrite_ruri($uri);</div><div>    return -1;</div><div>}</div></div><div><br></div><div>Which we call like so:</div><div><br></div><div>perl_exec("rewrite_uri", <value to set it to>);<br></div><div><br></div><div>If I recall correctly, our issue was that we could not pass in a variable, an avp, or a concatenated string with kamailios rewrite uri function:</div><div><br></div><div><a href="http://www.kamailio.org/wiki/cookbooks/4.2.x/core#rewriteuri">http://www.kamailio.org/wiki/cookbooks/4.2.x/core#rewriteuri</a><br></div><div><br></div><div>The function I just gave above however may be fixed now, it was a year or 2 ago we wrote the perl script.</div><div><br></div><div>I hope that helps.</div><div><br></div><div>All the best.</div><div><br></div><div>Will Ferrer</div><div><br></div><div>Switchsoft Inc</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 28, 2014 at 10:05 AM, Timo Klecker <span dir="ltr"><<a href="mailto:klecker@decoit.de" target="_blank">klecker@decoit.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all!<br>
<br>
Our Kamailio (3.1.4) crashed when modifying the username-Part of a Request<br>
URI using:<br>
<br>
$rU = $(rU{s.strip,6});<br>
<br>
Initial Request URI:<br>
/sbin/kamailio[40658]: NOTICE: <script>: [ INVITE ] Got new Packet to<br>
<a href="mailto:sip%3A123456%3Apass@sip.custom.com">sip:123456:pass@sip.custom.com</a><br>
<br>
The config-script now removed the first 6 chars from the username part and<br>
would replace them in one of the following lines, but Kamailio had problems<br>
here:<br>
<br>
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI<br>
/sbin/kamailio[40658]: NOTICE: <script>:  Strip from Head: Request Username:<br>
<null>  //  $rU<br>
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI<br>
/sbin/kamailio[40658]: ERROR: <core> [action.c:801]: ERROR: do_action: bad<br>
uri <sip::<a href="http://passsip.custom.com" target="_blank">passsip.custom.com</a>>, dropping packet<br>
<br>
<br>
Is there maybe a error when modifying a uri with password this way? Do we<br>
have to change this?<br>
<br>
<br>
<br>
<br>
Ultimately Kamailio crashed:<br>
/sbin/kamailio[40658]: ERROR: <core> [action.c:1513]: run action error at:<br>
:0<br>
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:1761]: do action failed<br>
/sbin/kamailio[40658]: ERROR: <core> [lvalue.c:358]: setting pvar failed<br>
/sbin/kamailio[40658]: ERROR: <core> [lvalue.c:411]: assignment failed at<br>
pos: (319,10-319,34)<br>
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI<br>
<br>
Like 5000 lines more of<br>
/sbin/kamailio[40658]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI<br>
Due to rerouting internal and trying to remove more parts of the request Uri<br>
using $rU = $(rU{s.strip,6});<br>
<br>
Which then concluded to the following:<br>
/sbin/kamailio[40656]: ALERT: <core> [main.c:741]: child process 40660<br>
exited by a signal 11<br>
/sbin/kamailio[40656]: ALERT: <core> [main.c:744]: core was generated<br>
/sbin/kamailio[40656]: INFO: <core> [main.c:756]: INFO: terminating due to<br>
SIGCHLD<br>
/sbin/kamailio[40659]: ERROR: pv [pv_core.c:251]: failed to parse the R-URI<br>
/sbin/kamailio[40682]: INFO: <core> [main.c:807]: INFO: signal 15 received<br>
/sbin/kamailio[40677]: INFO: <core> [main.c:807]: INFO: signal 15 received<br>
/sbin/kamailio[40676]: INFO: <core> [main.c:807]: INFO: signal 15 received<br>
/sbin/kamailio[40678]: INFO: <core> [main.c:807]: INFO: signal 15 received<br>
[...]<br>
<br>
<br>
I will try to recreate this using the new version (4.1.6) on monday.<br>
<br>
<br>
Kind regards<br>
<span class="HOEnZb"><font color="#888888"><br>
Timo Klecker<br>
<br>
<br>
</font></span><br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>