<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Adding that record route function can be used in branch_route
      only as well, not required to have one call in request_route.</p>
    <p>The suggested idea below, with advertise would be the one I would
      recommend as well.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 16.06.22 17:33, Sergiu Pojoga wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJZsGCnsYCOXGZLtCMfKqx+pdmwjENoDGARE83VScs0VCArmLQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">I just did this quick POC test which worked
          as expected, it added a single RR with public advertised and
          double RR with both public and private advertise for the
          branch that routes to a private interface.
          <div><br>
          </div>
          <div>Prerequisites:</div>
          <div>
            <ul>
              <li>mhomed=1</li>
              <li>modparam("rr", "enable_double_rr", 1)<br>
              </li>
              <li>listen=YOUR_PUB_IP advertise "your_private_fqdn"</li>
              <li>listen=YOUR_PRIV_IP advertise "your_priv_fqdn"</li>
              <li><a href="http://10.22.0.0/24" moz-do-not-send="true">10.22.0.0/24</a>
                is the private net<br>
              </li>
            </ul>
          </div>
          <div>Script:</div>
          <div><br>
          </div>
          <div>request_route {<br>
               record_route();<br>
               seturi("<a href="mailto:sip%3Aa@google.com"
              moz-do-not-send="true">sip:a@google.com</a>");<br>
               append_branch("<a href="mailto:sip%3Ab@10.22.0.1"
              moz-do-not-send="true">sip:b@10.22.0.1</a>", "1.0");<br>
               t_relay();<br>
            }<br>
          </div>
          <div><br>
          </div>
          <div>Give it a try.</div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Thu, Jun 16, 2022 at
            10:36 AM Sergiu Pojoga <<a
              href="mailto:pojogas@gmail.com" moz-do-not-send="true"
              class="moz-txt-link-freetext">pojogas@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">Have you tried just <b>record_route()</b> with
              <i>enable_double_rr</i> option enabled? All things
              considered, RR should take care of it all by itself, per
              branch.<br>
              <div><br>
              </div>
              <div>A script snippet could help.</div>
            </div>
            <br>
            <div class="gmail_quote">
              <div dir="ltr" class="gmail_attr">On Thu, Jun 16, 2022 at
                10:05 AM Patrick Karton <<a
                  href="mailto:patrickarton@hotmail.com" target="_blank"
                  moz-do-not-send="true" class="moz-txt-link-freetext">patrickarton@hotmail.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="auto">It only work for request route.</div>
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">Le 16 juin 2022 14:19, Ilie
                    Soltanici <<a href="mailto:iliusha.md@gmail.com"
                      target="_blank" moz-do-not-send="true"
                      class="moz-txt-link-freetext">iliusha.md@gmail.com</a>>
                    a écrit :<br type="attribution">
                    <blockquote style="margin:0px 0px 0px
                      0.8ex;border-left:1px solid
                      rgb(204,204,204);padding-left:1ex">
                      <div dir="ltr">Hello,
                        <div><br>
                        </div>
                        <div>Thank you, added it now - still the same,
                          unfortunately.</div>
                        <div><br>
                        </div>
                        <div>Regards,</div>
                      </div>
                      <br>
                      <div>
                        <div dir="ltr">On Thu, 16 Jun 2022 at 13:29,
                          Sergiu Pojoga <<a
                            href="mailto:pojogas@gmail.com"
                            target="_blank" moz-do-not-send="true"
                            class="moz-txt-link-freetext">pojogas@gmail.com</a>>
                          wrote:<br>
                        </div>
                        <blockquote style="margin:0px 0px 0px
                          0.8ex;border-left:1px solid
                          rgb(204,204,204);padding-left:1ex">
                          <div dir="ltr">Have you tried calling <b>t_save_lumps()</b>
                            before relaying, even before RR?</div>
                          <br>
                          <div>
                            <div dir="ltr">On Thu, Jun 16, 2022 at 7:59
                              AM Ilie Soltanici <<a
                                href="mailto:iliusha.md@gmail.com"
                                target="_blank" moz-do-not-send="true"
                                class="moz-txt-link-freetext">iliusha.md@gmail.com</a>>
                              wrote:<br>
                            </div>
                            <blockquote style="margin:0px 0px 0px
                              0.8ex;border-left:1px solid
                              rgb(204,204,204);padding-left:1ex">
                              <div dir="ltr">Hello,
                                <div><br>
                                </div>
                                <div>Is there any way to advertise a
                                  different IP Address in the
                                  Record-Route header individually per
                                  branch?</div>
                                <div><br>
                                </div>
                                <div>I have a setup here - where
                                  Kamailio is listening on 2 different
                                  interfaces: Local IP and External IP.
                                  At the moment if the packet is coming
                                  through the internal interface - I'm
                                  checking where is it going to and
                                  based on that I'm setting the
                                  Record-Route header accordingly - and
                                  everything works well, except when I
                                  have multiple branches: one going
                                  through the internal interface and
                                  another one through the external one,
                                  so in this case, I have to add a
                                  different record-route header per
                                  branch, by doing this in the
                                  branch_route - it's not working and
                                  getting the
                                  error: w_record_route_advertised_address():
                                  Double attempt to record-route.</div>
                                <div><br>
                                </div>
                                <div>What would be another way to
                                  accomplish this?</div>
                              </div>
__________________________________________________________<br>
                              Kamailio - Users Mailing List - Non
                              Commercial Discussions<br>
                                * <a
                                href="mailto:sr-users@lists.kamailio.org"
                                target="_blank" moz-do-not-send="true"
                                class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a><br>
                              Important: keep the mailing list in the
                              recipients, do not reply only to the
                              sender!<br>
                              Edit mailing list options or unsubscribe:<br>
                                * <a
                                href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                                target="_blank" moz-do-not-send="true"
                                class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                            </blockquote>
                          </div>
__________________________________________________________<br>
                          Kamailio - Users Mailing List - Non Commercial
                          Discussions<br>
                            * <a
                            href="mailto:sr-users@lists.kamailio.org"
                            target="_blank" moz-do-not-send="true"
                            class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a><br>
                          Important: keep the mailing list in the
                          recipients, do not reply only to the sender!<br>
                          Edit mailing list options or unsubscribe:<br>
                            * <a
                            href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                            target="_blank" moz-do-not-send="true"
                            class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
                        </blockquote>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
__________________________________________________________<br>
                Kamailio - Users Mailing List - Non Commercial
                Discussions<br>
                  * <a href="mailto:sr-users@lists.kamailio.org"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">sr-users@lists.kamailio.org</a><br>
                Important: keep the mailing list in the recipients, do
                not reply only to the sender!<br>
                Edit mailing list options or unsubscribe:<br>
                  * <a
                  href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users"
                  rel="noreferrer" target="_blank"
                  moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
              </blockquote>
            </div>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * <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 - Online: June 20-23, 2022
  * <a class="moz-txt-link-freetext" href="https://www.asipto.com/sw/kamailio-advanced-training-online/">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
  </body>
</html>