### Description
Typical client device located behind NAT. If the customer use TLS or TCP transport then `nat_keepalive` cannot be used. Details at [nat_traversal.c#L1389-L1391](https://github.com/kamailio/kamailio/blob/master/src/modules/nat_traversal/n...)
In this case, the TCP session may be expired on the NAT device, and future calls to the user phone not possible.
### Expected behavior Send keep-alive messages for clients connected via TLS and TCP transport after `nat_keepalive` function call.
#### Actual observed behavior Keep-alive messages do not send if phone connected via using TLS or TCP transport.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
``` [root@localhost kamailio]# kamailio -v version: kamailio 5.5.0-dev3 (x86_64/linux) e9624b 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, 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: e9624b compiled on 04:01:18 Nov 10 2020 with gcc 8.3.1 ```
* **Operating System**:
``` [root@localhost kamailio]# cat /etc/os-release NAME="CentOS Linux" VERSION="8 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Linux 8 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8" CENTOS_MANTISBT_PROJECT_VERSION="8" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="8" ```
Closed #2564.
If the client does not send TCP keep-alive SIP message or TCP session timer on NAT router is too low then we have an issue.
As a workaround, I can use the operation system keepalive on the server-side. ``` net.ipv4.tcp_keepalive_time = 75 ```
You can use tcpops tcp_enable_keepalive ( http://www.kamailio.org/docs/modules/devel/modules/tcpops.html#tcpops.f.tcp_...) to enable tcp keepalive per connection.
On Sat, 28 Nov 2020, 16:47 sergey-safarov, notifications@github.com wrote:
If the client does not send TCP keep-alive SIP message or TCP session timer on NAT router is too low then we have an issue.
As a workaround, I can use the operation system keepalive on the server-side.
net.ipv4.tcp_keepalive_time = 75
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/2564#issuecomment-735247057, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO7UZO5DC5MH2QOFXNILX3SSELPBANCNFSM4UF275CA . _______________________________________________ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Thank you Federico, looks a `tcp_keepalive_enable` is an appropriate function for this use case.
If you handle registrations on the same system, then the usrloc (starting with v5.4) can send SIP OPTIONS keepalive to any contact, no matter is udp/tcp/tls.
Thanks, Daniel. in my use case, the registrar and frontend proxy is different nodes.
If you use `path` module in the proxy, then the keepalives from registrar go through it.
yes, this also option. Now I want to try keep NAT related function on the frontend proxy. If no luck, then will try to send OPTION from the registrator.