Parcourir la source

modules/websocket: Updated example kamailio.cfg

Peter Dunkley il y a 13 ans
Parent
commit
eff18c9ce6
1 fichiers modifiés avec 11 ajouts et 7 suppressions
  1. 11 7
      modules/websocket/example/kamailio.cfg

+ 11 - 7
modules/websocket/example/kamailio.cfg

@@ -3,7 +3,7 @@
 # Simple/sample kamailio.cfg for running a proxy/registrar with TLS and
 # WebSockets support.
 
-#!substdef "!DBURL!sqlite:///db.sqlite!g"
+#!substdef "!DBURL!sqlite:///etc/kamailio/db.sqlite!g"
 #!substdef "!MY_IP_ADDR!192.168.111.136!g"
 #!substdef "!MY_WS_PORT!80!g"
 #!substdef "!MY_WSS_PORT!443!g"
@@ -150,9 +150,11 @@ request_route {
 				sl_send_reply("400", "Bad Request");
 				exit;
 			}
-			t_on_reply("WS_REPLY");
 		}
 	}
+
+	if (!is_method("REGISTER"))
+		t_on_reply("WS_REPLY");
 #!endif
 
 	# handle requests within SIP dialogs
@@ -298,11 +300,13 @@ route[AUTH] {
 
 #!ifdef WITH_WEBSOCKETS
 onreply_route[WS_REPLY] {
-	# Do NAT traversal stuff for replies to a WebSocket connection - even
-	# if it is not behind a NAT!
-	# This won't be needed in the future if Kamailio and the WebSocket
-	# client support outbound.
-	add_contact_alias();
+	if (nat_uac_test(64)) {
+		# Do NAT traversal stuff for replies to a WebSocket connection - even
+		# if it is not behind a NAT!
+		# This won't be needed in the future if Kamailio and the WebSocket
+		# client support outbound.
+		add_contact_alias();
+	}
 }
 
 event_route[xhttp:request] {