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

Peter Dunkley peter.dunkley at crocodile-rcs.com
Sat Oct 27 01:09:31 CEST 2012


Module: sip-router
Branch: master
Commit: 70f5cefa6dcc8562d58e58e7531d6021dbd88912
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=70f5cefa6dcc8562d58e58e7531d6021dbd88912

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Sat Oct 27 00:08:54 2012 +0100

modules/websocket: Updated example kamailio.cfg

- More tweaks to MSRP over WebSocket

---

 modules/websocket/example/kamailio.cfg |   29 ++++-------------------------
 1 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/modules/websocket/example/kamailio.cfg b/modules/websocket/example/kamailio.cfg
index 21b9925..4176af0 100644
--- a/modules/websocket/example/kamailio.cfg
+++ b/modules/websocket/example/kamailio.cfg
@@ -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
-		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) {
@@ -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;
-		}
-		else if ($msrp(method)!="REPORT") {
+		} else if ($msrp(method)!="REPORT") {
 			msrp_reply("200", "OK");
 		}
 		msrp_relay_flags("1");




More information about the sr-dev mailing list