<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><tt>Hello Anup,<br>
        <br>
        If you need to make different changes per branch, you need to
        use the uac_replace_to() function from the branch route . See:<br>
               
        <a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Script-Routes-1-10#toc2">http://www.opensips.org/Documentation/Script-Routes-1-10#toc2</a><br>
        <br>
        Do the change only in that route, as changes in such route are
        per branch and not global (so changes will not be inherited between
        the branches of a serial forking).<br>
        <br>
        Regards,<br>
      </tt>
      <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
      On 10.12.2013 05:25, RuvixTel wrote:<br>
    </div>
    <blockquote
      cite="mid:162C0024-210B-4293-8E63-3F4A38F696A6@gmail.com"
      type="cite">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div style="-webkit-text-size-adjust: auto;">Hi Bogdan,</div>
      <div style="-webkit-text-size-adjust: auto;"><br>
      </div>
      <div><span style="-webkit-text-size-adjust: auto;
          background-color: rgba(255, 255, 255, 0);">Thank you for your
          prompt reply, the issue we are trying to resolve here is: How
          to replace a previously created TO URI header with a new URI?<br>
           <br>
          Example: we have 3 IPs added to our SIP server and they are
          prioritised as below:<br>
          IP one (1.1.1.1) – Priority 01- has a prefix 02#<br>
          IP two (2.2.2.2) – Priority 02- has a prefix 07<br>
          IP three (3.3.3.3) – Priority 03- has no prefix<br>
           <br>
          I want to terminate a call to 61415777075number.<br>
           <br>
          Then using uac_replace_to function we are able to change it
          as02#<a moz-do-not-send="true"
            href="http://61415777075@1.1.1.1:5060/">61415777075@1.1.1.1:5060</a><br>
          Now this call is failed to terminate it through IP 1.1.1.1 and
          we need to change it to<a moz-do-not-send="true"
            href="http://0761415777075@2.2.2.2:5060/">0761415777075@2.2.2.2:5060</a> (in
          order to try next IP as 07 is prefix for second ip) but while
          we are trying to do this using same uac replace : SIP is
          changing it to:<br>
          02#<a moz-do-not-send="true"
            href="http://61415777075@1.1.1.1:5060/">61415777075@1.1.1.1:5060</a><a
            moz-do-not-send="true"
            href="http://sip:0761415777075@2.2.2.2:5060/">sip:0761415777075@2.2.2.2:5060</a><br>
           <br>
          What is happening above is: SIP is appending both RUIs in one.<br>
          But we want this to be<a moz-do-not-send="true"
            href="http://0761415777075@2.2.2.2:5060/">0761415777075@2.2.2.2:5060</a>.<br>
           <br>
          We already tried RURI but it didn’t gave us our expected
          result; we are able to change RURI any number of times but the
          IP example 1.1.1.1 is not getting the prefix 02 in TO header
          of INVITe packet due to which gateway is unable to connect the
          call.</span></div>
      <div><span style="-webkit-text-size-adjust: auto;"><br>
        </span></div>
      <div><span style="-webkit-text-size-adjust: auto;">Your assistance
          to resolve this issue will be appreciated. <br>
        </span><br>
        <span style="-webkit-text-size-adjust: auto;">Cheers</span>
        <div style="-webkit-text-size-adjust: auto;">Anup </div>
      </div>
      <div style="-webkit-text-size-adjust: auto;"><br>
        On 10 Dec 2013, at 4:51 am, Bogdan-Andrei Iancu &lt;<a
          moz-do-not-send="true" href="mailto:bogdan@opensips.org">bogdan@opensips.org</a>&gt;
        wrote:<br>
        <br>
      </div>
      <blockquote type="cite" style="-webkit-text-size-adjust: auto;">
        <div>
          <meta content="text/html; charset=UTF-8"
            http-equiv="Content-Type">
          <div class="moz-cite-prefix"><tt>Hello,<br>
              <br>
              Using a proper script logic you can get to replacing the
              TO/FROM hdr only once per branch - keep the new value into
              a variable (like AVP) so you can change it as many times
              you need -&gt; before seding the call out, do the actual
              replace.<br>
              <br>
              If you need to do the change per branch, you need to put
              the uac_replace_xxx in the branch route !<br>
              <br>
              Regards,<br>
            </tt>
            <pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
            On 09.12.2013 13:57, AMPTEL PTY LTD | RuvixTel wrote:<br>
          </div>
          <blockquote
cite="mid:CAHv6A0PHaaXAjkbLD2fRCFCSv2cbAmybV7_AWg6_KdX9RmaJ-w@mail.gmail.com"
            type="cite">
            <div dir="ltr">
              <div class="gmail_default" style="font-family:trebuchet
                ms,sans-serif"><font color="#000000" face="Times New
                  Roman" size="3"> </font>
                <p style="margin:0cm 0cm 10pt"><font color="#000000"
                    face="Calibri" size="3">Hi all</font></p>
                <font color="#000000" face="Times New Roman" size="3"> </font>
                <p style="margin:0cm 0cm 10pt"><font color="#000000"
                    face="Calibri" size="3">Just wondering, if anyone
                    able to assist us with below:</font></p>
                <font color="#000000" face="Times New Roman" size="3"> </font>
                <p style="margin:0cm 0cm 10pt"><font color="#000000"
                    face="Calibri" size="3">We are using Opensips 1.6
                    and we like to know: how can we replace URI Header
                    more than once per call? </font></p>
                <font color="#000000" face="Times New Roman" size="3"> </font>
                <p style="margin:0cm 0cm 10pt"><font color="#000000"
                    face="Calibri" size="3">uac_replace_to function is
                    there but when we try this second time: instead of
                    replacing it. It just appended two headers.</font></p>
                <font color="#000000" face="Times New Roman" size="3"> </font>
                <p style="margin:0cm 0cm 10pt"><font color="#000000"
                    face="Calibri" size="3">What we are trying to
                    achieve here is call Fail Over function? When one IP
                    is unable to terminate a call it will try next IP
                    from the priority list. </font></p>
                <font color="#000000" face="Times New Roman" size="3"> </font>
                <p style="margin:0cm 0cm 10pt"><font color="#000000"
                    face="Calibri" size="3">Your assistance will be
                    highly appreciated. </font></p>
                <p style="margin:0cm 0cm 10pt"><font color="#000000"
                    face="Calibri" size="3">If this issue has been
                    discussed earlier please direct me to the thread
                    please. </font></p>
                <font color="#000000" face="Times New Roman" size="3"> </font><br
                  clear="all">
              </div>
              <div>
                <div dir="ltr"><span style="font-family:georgia,serif"><font
                      color="#888888">
                      <div>
                        <div
                          style="color:rgb(34,34,34);font-family:arial,sans-serif">
                          <div><font face="garamond, serif">--<br>
                              Best Regards +<br>
                              <div class="gmail_default"
                                style="font-family:trebuchet
                                ms,sans-serif;display:inline">Anup </div>
                              <br>
                            </font><font face="garamond, serif"><br>
                              ________________________<br>
                            </font>
                            <div><br>
                            </div>
                            <div><font face="garamond, serif"><font
                                  color="#222222">Ph:  </font></font><a
                                moz-do-not-send="true"
                                style="color:rgb(17,85,204);font-family:garamond,serif"
                                value="+8801973299588">+61 413 777 075 </a><span
                                style="font-family:garamond,serif">(Anup)</span></div>
                            <div><br>
                            </div>
                          </div>
                          <div><font face="garamond, serif"><br>
                            </font></div>
                        </div>
                      </div>
                    </font> </span></div>
              </div>
            </div>
            <br>
            <fieldset class="mimeAttachmentHeader"></fieldset>
            <br>
            <pre wrap="">_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
          </blockquote>
          <br>
        </div>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>