[sr-dev] git:pd/websocket: modules/websocket: Updated example kamailio.cfg

Peter Dunkley peter.dunkley at crocodile-rcs.com
Tue Jul 3 17:58:40 CEST 2012


Module: sip-router
Branch: pd/websocket
Commit: eff18c9ce6de48e6a2f821148cbce586a088512c
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=eff18c9ce6de48e6a2f821148cbce586a088512c

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Tue Jul  3 16:56:11 2012 +0100

modules/websocket: Updated example kamailio.cfg

---

 modules/websocket/example/kamailio.cfg |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/modules/websocket/example/kamailio.cfg b/modules/websocket/example/kamailio.cfg
index c4bd83f..0285c43 100644
--- a/modules/websocket/example/kamailio.cfg
+++ b/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] {




More information about the sr-dev mailing list