<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>assigning to $fn, $fu or $fU is offered as a convenience way to
      update parts of From header, but the changes are not applied
      immediately, like the other operations done over the SIP headers
      -- see more details in the FAQ:</p>
    <p>  - <a
href="https://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or">https://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or</a></p>
    <p>In your case, try to do those changes only in branch_route.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 17.10.19 20:59, Jurijs Ivolga wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOrA2Ua6m7_epPQ7iw_18E2NBGOD0Dj4vbaxCzOxMBJUwX8AnQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi,</div>
        <div><br>
        </div>
        <div>Just to add one more point that $fU & $fn I'm checking
          not in script but in SIP packet. So using sngrep i see in SIP
          packet from header where $fU and $fn are "1234567+123456".</div>
        <div><br>
        </div>
        <div>
          <div>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">Jurijs<br>
              </div>
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Oct 17, 2019 at 1:06
          PM Jurijs Ivolga <<a href="mailto:jurijs.ivolga@gmail.com"
            moz-do-not-send="true">jurijs.ivolga@gmail.com</a>>
          wrote:<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 dir="ltr">Hi! <br>
            <br>
            I have small problem. When I assign $fU or $fn in
            request-route and then one more time I make new assignment
            in branch_route.  Instead of rewriting it is just
            concatenate needed value at the end. lets assume
            $avp(cli)=1234567 and $avp(cliplus)=+1234567. So if in
            request_route I do $fU=$avp(cli); and then in
            branch_route $fU=$avp(cliplus);. $fU becomes one string:
            "1234567+1234567". Is it a bug or I missing something?
            <div><br>
            </div>
            <div>Here is config snippet:</div>
            <div><br>
            </div>
            <div>request_route {</div>
            <div>...</div>
            <div>route(MY);<br>
            </div>
            <div>...<br>
            </div>
            <div>}<br>
            </div>
            <div><br>
            </div>
            <div>route[MY] {<br>
              <br>
              ...<br>
                      $avp(cli) = "1234567"<br>
                      $avp(cliplus) = "+"+$avp(cli);<br>
                      $fU=$avp(cli); # here $fU=1234567<br>
                      $fn=$avp(cli); # here $fn=1234567<br>
                      route(LCR_ROUTE);<br>
                      exit;<br>
              }<br>
              <br>
              route[LCR_ROUTE]<br>
              {<br>
                      if(!is_method("INVITE"))<br>
                              return;<br>
                      if (!load_gws("1",$rU,$avp(cli))) {<br>
                              send_reply("503", "Error loading
              gateways");<br>
                              exit;<br>
                      }<br>
              <br>
                      $var(i)=0;<br>
                      while($(avp(lcr_gw_uri)[$var(i)])!= $null){<br>
                              xlog("L_INFO", "loaded
              gw_uri_avp[$var(i)]=$(avp(lcr_gw_uri)[$var(i)]) \n");<br>
                              $var(i) = $var(i)+1;<br>
                      }<br>
              <br>
                      if (!next_gw()) {<br>
                              send_reply("503", "No available
              gateways");<br>
                              exit;<br>
                      }<br>
              <br>
                      xlog("L_INFO", "request-uri $ru \n");<br>
                      xlog("L_INFO", "$avp(lcr_gw_uri),
              $avp(lcr_id)\n");<br>
              <br>
                      xlog("L_INFO", "flag $avp(lcr_flag) \n");<br>
              <br>
                      t_set_fr(0, 4000);<br>
                      t_on_failure("RTF_LCR_ROUTE");<br>
                      t_on_branch("BRANCH_CUST");<br>
                      route(RELAY);<br>
                      exit;<br>
              }<br>
              <br>
              branch_route[BRANCH_CUST] {<br>
                      if ( $avp(lcr_flag) == 4) {<br>
                              $fU=$avp(cliplus); #here
              $fU=1234567+1234567<br>
                              $fn=$avp(cliplus); #here
              $fn=1234567+1234567<br>
                      }<br>
              }</div>
            <div><br>
            </div>
            <div>
              <div dir="ltr">
                <div dir="ltr">Jurijs<br>
                </div>
              </div>
            </div>
          </div>
        </blockquote>
      </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>
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- <a class="moz-txt-link-freetext" href="https://asipto.com/u/kat">https://asipto.com/u/kat</a></pre>
  </body>
</html>