[SR-Users] Unable to establish TCP connection with Kamailio

Ovidiu Sas osas at voipembedded.com
Thu Jun 17 23:05:14 CEST 2021


It seems that you have fork set to no,
Let kamailio fork and collect logs via syslog (not via stderror).

-ovidiu


On Thu, Jun 17, 2021 at 16:26 Peter Manley <peter.manley at kombea.com> wrote:

> Hello,
>
>
>
> I’m running Kamailio Version 5.3.2 on Ubuntu 20.04. Here my build
> information:
>
>
>
> version: kamailio 5.3.2 (x86_64/linux)
>
> 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_BLACKLIST,
> HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
>
> ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
> BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>
> id: unknown
>
> compiled with gcc 9.2.1
>
>
>
> I have the following configuration set in my kamalio.cfg file:
>
>
>
> ##!define WITH_MYSQL
>
> ##!define WITH_AUTH
>
> ##!define WITH_USRLOCDB
>
> ##!define WITH_TLS
>
> ##!define WITH_HOMER
>
> ##!define WITH_WEBSOCKETS
>
> ##!define WITH_ANTIFLOOD
>
> ##!define WITH_IPV6
>
> ##!define WITH_BRIDGE_ON_FAIL
>
> ##!define WITH_LOCALHOST_WS
>
> ##!define WITH_LOCALHOST_SIP
>
>
>
> #!substdef "!MY_SIP_PORT!5060!g"
>
> #!substdef "!MY_SIPS_PORT!5061!g"
>
> #!substdef "!MY_WS_PORT!8088!g"
>
> #!substdef "!MY_WSS_PORT!8089!g"
>
>
>
> #!substdef "!MY_LOG_FACILITY!LOG_DAEMON!g"
>
>
>
> #!substdef "!MY_IP4_ADDR!172.16.0.57!g"
>
> #!substdef "!IP4_LOCALHOST!127.0.0.1!g"
>
> #!substdef "!MY_WS4_ADDR!tcp:MY_IP4_ADDR:MY_WS_PORT!g"
>
> #!substdef "!MY_WSS4_ADDR!tls:MY_IP4_ADDR:MY_WSS_PORT!g"
>
> #!substdef "!LOCALHOST_WS4_ADDR!tcp:IP4_LOCALHOST:MY_WS_PORT!g"
>
> #!substdef "!LOCALHOST_WSS4_ADDR!tls:IP4_LOCALHOST:MY_WSS_PORT!g"
>
>
>
> #!ifdef WITH_IPV6
>
> #!substdef "!MY_IP6_ADDR![fe80::d6e4:2f5f:e5b7:7dff]!g"
>
> #!substdef "!IP6_LOCALHOST![::1]!g"
>
> #!substdef "!MY_WS6_ADDR!tcp:MY_IP6_ADDR:MY_WS_PORT!g"
>
> #!substdef "!MY_WSS6_ADDR!tls:MY_IP6_ADDR:MY_WSS_PORT!g"
>
> #!substdef "!LOCALHOST_WS6_ADDR!tcp:IP6_LOCALHOST:MY_WS_PORT!g"
>
> #!substdef "!LOCALHOST_WSS6_ADDR!tls:IP6_LOCALHOST:MY_WSS_PORT!g"
>
> #!endif
>
>
>
> #!substdef "!MY_DOMAIN!rtpengine.kombea.io!g"
>
> debug=10         // debug level (cmd line: -dddddddddd)
>
> children=4
>
> #fork=yes
>
> force_rport=yes // Add recieved port to VIA
>
> #log_stderror=no        // (cmd line: -E)
>
>
>
> // Uncomment these lines to enter debugging mode
>
> fork=no
>
> log_stderror=yes
>
>
>
> check_via=no    // (cmd. line: -v)
>
> dns=no          // (cmd. line: -r)
>
> rev_dns=no      // (cmd. line: -R)
>
>
>
> log_facility=MY_LOG_FACILITY
>
>
>
> // Define the listening ports and addresses
>
> port=MY_SIP_PORT
>
> tls_port_no=MY_SIPS_PORT
>
>
>
>
>
> // Define TCP parameters
>
> tcp_children=4
>
> tcp_no_connect=no
>
> tcp_rd_buf_size=16384
>
> tcp_max_connections=2048
>
> tcp_connection_lifetime=3605
>
> disable_tcp=no
>
> #!ifdef WITH_TLS
>
> enable_tls=yes
>
> #!endif
>
>
>
>
>
> listen=MY_IP4_ADDR
>
> #!ifdef WITH_LOCALHOST_SIP
>
> listen=IP4_LOCALHOST
>
> #!endif
>
> #!ifdef WITH_IPV6
>
> listen=MY_IP6_ADDR
>
> #!ifdef WITH_LOCALHOST_SIP
>
> listen=IP6_LOCALHOST
>
> #!endif
>
> #!endif
>
>
>
> #!ifdef WITH_WEBSOCKETS
>
> listen=MY_WS4_ADDR
>
> #!ifdef WITH_LOCALHOST_WS
>
> listen=LOCALHOST_WS4_ADDR
>
> #!endif
>
> #!ifdef WITH_IPV6
>
> listen=MY_WS6_ADDR
>
> #!ifdef WITH_LOCALHOST_WS
>
> listen=LOCALHOST_WS6_ADDR
>
> #!endif
>
> #!endif
>
> #!ifdef WITH_TLS
>
> listen=MY_WSS4_ADDR
>
> #!ifdef WITH_LOCALHOST_WS
>
> listen=LOCALHOST_WSS4_ADDR
>
> #!endif
>
> #!ifdef WITH_IPV6
>
> listen=MY_WSS6_ADDR
>
> #!ifdef WITH_LOCALHOST_WS
>
> listen=LOCALHOST_WSS6_ADDR
>
> #!endif
>
> #!endif
>
> #!endif
>
> #!endif
>
>
>
> force_rport=yes // Add received port to VIA
>
>
>
> loadmodule "pv.so"          // Pseudo-Variable support
>
> loadmodule "xlog.so"        // Formatted logging support
>
> loadmodule "sl.so"          // Stateless request handling
>
> loadmodule "siputils.so"    // SIP utility helpers
>
> loadmodule "sanity.so"      // Sanity check
>
> loadmodule "maxfwd.so"      // Support for Max-Forward header
>
> loadmodule "textops.so"     // Text operations on SIP messages
>
> loadmodule "textopsx.so"    // Extended Text operations on SIP messages
>
> loadmodule "sdpops.so"      // SDP operations
>
> loadmodule "nathelper.so"   // NAT traversal helpers
>
> loadmodule "rr.so"          // Record Route handling
>
> loadmodule "outbound.so"    // Outbound support
>
> loadmodule "path.so"        // Path handling
>
>
>
> #!ifdef WITH_TLS
>
> loadmodule "tls.so"         // TLS Support
>
> #!endif
>
>
>
> #!ifdef WITH_WEBSOCKETS
>
> loadmodule "xhttp.so"       // XHTTP support
>
> loadmodule "websocket.so"   // WebSocket support
>
> #!endif
>
> loadmodule "rtpengine.so"   // RTPEngine control
>
>
>
> #!ifdef WITH_DEBUG
>
> loadmodule "debugger.so"
>
> #!endif
>
>
>
> When I start Kamailio, I see the following in the output to stderr:
>
>
>
> Listening on
>
>              udp: 172.16.0.57:5060
>
>              tcp: 172.16.0.57:5060
>
> Aliases:
>
>              tcp: VRTPENGINE:5060
>
>              udp: VRTPENGINE:5060
>
>
>
> WARNING: no fork mode
>
>  0(6299) INFO: <core> [core/tcp_main.c:5042]: init_tcp(): using epoll_lt
> as the io watch method (auto detected)
>
>
>
> Here’s the problem:
>
>
>
> When I connect via UDP, everything works fine. I can connect and see all
> SIP traffic.
>
>
>
> However, if I try to connect via TCP, I see the initial SYN packet in
> attempting to establish a connection.
>
>
>
> Kamailio responds with an [RST,ACK] message and the TCP connection is
> never established. No further TCP traffic is sent.
>
>
>
> Any ideas on what I’m doing wrong?
>
> <https://www.google.com/maps/search/3400%0D%0A+North+Ashton+Blvd,+Suite+470+%0D%0A+Lehi,%0D%0A+Utah+84043?entry=gmail&source=g>
>
>
>
> *Peter H. Manley, Ph.D.*
>
> Chief Software Architect
>
> KomBea Corporation
>
> 3400 North Ashton Blvd, Suite 470
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__maps.google.com_-3Fq-3D3400-2BNorth-2BAshton-2BBlvd-2C-2BSuite-2B470-2B-250D-250A-2BLehi-2C-2BUtah-2B84043-26entry-3Dgmail-26source-3Dg&d=DwMF-g&c=aXfg9j-An5sFdflqnjAj_USiCjXm5xEBIX8lTgWEt0U&r=ykVOlDeeWPn-JjTs8avieNrFskQ3kNzjf6_Jn_wG5HLeLIRsvzCN4-dJx6BFR4el&m=MMSIepRfj2CXVMH3CH8SghyPAoonRISMH__5bcNFPLM&s=C4toC0HQ2JwHKiamawbqvdjdidlwyhCP0XVneFagwkY&e=>
>
> Lehi, Utah 84043
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__maps.google.com_-3Fq-3D3400-2BNorth-2BAshton-2BBlvd-2C-2BSuite-2B470-2B-250D-250A-2BLehi-2C-2BUtah-2B84043-26entry-3Dgmail-26source-3Dg&d=DwMF-g&c=aXfg9j-An5sFdflqnjAj_USiCjXm5xEBIX8lTgWEt0U&r=ykVOlDeeWPn-JjTs8avieNrFskQ3kNzjf6_Jn_wG5HLeLIRsvzCN4-dJx6BFR4el&m=MMSIepRfj2CXVMH3CH8SghyPAoonRISMH__5bcNFPLM&s=C4toC0HQ2JwHKiamawbqvdjdidlwyhCP0XVneFagwkY&e=>
>
> www.kombea.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kombea.com_&d=DwMF-g&c=aXfg9j-An5sFdflqnjAj_USiCjXm5xEBIX8lTgWEt0U&r=ykVOlDeeWPn-JjTs8avieNrFskQ3kNzjf6_Jn_wG5HLeLIRsvzCN4-dJx6BFR4el&m=MMSIepRfj2CXVMH3CH8SghyPAoonRISMH__5bcNFPLM&s=ocueS1ZL34IN6qr14M-aItGjeJGQ2km5U2zpzO4Fyqw&e=>
>
>
>
> Office:+1.801.610.5808
>
> Mobile +1.801.243.7773
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users at lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>   * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
-- 
VoIP Embedded, Inc.
http://www.voipembedded.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210617/080c3eb1/attachment.htm>


More information about the sr-users mailing list