[sr-dev] git:pd/websocket: modules_k/nathelper: Added PROTO_WS support

Peter Dunkley peter.dunkley at crocodile-rcs.com
Fri Jun 29 18:48:06 CEST 2012


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

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Fri Jun 29 17:47:06 2012 +0100

modules_k/nathelper: Added PROTO_WS support

---

 modules_k/nathelper/nathelper.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules_k/nathelper/nathelper.c b/modules_k/nathelper/nathelper.c
index bec490c..4007004 100644
--- a/modules_k/nathelper/nathelper.c
+++ b/modules_k/nathelper/nathelper.c
@@ -888,7 +888,7 @@ add_contact_alias_f(struct sip_msg* msg, char* str1, char* str2)
     append_str(at, port, len);
     /* proto */
     append_chr(at, '~');
-    if ((msg->rcv.proto < PROTO_UDP) || (msg->rcv.proto > PROTO_SCTP)) {
+    if ((msg->rcv.proto < PROTO_UDP) || (msg->rcv.proto > PROTO_WSS)) {
 	LM_ERR("invalid transport protocol\n");
 	goto err;
     }
@@ -1843,6 +1843,12 @@ create_rcv_uri(str* uri, struct sip_msg* m)
 		proto.len = 4;
 		break;
 
+	case PROTO_WS:
+	case PROTO_WSS:
+		proto.s = "WS";
+		proto.len = 2;
+		break;
+
 	default:
 		LM_ERR("unknown transport protocol\n");
 		return -1;




More information about the sr-dev mailing list