When I enable SIP.js keep-alive, it sends double CR-LFs to Kamailio via websocket, however Kamailio understands it as a malformed SIP message, and therefore does not reply with a single CR-LF.
Debug log from websocket module upon arrival of keep-alive:
`15(88) DEBUG: websocket [ws_frame.c:415]: decode_and_validate_ws_frame(): decoding WebSocket frame`
`15(88) DEBUG: websocket [ws_frame.c:451]: decode_and_validate_ws_frame(): supported non-control frame: 0x1`
`15(88) DEBUG: websocket [ws_frame.c:550]: decode_and_validate_ws_frame(): Rx (decoded):`
`
`
`15(88) DEBUG: websocket [ws_frame.c:684]: ws_frame_receive(): Rx SIP message:`
`
`
`
`
`15(88) DEBUG: websocket [ws_conn.c:383]: wsconn_put(): wsconn_put start for [0x7fc8cbd45860] refcnt [2]`
`15(88) DEBUG: websocket [ws_conn.c:416]: wsconn_put(): wsconn_put end for [0x7fc8cbd45860] refcnt [1]`
`15(88) INFO: <core> [parser/parse_fline.c:87]: parse_first_line(): ERROR: parse_first_line: message too short: 0`
`15(88) ERROR: <core> [parser/parse_fline.c:257]: parse_first_line(): parse_first_line: bad message (offset: 0)`
`15(88) ERROR: <core> [parser/msg_parser.c:671]: parse_msg(): ERROR: parse_msg: message=<`
` `
`>`
`15(88) ERROR: <core> [receive.c:173]: receive_msg(): core parsing of SIP message failed (10.0.1.73:1043/6)`
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/810
Module: kamailio
Branch: master
Commit: 66473295ab516b862fb2c81aa1a1e35ffc4d88e2
URL: https://github.com/kamailio/kamailio/commit/66473295ab516b862fb2c81aa1a1e35…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2016-10-10T11:16:15+02:00
modules: readme files regenerated - tcpops ...
---
Modified: modules/tcpops/README
---
Diff: https://github.com/kamailio/kamailio/commit/66473295ab516b862fb2c81aa1a1e35…
Patch: https://github.com/kamailio/kamailio/commit/66473295ab516b862fb2c81aa1a1e35…
---
diff --git a/modules/tcpops/README b/modules/tcpops/README
index 3918b00..b0a0c3b 100644
--- a/modules/tcpops/README
+++ b/modules/tcpops/README
@@ -34,6 +34,9 @@ Olle E. Johansson
4. Event routes
4.1. tcp:closed
+ 4.2. tcp:timeout
+ 4.3. tcp:reset
+ 4.4. Example
List of Examples
@@ -66,6 +69,9 @@ Chapter 1. Admin Guide
4. Event routes
4.1. tcp:closed
+ 4.2. tcp:timeout
+ 4.3. tcp:reset
+ 4.4. Example
1. Overview
@@ -289,18 +295,43 @@ event_route[tcp:closed] {
4. Event routes
4.1. tcp:closed
+ 4.2. tcp:timeout
+ 4.3. tcp:reset
+ 4.4. Example
+
+ The 3 following routes are called when a socket is closed.
+
+ The corresponding $conid , $Ri , $Rp , $si , $sp and $proto variable
+ will be available in the event routes.
+
+ Whether these routes are always called, never, or on a per socket basis
+ is controlled by the closed_event parameter.
4.1. tcp:closed
- This route is called when a socket is closed by the remote party, or
- reset, or timeout. The corresponding $conid variable will be available
- in the event route.
+ Called for each "normal" TCP socket closure by the other side
+ (FIN,ACK).
+
+4.2. tcp:timeout
+
+ Called for connection timeouts (unanswered keepalives).
+
+4.3. tcp:reset
- Whether this route is always called, never, or on a per socket basis is
- controlled by the closed_event parameter.
+ Called if the connection is reset by peer (RST).
+
+4.4. Example
...
event_route[tcp:closed] {
- xlog("L_INFO", "TCP connection closed ($conid)\n");
+ xlog("L_INFO", "$proto connection closed ($conid)\n");
+}
+
+event_route[tcp:timeout] {
+ xlog("L_INFO", "$proto connection timed out ($conid)\n");
+}
+
+event_route[tcp:reset] {
+ xlog("L_INFO", "$proto connection reset by peer ($conid)\n");
}
...
This patch for the **tcpops** module (+ some core modifications) improves the original **tcp:closed** event route handling by triggering different event routes, depending on the reason why the connection was closed:
- **tcp:closed** for "normal" closure by the other side (FIN,ACK)
- **tcp:timeout** for timeouts (unanswered keepalives)
- **tcp:reset** if reset by peer (RST)
It will break the compatibility with older scripts, as some events will require new event routes to be caught.
I'll modify the documentation accordingly if/when this is accepted.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/816
-- Commit Summary --
* core: dedicated struct for TCP closed events
* tcpops: use dedicated routes for tcp close events
-- File Changes --
M modules/tcpops/tcpops.c (21)
M modules/tcpops/tcpops.h (1)
M modules/tcpops/tcpops_mod.c (16)
M tcp_conn.h (13)
M tcp_read.c (20)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/816.patchhttps://github.com/kamailio/kamailio/pull/816.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/816