Hello,
This is not really a Kamailio-side issue, and I think you're going down the wrong path
looking at Kamailio source code.
There are many reasons why browser-based clients become unreachable after a while, and
they can be OS and browser-specific. It's a long and complex topic that is widely
discussed in the industry. One common reason is that all browsers tend to idle inactive
tabs after a while, to reduce resource consumption. This has the effect of breaking
connections they maintain, including WebSocket connections.
If that is indeed the problem here--and it seems quite likely that it is--then solutions
include turning your client application into a PWA (Progressive Web App), or using one of
the various cross-platform web application development frameworks (e.g. Electron), which
allow you to use web technologies (HTML/CSS/JS/etc) inside a browser control to build a
"native" application. This removes most of the restrictions browsers impose on
applications running inside native browser tabs.
In general, you need to tackle this from the client side. There's nothing to debug on
the server. You said it yourself:
"a reload of the webRTC client, triggering a new websocket connection, will clear
the issue".
-- Alex
On Aug 13, 2024, at 1:38 PM, hollis.rhonda--- via
sr-users <sr-users(a)lists.kamailio.org> wrote:
We're seeing an issue where some webRTC clients are not receiving inbound calls.
Kamailio logs show the following error:
WARNING: {1 609669922 INVITE BW152025538120824-895739618(a)10.103.43.11}: <core>
[core/msg_translator.c:3007]: via_builder(): TCP/TLS connection (id: 0) for WebSocket
could not be found
ERROR: {1 609669922 INVITE BW152025538120824-895739618(a)10.103.43.11}: <core>
[core/msg_translator.c:2086]: build_req_buf_from_sip_req(): could not create Via header
ERROR: {1 609669922 INVITE BW152025538120824-895739618(a)10.103.43.11}: tm [t_fwd.c:484]:
prepare_new_uac(): could not build request
ERROR: {1 609669922 INVITE BW152025538120824-895739618(a)10.103.43.11}: tm [t_fwd.c:1764]:
t_forward_nonack(): failure to add branches
DEBUG: {1 609669922 INVITE BW152025538120824-895739618(a)10.103.43.11}: tm [t_funcs.c:358]:
t_relay_to(): t_forward_nonack returned error -2 (-2)
DEBUG: {1 609669922 INVITE BW152025538120824-895739618(a)10.103.43.11}: tm [t_funcs.c:376]:
t_relay_to(): -2 error reply generation delayed
It seems to be happening after the client has been connected to Kamailio for more than 24
hours. The socket connection details look correct in the external DB and in the output of
ws.dump, core.tcp_list, and ul.dump.
A restart of Kamailio or a reload of the webRTC client, triggering a new websocket
connection, will clear the issue. However, we haven't been able to determine exactly
when and why a client ends up in this state.
While a client is in this state, REGISTER requests are still handled successfully, they
can make outbound calls and TCP keepalives from the client are working.
I'm still working on trying to debug this with GDB so I can see what the value of
send_info is in
https://github.com/kamailio/kamailio/blob/master/src/core/msg_translator.c#…, but I
wasn't having luck with multiple child processes running, and now my client has
reloaded and is working again. I've restarted Kamailio with a single child process, so
when it does start failing again, I may have better luck with GDB.
Any thoughts on what might be causing clients to get into this state? Whatever additional
information I can provide that might help, I'm happy to share. Thanks!
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web:
https://evaristesys.com
Tel: +1-706-510-6800