<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    not sure I got what you tried in the past, but updating the r-uri
    value was for very long time (perhaps from like 2006) possible by
    assigning an expression to $ru. like:<br>
    <br>
    $ru = "sip:"+$var(user) + "@" + $var(domain);<br>
    <br>
    rewrite_uri() function from core worked always with static  value as
    parameter.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 01/12/14 23:20, Will Ferrer wrote:<br>
    </div>
    <blockquote
cite="mid:CA+pifNQqZTDojyAa7kkcZMLLhj0eisVN84Bf3sBHJA6W9CG86Q@mail.gmail.com"
      type="cite">
      <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 moz-do-not-send="true"
            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 moz-do-not-send="true"
              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 moz-do-not-send="true"
              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 moz-do-not-send="true"
              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 moz-do-not-send="true"
              href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <a moz-do-not-send="true"
              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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>