James,

Thanks for your responce, but I don't see any pattern involving 20 sec. And it's really for one out of many devices using the same configuration.
But hint to check in the source code is a possible way to start, thanks!

Le jeu. 27 févr. 2025 à 10:08, James Browne <james@frideo.com> a écrit :
Hi
This is new in kamailio (5.8, I think): TCP timeouts. There are two settings about this. The documentation is incorrect: the second one is the timeout for receiving a whole SIP message after some data is received.
- tcp_msg_data_timeout: Duration in seconds for how long to wait till data is received on a new tcp connection. Default 20.
- tcp_msg_read_timeout: Duration in seconds for how long to wait till data is received on a new tcp connection. Default 20.
- https://www.kamailio.org/wikidocs/cookbooks/5.8.x/core/#tcp_msg_data_timeout

I've seen clients connect to kamailio and then send nothing for 20 seconds (they get disconnected).
I've also seen clients get the RFC5626 ping-pong implemented incorrectly, causing kamailio to time out the connection (when one CRLF is received and nothing follows it).
- https://datatracker.ietf.org/doc/html/rfc5626#section-3.5.1

However, your screenshot shows well over 20 seconds without any TCP data, so I'm not sure. My hint is to try tweaking those values (or check whether you have them set higher than 20 seconds) and see whether they're related; the log about "message processing timeout" hints strongly to me that the tcp_msg_read_timeout is involved.

James


On Thu, 27 Feb 2025 at 08:37, Ihor Olkhovskyi via sr-users <sr-users@lists.kamailio.org> wrote:
Hello,

I'm observing a bit strange behavoir of Kamailio, but maybe I'm wrong in my assumptions.
In some cases Kamailio just closes absolutely valid TCP connection, as I see it in Wireshark

image.png

At the same time I do see in Kamailio logs a lots of lines with

tcp_timer_check_connections(): message processing timeout on connection id: XXXXX (state: 0) - closing

I see that many TCP connections are closing (and it's ok as we have mobile devices connected and loosing connections for them is ok)

But for me this connection is perfectly ok looking on TCP keepalives, what can cause this behavoir?

I have these TCP options

tcp_connect_timeout=30
tcp_conn_wq_max=63536
tcp_crlf_ping=yes
tcp_delayed_ack=yes
tcp_fd_cache=yes
tcp_keepalive=yes
tcp_keepcnt=3
tcp_keepidle=30
tcp_keepintvl=10
tcp_linger2=30

Kamailio 5.8.3

Any hints are appreciated.
--
Best regards,
Ihor (Igor)
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!


--
Best regards,
Ihor (Igor)