<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>the source port of tcp connections is typically an ephemeral
      port, that's due to tcp design and os layer implementation. Newer
      kernels have the option for reuse port for tcp, but even then it
      cannot be guaranteed always -- there should be an option for
      recent kamailios as well.</p>
    <p>Maybe it can be enforced inside the c code of siptrace modue,
      when the hep header is built. I expect port 0 is set when it is
      not known for whatsoever reason.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 18.01.22 13:13, Karsten Horsmann
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFArqsYum8Z_XmNK=bWW8MDyuH7SYGcObeODPGNi06FqK3faEQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello List,
        <div><br>
        </div>
        <div>I observe an interesting behavior. We use siptrace as an
          active capture agent for QXIP HOMER/HEPIC installations.<br
            clear="all">
          <div>The destination port and the source port in the HEPv3
            Header are not correct if you use transport tcp for example.</div>
          <div><br>
          </div>
          <div>My Question: is that intended or a bug and i should fill
            up an issue?</div>
          <div><br>
          </div>
          <div>On udp, it's filled with 5060 or whatever your listening
            directive says.</div>
          <div><br>
          </div>
          <div>I tested that with kamailio 5.5 and kamailio master.</div>
          <div><br>
          </div>
          <div>I attached an HEPv3 capture from two kamailios (master)
            speaking with each other.</div>
          <div>You need the <a
              href="https://github.com/sipcapture/hep-wireshark"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/sipcapture/hep-wireshark</a>
            lua dissector to read the capture.<br>
          </div>
          <div><br>
          </div>
          <div>10.0.2.15 (kamailio with uacreg and sipcapture/HEPv3
            mode)<br>
            192.168.50.4 (kamailio as registrar)<br>
            <br>
            Frame 1 shows an tcp transport register Request from
            10.0.2.15 to 192.168.50.4 in HEPv3.<br>
            The Source Port in the HEP3 Protocol is not correct (its an
            highport / 45419).<br>
            <br>
            Frame 4 shows the 401 answer and the Destination port is 0.<br>
            Frame 7 also had this behavior.<br>
            <br>
            <br>
            ----- params (nearly at the end):<br>
            modparam("siptrace", "duplicate_uri", "MY_HOMER_CAPTURE")<br>
            modparam("siptrace", "hep_mode_on", 1)<br>
            modparam("siptrace", "hep_version", 3)<br>
            modparam("siptrace", "hep_capture_id", MY_HOMER_CAPTURE_ID)
            # capture agent id Limitation: 32-bit for HEPv3.<br>
            modparam("siptrace", "trace_to_database", 0)<br>
            modparam("siptrace", "trace_on", 1)<br>
            modparam("siptrace", "trace_mode", 1) # default 0, if 1 then
            you dont need call siptrace flag or sip_trace()<br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div><br>
          </div>
          -- <br>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">Mit freundlichen Grüßen /
            Kind Regards<br>
            *Karsten Horsmann*<br>
          </div>
        </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
  Feb 21-24, 2022 (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>