Module: kamailio
Branch: 4.4
Commit: 11971cbb21f9e7cface65251e7a991ffe8c9efc5
URL: https://github.com/kamailio/kamailio/commit/11971cbb21f9e7cface65251e7a991f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-10-10T12:10:33+02:00
core: proper code block when saving chosen naptr record
(cherry picked from commit a4b43f962a4493defb3fd608d1d2fad3ee58794a)
---
Modified: resolve.c
---
Diff: https://github.com/kamailio/kamailio/commit/11971cbb21f9e7cface65251e7a991f…
Patch: https://github.com/kamailio/kamailio/commit/11971cbb21f9e7cface65251e7a991f…
---
diff --git a/resolve.c b/resolve.c
index 0af1be3..3d57418 100644
--- a/resolve.c
+++ b/resolve.c
@@ -1335,7 +1335,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
-#ifdef USE_NAPTR
+#ifdef USE_NAPTR
/** iterates over a naptr rr list, returning each time a "good" naptr record
@@ -1343,7 +1343,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
* params:
* naptr_head - naptr rr list head
* tried - bitmap used to keep track of the already tried records
- * (no more then sizeof(tried)*8 valid records are
+ * (no more then sizeof(tried)*8 valid records are
* ever walked
* srv_name - if succesfull, it will be set to the selected record
* srv name (naptr repl.)
@@ -1351,10 +1351,10 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
* protocol
* returns 0 if no more records found or a pointer to the selected record
* and sets protocol and srv_name
- * WARNING: when calling first time make sure you run first
+ * WARNING: when calling first time make sure you run first
* naptr_iterate_init(&tried)
*/
-struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
+struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
naptr_bmp_t* tried,
str* srv_name, char* proto)
{
@@ -1373,7 +1373,7 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
saved_proto=0;
i=0;
for(l=naptr_head; l && (i<MAX_NAPTR_RRS); l=l->next){
- if (l->type!=T_NAPTR) continue;
+ if (l->type!=T_NAPTR) continue;
naptr=(struct naptr_rdata*) l->rdata;
if (naptr==0){
LM_CRIT("null rdata\n");
@@ -1391,17 +1391,18 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
#endif
if ((naptr_proto_supported(naptr_proto))){
if (naptr_choose(&naptr_saved, &saved_proto,
- naptr, naptr_proto))
+ naptr, naptr_proto)) {
idx=i;
l_saved=l;
}
+ }
i++;
}
if (naptr_saved){
/* found something */
#ifdef NAPTR_DBG
LM_DBG("choosed NAPTR rr %.*s, proto %d tried: 0x%x\n",
- naptr_saved->repl_len,
+ naptr_saved->repl_len,
naptr_saved->repl, (int)saved_proto, *tried);
#endif
*tried|=1<<idx;
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");
}
...