modules/websocket: Updated example kamailio.cfg
authorPeter Dunkley <peter.dunkley@crocodile-rcs.com>
Tue, 3 Jul 2012 15:56:11 +0000 (16:56 +0100)
committerPeter Dunkley <peter.dunkley@crocodile-rcs.com>
Tue, 3 Jul 2012 15:56:11 +0000 (16:56 +0100)
modules/websocket/example/kamailio.cfg

index c4bd83f..0285c43 100644 (file)
@@ -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] {