Hello,

Thank you for the explanation.
Could somebody review the patch in the attachment ? I tried to fix the problem with a growing tcpconn->refcnt for websocket connections.


On 30 September 2013 17:14, Vitaliy Aleksandrov <vitalik.v...@gmail.com <mailto:vitalik.v...@gmail.com>> wrote:


    Could you please share why nathelper aggregates both WS and WSS
    transports to "ws" and then msg_translator have to detect the type
    of a connection to a destination to build correct via ?

    modules/nathelper/nathelper.c create_rcv_uri() function :
            case PROTO_WS:
            case PROTO_WSS:
                    proto.s = "WS";
                    proto.len = 2;
                    break;


Because when the transport is WS (WebSockets over TCP) the URI has a transport parameter like this ";transport=ws" and when the transport is WSS (Secure WebSockets over TLS over TCP) the URI has a transport parameter like this ";transport=ws". In other words, the transport parameter is the same for both and you need to make the determination within Kamailio core by checking how the specified socket is actually used.

--
Peter Dunkley
Technical Director
Crocodile RCS Ltd


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

diff --git a/msg_translator.c b/msg_translator.c
index b7d4894..b4581e7 100644
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -2509,9 +2509,11 @@ char* via_builder( unsigned int *len,
 		} else if (con->rcv.proto==PROTO_WSS) {
 			memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
 		} else {
+			tcpconn_put(con);
 			LOG(L_CRIT, "BUG: via_builder: unknown proto %d\n", con->rcv.proto);
 			return 0;
 		}
+		tcpconn_put(con);
 	}else if (send_info->proto==PROTO_WSS){
 		memcpy(line_buf+MY_VIA_LEN-4, "WSS ", 4);
 	}else{
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to