<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font size="-1">Hi David,<br>
      <br>
      I agree completely, referencing the IP 'should' be directing the
      network layers to that IP as assigned to the interface.<br>
      <br>
      You can see documented in the config (below) that is exactly what
      I have used. I've been testing for days with the local IP that is
      assigned to interface em3. You can even see from the tcpdump
      (below) that the SIP INVITE was being delivered to em3 using that
      IP.<br>
      <br>
      We have 12 SIP trunks running for years, using the 1:1 NAT, so
      this works fine in our networks. Been doing networks for years
      (lots), 1st thing I check is netstat.<br>
      <br>
      Without any question, it was configured correctly. Netstat ONLY
      showed the ONE listing for UDP 10.102.88.81:5060 There weren't
      multiple listeners - just the one. And, it would disappear when
      kamailio was stopped. Returned on kamailio start.<br>
      <br>
      Somehow the kamailio io wait stuff is ignoring interfaces other
      than the first one. All I did was move the IP from em3 to em1,
      restart the network and restart kamailio.<br>
      <br>
      This could be Centos 7 or a Dell driver. Appreciate the help.<br>
      <br>
      Thanks,<br>
      Dan<br>
    </font><br>
    <div class="moz-cite-prefix">David Villasmil wrote on 10/12/21 6:26
      PM:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFGRPVogv2iYfVf1c0SoN6BhLcZ9wY6MZ50oxdXWetVDm8H8Vg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">use the
        <div><br>
        </div>
        <div>listen=udp:YOUR-LOCAL-IP:5060</div>
        <div><br>
        </div>
        <div>then do a netstat to see if it's listening on 5060</div>
        <div><br>
        </div>
        <div><br clear="all">
          <div>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div>Regards,</div>
                <div><br>
                </div>
                David Villasmil
                <div>email: <a
                    href="mailto:david.villasmil.work@gmail.com"
                    target="_blank" moz-do-not-send="true">david.villasmil.work@gmail.com</a></div>
                <div>phone: +34669448337</div>
              </div>
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, Oct 12, 2021 at 11:17
          PM <<a href="mailto:dem@htsweb.com" moz-do-not-send="true">dem@htsweb.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 bgcolor="#FFFFFF">
            <div>Okay, think I discovered something....<br>
              <br>
              I'm attempting to run the kamailio on interface em3 - no
              joy.  I moved the 10.102.88.81 ip to the em1 interface.
              kamailio is showing the UDP packets as received (via my
              horribly simple config below).<br>
              <br>
              This test also answers the firewall question, UDP port is
              allowed.<br>
              <br>
              So, that prompts the question... how do you use kamailio
              with UDP on a specific interface ?  I'm thinking it might
              not do it currently ?<br>
              <br>
              Also, forgive me if I messed up the prior reply to the
              list.<br>
              <br>
              Thanks,<br>
              Dan<br>
              <br>
              <a href="mailto:dem@htsweb.com" target="_blank"
                moz-do-not-send="true">dem@htsweb.com</a> wrote on
              10/12/21 5:28 PM:<br>
            </div>
            <blockquote type="cite"> Hello,<br>
              <br>
              The tcpdump (below) shows packet reaching em3 interface.
              The firewalld command (below) shows UDP port 5060 open.<br>
              <br>
              netcat doesn't do specific interfaces. Can't do ALL
              interfaces, since em4 is a pcap of hundreds of thousands
              of live UDP 5060.<br>
              <br>
              I'll have to write a standalone to prove that the firewall
              allows UDP 5060 through the em3 interface, post
              firewall... (betting it does). Should have test prog
              tomorrow.<br>
              <br>
              Thanks,<br>
              Dan<font size="-1"><br>
              </font><br>
              <div>Daniel-Constantin Mierla wrote on 10/12/21 4:27 PM:<br>
              </div>
              <blockquote type="cite">
                <p>Hello,</p>
                <p>tcpdump and other network sniffers (e.g., ngrep,
                  sngrep) capture the sip traffic before firewall, so
                  even if you see packets with them, the application can
                  still not get them due to firewall.</p>
                <p>To test, you can replace kamailio with netcat
                  listening on UDP port 5060 and see if it receives the
                  sip traffic.</p>
                <p>Cheers,<br>
                  Daniel<br>
                </p>
                <div>On 12.10.21 19:08, <a href="mailto:dem@htsweb.com"
                    target="_blank" moz-do-not-send="true">dem@htsweb.com</a>
                  wrote:<br>
                </div>
                <blockquote type="cite"> <tt>After 4 (long) days of
                    trying to receive any UDP SIP, I'm hoping someone
                    can point out what I'm doing wrong. I've looked at
                    the kamailio code. I'm beginning to think it's the
                    'polling' code, but it looks fine. It could be
                    Centos or a Dell network driver, but not seeing any
                    errors anywhere.</tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>- stock build/compile...</tt><tt><br>
                  </tt><tt>  Version: kamailio 5.5.2 (x86_64/linux)
                    0d53d9</tt><tt><br>
                  </tt><tt>  Compile flags: USE_TCP, USE_TLS, USE_SCTP,
                    TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST,
                    DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC,
                    F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX,
                    FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
                    USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST,
                    HAVE_RESOLV_RES</tt><tt><br>
                  </tt><tt>  MAX_RECV_BUFFER_SIZE=262144</tt><tt><br>
                  </tt><tt>  MAX_URI_SIZE=1024</tt><tt><br>
                  </tt><tt>  BUF_SIZE=65535</tt><tt><br>
                  </tt><tt>  DEFAULT PKG_SIZE=8MB</tt><tt><br>
                  </tt><tt>  DEFAULT SHM_SIZE=64MB</tt><tt><br>
                  </tt><tt>  ADAPTIVE_WAIT_LOOPS=1024</tt><tt><br>
                  </tt><tt>  TCP poll methods: poll, epoll_lt, epoll_et,
                    sigio_rt, select</tt><tt><br>
                  </tt><tt>  Source code revision ID: 0d53d9</tt><tt><br>
                  </tt><tt>  Compiled with: gcc 4.8.5</tt><tt><br>
                  </tt><tt>  Compiled architecture: x86_64</tt><tt><br>
                  </tt><tt>  Compiled on: 08:44:19 Oct 11 2021</tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>Running Centos 7 all updated. Dell R630.</tt><tt><br>
                  </tt><tt># sestatus</tt><tt><br>
                  </tt><tt>SELinux status:                 disabled</tt><tt><br>
                  </tt><tt># firewall-cmd --list-all</tt><tt><br>
                  </tt><tt>  ports: 5666/tcp 873/tcp 873/udp 80/tcp
                    443/tcp 5060/tcp 5060/udp 5061/tcp 5061/udp</tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>- Just trying to send SIP INVITE from trunk
                    provider to R630 kamailio.</tt><tt>..<br>
                  </tt><tt>(SIP trunk) UDP <a
                      href="http://172.200.200.202:5060" target="_blank"
                      moz-do-not-send="true">172.200.200.202:5060</a>
                    -> (firewall) UDP <a
                      href="http://172.250.250.162:5060" target="_blank"
                      moz-do-not-send="true">172.250.250.162:5060</a>
                    -> 1:1 NAT -> (R630) UDP <a
                      href="http://10.102.88.81:5060" target="_blank"
                      moz-do-not-send="true">10.102.88.81:5060</a></tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>- I can 'see' the packet hit the em3
                    network...</tt><tt><br>
                  </tt><tt>#  tcpdump -i em3 -e -vv -n port 5060</tt><tt><br>
                  </tt><tt>11:53:33.260892 99:99:ef:3e:69:c1 >
                    99:99:1c:48:4e:e3, ethertype IPv4 (0x0800), length
                    1366: (tos 0x0, ttl 54, id 20430, offset 0, flags
                    [none], proto UDP (17), length 1352)</tt><tt><br>
                  </tt><tt>    172.200.200.202.sip >
                    10.102.88.81.sip: [udp sum ok] SIP, length: 1324</tt><tt><br>
                  </tt><tt>    INVITE <a
                      href="mailto:sip:+18005551234@172.250.250.162:5060"
                      target="_blank" moz-do-not-send="true">sip:+18005551234@172.250.250.162:5060</a>
                    SIP/2.0</tt><tt><br>
                        ...<br>
                  </tt><tt><br>
                  </tt><tt>At this point, I just need to see a SIP
                    INVITE received. Then I can go back to working on a
                    real config.</tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>I've tried with TCP on/off, listening on all
                    networks, alias on/off, strace and everything else I
                    could think of.</tt><tt> Truly appreciate any
                    guidance.<br>
                  </tt><tt><br>
                  </tt><tt>Tried every sample config possible, but I
                    just need to test receiving the SIP UDP packet, so
                    this 'should' be minimum config...</tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>#!KAMAILIO</tt><tt><br>
                  </tt><tt>debug=9</tt><tt><br>
                  </tt><tt>log_stderror=no</tt><tt><br>
                  </tt><tt>log_facility=LOG_LOCAL0</tt><tt><br>
                  </tt><tt>log_prefix="{$mt $hdr(CSeq) $ci} "</tt><tt><br>
                  </tt><tt>children=2</tt><tt><br>
                  </tt><tt>disable_tcp=yes</tt><tt><br>
                  </tt><tt>udp4_raw=on</tt><tt><br>
                  </tt><tt>auto_aliases=no</tt><tt><br>
                  </tt><tt>alias="<a href="http://sbc01.mysite.com"
                      target="_blank" moz-do-not-send="true">sbc01.mysite.com</a>"</tt><tt><br>
                  </tt><tt>listen=<a moz-do-not-send="true">udp:10.102.88.81:5060</a></tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>loadmodule "debugger.so"</tt><tt><br>
                  </tt><tt>loadmodule "jsonrpcs.so"</tt><tt><br>
                  </tt><tt>loadmodule "kex.so"</tt><tt><br>
                  </tt><tt>loadmodule "corex.so"</tt><tt><br>
                  </tt><tt>loadmodule "sl.so"</tt><tt><br>
                  </tt><tt>loadmodule "rr.so"</tt><tt><br>
                  </tt><tt>loadmodule "pv.so"</tt><tt><br>
                  </tt><tt>loadmodule "textops.so"</tt><tt><br>
                  </tt><tt>loadmodule "siputils.so"</tt><tt><br>
                  </tt><tt>loadmodule "xlog.so"</tt><tt><br>
                  </tt><tt>loadmodule "sanity.so"</tt><tt><br>
                  </tt><tt>loadmodule "ctl.so"</tt><tt><br>
                  </tt><tt>loadmodule "cfg_rpc.so"</tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>modparam("debugger", "cfgtrace", 1)</tt><tt><br>
                  </tt><tt><br>
                  </tt><tt>request_route {</tt><tt><br>
                  </tt><tt>  xlog("SIP received xxxxxxxxxxxxxxxxxxx\n");</tt><tt><br>
                  </tt><tt>}</tt><tt><br>
                    <br>
                    # kamcmd ps<br>
                    11578    main process - attendant<br>
                    11579    udp receiver child=0 sock=<a
                      href="http://10.102.88.81:5060" target="_blank"
                      moz-do-not-send="true">10.102.88.81:5060</a><br>
                    11580    udp receiver child=1 sock=<a
                      href="http://10.102.88.81:5060" target="_blank"
                      moz-do-not-send="true">10.102.88.81:5060</a><br>
                    11581    slow timer<br>
                    11583    timer<br>
                    11584    secondary timer<br>
                    11585    JSONRPCS FIFO<br>
                    11586    JSONRPCS DATAGRAM<br>
                    11587    ctl handler<br>
                  </tt><tt><br>
                  </tt><tt>- I get plenty of logging, but the logging
                    just waits here...</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10060]: INFO: ctl
                    [io_listener.c:210]: io_listen_loop():
                    io_listen_loop: using epoll_lt as the io watch
                    method (auto detected)</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10060]: DEBUG: <core>
                    [core/mem/q_malloc.c:374]: qm_malloc():
                    qm_malloc(0x7fd2a8bae010, 4800) called from core:
                    core/io_wait.c: init_io_wait(469)</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10059]: DEBUG: <core>
                    [core/mem/q_malloc.c:419]: qm_malloc():
                    qm_malloc(0x7fd2a8bae010, 65456) returns address
                    0x7fd2a8c652d8 frag. 0x7fd2a8c652a0 (size=65456) on
                    1 -th hit</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10060]: DEBUG: <core>
                    [core/mem/q_malloc.c:419]: qm_malloc():
                    qm_malloc(0x7fd2a8bae010, 4800) returns address
                    0x7fd2a8c652d8 frag. 0x7fd2a8c652a0 (size=4800) on 1
                    -th hit</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10060]: DEBUG: <core>
                    [core/mem/q_malloc.c:374]: qm_malloc():
                    qm_malloc(0x7fd2a8bae010, 2400) called from core:
                    core/io_wait.c: init_io_wait(516)</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10060]: DEBUG: <core>
                    [core/mem/q_malloc.c:419]: qm_malloc():
                    qm_malloc(0x7fd2a8bae010, 2400) returns address
                    0x7fd2a8c66600 frag. 0x7fd2a8c665c8 (size=2400) on 1
                    -th hit</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10060]: DEBUG: ctl
                    [io_listener.c:246]: io_listen_loop():
                    io_listen_loop: adding socket 8, type 2, transport 3
                    (/var/run/kamailio//kamailio_ctl)</tt><tt><br>
                  </tt><tt>Oct 12 11:38:04 sbc01
                    /usr/local/sbin/kamailio[10060]: DEBUG: ctl
                    [../../core/io_wait.h:375]: io_watch_add(): DBG:
                    io_watch_add(0x7fd2a70a5360, 8, 2, 0x2439960),
                    fd_no=0</tt><tt><br>
                    <br>
                    - The only other thing that I see is transport 3.
                    Isn't that a </tt><tt>UNIXS_SOCK?<br>
                    <br>
                  </tt><br>
                  <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>
                <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>
              </blockquote>
              <br>
            </blockquote>
            <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">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">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>