modules/websocket: Updated example kamailio.cfg
authorPeter Dunkley <peter.dunkley@crocodile-rcs.com>
Fri, 26 Oct 2012 23:08:54 +0000 (00:08 +0100)
committerPeter Dunkley <peter.dunkley@crocodile-rcs.com>
Fri, 26 Oct 2012 23:08:54 +0000 (00:08 +0100)
- More tweaks to MSRP over WebSocket

modules/websocket/example/kamailio.cfg

index 21b9925..4176af0 100644 (file)
@@ -467,29 +467,9 @@ event_route[msrp:frame-in] {
                $sht(msrp=>$var(sessid)::srcsock) = $msrp(srcsock);
                $shtex(msrp=>$var(sessid)) = $var(expires) + 5;
                # - Use-Path: the MSRP address for server + session id
                $sht(msrp=>$var(sessid)::srcsock) = $msrp(srcsock);
                $shtex(msrp=>$var(sessid)) = $var(expires) + 5;
                # - Use-Path: the MSRP address for server + session id
-               if (proto == WS || proto == WSS) {
-                       if (proto == WS) {
-                               $var(hdrs) =
-                               "Use-Path: msrp://MY_IP_ADDR:MY_WS_PORT/"
-                                       + $var(sessid) + ";ws ";
-                       } else {
-                               $var(hdrs) =
-                               "Use-Path: msrps://MY_IP_ADDR:MY_WSS_PORT/"
-                                       + $var(sessid) + ";ws ";
-                       }
-                       $var(cnt) = $var(cnt) + 1;
-                       pv_printf("$var(sessid)",
-                                       "s.$(pp).$(var(cnt)).$(RANDOM)");
-                       $var(hdrs) = $var(hdrs)
-                                       + "msrps://MY_IP_ADDR:MY_MSRP_PORT/"
-                                       + $var(sessid) + ";tcp\r\n";
-               } else {
-                       $var(hdrs) =
-                               "Use-Path: msrps://MY_IP_ADDR:MY_MSRP_PORT/"
-                                       + $var(sessid) + ";tcp\r\n";
-               }
-               $var(hdrs) = $var(hdrs)
-                               + "Expires: " + $var(expires) + "\r\n";
+               $var(hdrs) = "Use-Path: msrps://MY_IP_ADDR:MY_MSRP_PORT/"
+                                       + $var(sessid) + ";tcp\r\n"
+                                       + "Expires: " + $var(expires) + "\r\n";
                msrp_reply("200", "OK", "$var(hdrs)");
        } else if ($msrp(method)=="SEND" || $msrp(method)=="REPORT") {
                if ($msrp(nexthops)>1) {
                msrp_reply("200", "OK", "$var(hdrs)");
        } else if ($msrp(method)=="SEND" || $msrp(method)=="REPORT") {
                if ($msrp(nexthops)>1) {
@@ -504,8 +484,7 @@ event_route[msrp:frame-in] {
                        # one more hop, but we don't have address in htable
                        msrp_reply("481", "Session-does-not-exist");
                        exit;
                        # one more hop, but we don't have address in htable
                        msrp_reply("481", "Session-does-not-exist");
                        exit;
-               }
-               else if ($msrp(method)!="REPORT") {
+               } else if ($msrp(method)!="REPORT") {
                        msrp_reply("200", "OK");
                }
                msrp_relay_flags("1");
                        msrp_reply("200", "OK");
                }
                msrp_relay_flags("1");