<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>The place to get the final message is in onsend_route, being
      available in the $snd(buf).</p>
    <p>That's when Kamailio figures out everything required for sending
      out (e.g., resolving NAPTR/SRV/CNAME/ANAME/... dns, doing mhomed
      processing to select local socket.a.s.o) and builds the
      appropriate headers like Via, Record-Route, ...</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 08.10.21 09:09, Alberto Izquierdo
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJrN=okxK3qJPFmzG-MgfRM3aAWmYGNpfZvDL6zdonBbtoW1oA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">I see, would it be possible to obtain the final
        message (with the generated Record-Route headers) somehow?
        <div><br>
        </div>
        <div>Thank you.</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, Oct 8, 2021 at 8:51 AM
          Daniel-Constantin Mierla <<a
            href="mailto:miconda@gmail.com" moz-do-not-send="true">miconda@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>
            <p>You have to use $mbu before record_route() because the
              outgoing socket is not known and corresponding
              Record-Route header is added with empty address. Same
              apply for use of msg_apply_changes().</p>
            <p>Cheers,<br>
              Daniel<br>
            </p>
            <div>On 08.10.21 08:28, Alberto Izquierdo wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">It is also worth mentioning that there are
                two Record-Route headers, the first one is the correct
                one and contains a valid value, and this extra one which
                does not appear in the egress INVITE in the pcap.</div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Thu, Oct 7, 2021 at
                  9:18 AM Alberto Izquierdo <<a
                    href="mailto:a.izquierdo@zaleos.net" target="_blank"
                    moz-do-not-send="true">a.izquierdo@zaleos.net</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">Hello Daniel,
                    <div><br>
                    </div>
                    <div>I have just realized about an error in the
                      'Record-Route" header: "Record-Route: <a
                        moz-do-not-send="true"><sip:;r2=on;lr=on;ftag=478.0eb></a>".</div>
                    <div><br>
                    </div>
                    <div>Thanks for the response.</div>
                  </div>
                  <br>
                  <div class="gmail_quote">
                    <div dir="ltr" class="gmail_attr">On Thu, Oct 7,
                      2021 at 9:05 AM Daniel-Constantin Mierla <<a
                        href="mailto:miconda@gmail.com" target="_blank"
                        moz-do-not-send="true">miconda@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>
                        <div>Hello,</div>
                        <div><br>
                        </div>
                        <div>in onsend_route the changes are already
                          applied, use of $mbu makes no sense there --
                          you can see the updated buffer content with
                          $snd(buf).</div>
                        <div><br>
                        </div>
                        <div>Cheers,<br>
                          Daniel</div>
                        <div><br>
                        </div>
                        <div>On 06.10.21 11:43, Alberto Izquierdo wrote:<br>
                        </div>
                        <blockquote type="cite">
                          <div dir="ltr">Hi,<br>
                            <br>
                            I'm getting some CRITICAL logs when
                            accessing the content of the $mbu
                            pseudovariable in a "onsend_route" function.
                            The log lines look like this:<br>
                            <br>
                            ```<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:893 FIXME: null
                            send_sock<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:1479 FIXME:
                            null bind_address<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            CRITICAL core  
                             35847:core/msg_translator.c:493 null send
                            socket<br>
                            ```<br>
                            <br>
                            I've checked the msg_translator.c source
                            file and there are many of `LM_CRIT("FIXME:
                            {message}\n");` calls, and I wonder if the
                            "FIXME" tag relates to the location of the
                            error: a Kamailio error or there is an issue
                            in the user code.<br>
                            <br>
                            Could I have more information about the
                            "FIXME" tag?<br>
                            <br>
                            Thanks in advance!<br>
                          </div>
                          <br>
                          <fieldset></fieldset>
                          <pre>__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">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 href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
                        </blockquote>
                        <p><br>
                        </p>
                        <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
Nov 08-11, 2021 (Europe Timezone) - Nov 22-25, 2021 (America Timezone)
  * <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/" target="_blank" moz-do-not-send="true">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
                      </div>
                    </blockquote>
                  </div>
                </blockquote>
              </div>
            </blockquote>
            <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - Online
Nov 08-11, 2021 (Europe Timezone) - Nov 22-25, 2021 (America Timezone)
  * <a href="https://www.asipto.com/sw/kamailio-advanced-training-online/" target="_blank" moz-do-not-send="true">https://www.asipto.com/sw/kamailio-advanced-training-online/</a></pre>
          </div>
        </blockquote>
      </div>
    </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
Nov 08-11, 2021 (Europe Timezone) - Nov 22-25, 2021 (America Timezone)
  * <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>