Hi Alex.
Our app already is PWA in Electron, and I can see keepalives from the client to Kamailio when the client is in this state. We are running network traces though to see what we can find there. It's just been a pain to debug, because we haven't figured out what's triggering the error, so it's a lot of waiting for a client to start showing the behavior again.
Our issue looks similar to this one, but the linked issue on there shows "tcp connection has been lost" errors, which we are not seeing. https://lists.kamailio.org/mailman3/hyperkitty/list/sr-users@lists.kamailio....
The log snippets below show a successful registration and keepalive followed by the Websocket error on an inbound INVITE.
-- handling REGISTER --- 2024-08-12T16:31:33.798220+00:00 kamailio02 /usr/local/sbin/kamailio[124476]: DEBUG: {1 787 REGISTER lh2ov51675v0k9abroklui}: app_jsdt [app_jsdt_api.c:780]: sr_kemi_jsdt_exec_func_ex(): param[0] for: lookup_uri is str: location 2024-08-12T16:31:33.798264+00:00 kamailio02 /usr/local/sbin/kamailio[124476]: DEBUG: {1 787 REGISTER lh2ov51675v0k9abroklui}: app_jsdt [app_jsdt_api.c:780]: sr_kemi_jsdt_exec_func_ex(): param[1] for: lookup_uri is str: sip:rhollis7717@devsip.lab.com 2024-08-12T16:31:33.798307+00:00 kamailio02 /usr/local/sbin/kamailio[124476]: DEBUG: {1 787 REGISTER lh2ov51675v0k9abroklui}: <core> [core/tcp_main.c:1726]: _tcpconn_find(): found connection by id: 4 2024-08-12T16:31:33.798840+00:00 kamailio02 /usr/local/sbin/kamailio[124476]: INFO: {1 787 REGISTER lh2ov51675v0k9abroklui}: <core> [core/kemi.c:107]: sr_kemi_core_info(): saving user:rhollis7717 in registrar DB
--- keepalive from webrtc client --- 2024-08-12T16:33:33.268238+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_read.c:1776]: handle_io(): received n=8 con=0x7faf57fae7a0, fd=7 2024-08-12T16:33:33.268286+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_read.c:1250]: ws_process_msg(): WebSocket Message: [[>>> <81><82>cí<84>Înç<<<]] 2024-08-12T16:33:33.268320+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_main.c:1726]: _tcpconn_find(): found connection by id: 4 2024-08-12T16:33:33.268346+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_main.c:1726]: _tcpconn_find(): found connection by id: 4 2024-08-12T16:33:33.268378+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_main.c:2618]: tcpconn_send_put(): send from reader (124471 (48)), reusing fd 2024-08-12T16:33:33.268416+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_main.c:2849]: tcpconn_do_send(): sending... 2024-08-12T16:33:33.268451+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_main.c:2885]: tcpconn_do_send(): after real write: c= 0x7faf57fae7a0 n=4 fd=7 2024-08-12T16:33:33.268485+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/tcp_main.c:2886]: tcpconn_do_send(): buf= <81>^B^M 2024-08-12T16:33:33.268515+00:00 kamailio02 /usr/local/sbin/kamailio[124471]: DEBUG: <core> [core/io_wait.h:368]: io_watch_add(): processing io_watch_add(0x559d06b58b80, 7, 2, 0x7faf57fae7a0) - fd_no=1
-- handling INVITE, connection found by ID -- 2024-08-12T16:33:34.824883+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: <core> [core/kemi.c:87]: sr_kemi_core_dbg(): in function: ksr_route_location() 2024-08-12T16:33:34.824935+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: app_jsdt [app_jsdt_api.c:780]: sr_kemi_jsdt_exec_func_ex(): param[0] for: is_proto is str: TVW 2024-08-12T16:33:34.824963+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: app_jsdt [app_jsdt_api.c:780]: sr_kemi_jsdt_exec_func_ex(): param[0] for: lookup is str: location 2024-08-12T16:33:34.824997+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: <core> [core/tcp_main.c:1726]: _tcpconn_find(): found connection by id: 4 2024-08-12T16:33:34.825032+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: registrar [lookup.c:352]: lookup_helper(): contact for [rhollis7717] found by address 2024-08-12T16:33:34.825062+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: app_jsdt [app_jsdt_api.c:785]: sr_kemi_jsdt_exec_func_ex(): param[0] for: setflag is int: 2
-- preparing to forward INVITE, Websocket could not be found -- 2024-08-12T16:33:34.847693+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: tm [uac.c:715]: send_prepared_request_impl(): uac: 0x7faf57fd3740 branch: 0 to 10.101.114.38:5090 2024-08-12T16:33:34.847755+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: <core> [core/onsend.c:50]: run_onsend(): required parameters are not available - ignoring 2024-08-12T16:33:34.847814+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: dmq [dmq_funcs.c:183]: bcast_dmq_message1(): skipping node sip:10.101.114.39:5090 2024-08-12T16:33:34.847865+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: dialog [dlg_hash.c:1088]: dlg_unref_helper(): unref op on 0x7faf57f98bf0 with 1 from dlg_handlers.c:772 2024-08-12T16:33:34.847992+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: dialog [dlg_hash.c:1092]: dlg_unref_helper(): unref dlg 0x7faf57f98bf0 with 1 -> 1 2024-08-12T16:33:34.848134+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: tm [h_table.c:551]: tm_xdata_swap(): restore X/AVPs msg context from txdata 2024-08-12T16:33:34.848407+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: <core> [core/msg_translator.c:1845]: check_boundaries(): no multi-part body 2024-08-12T16:33:34.848473+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: DEBUG: {1 599264557 INVITE BW093334808120824-485445593}: <core> [core/msg_translator.c:428]: clen_builder(): content-length: 866 (866) 2024-08-12T16:33:34.848752+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: WARNING: {1 599264557 INVITE BW093334808120824-485445593}: <core> [core/msg_translator.c:3007]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found 2024-08-12T16:33:34.848915+00:00 kamailio02 /usr/local/sbin/kamailio[124436]: ERROR: {1 599264557 INVITE BW093334808120824-485445593}: <core> [core/msg_translator.c:2086]: build_req_buf_from_sip_req(): could not create Via header