Browse code

core: kemi - added KSR.is_WSX() - return true of proto is WS or WSS

Daniel-Constantin Mierla authored on 09/06/2021 12:48:19
Showing 1 changed files
... ...
@@ -1155,6 +1155,18 @@ static int sr_kemi_core_is_proto_wss(sip_msg_t *msg)
1155 1155
 	return (msg->rcv.proto == PROTO_WSS)?SR_KEMI_TRUE:SR_KEMI_FALSE;
1156 1156
 }
1157 1157
 
1158
+/**
1159
+ *
1160
+ */
1161
+static int sr_kemi_core_is_proto_wsx(sip_msg_t *msg)
1162
+{
1163
+	if (msg->rcv.proto == PROTO_WSS) return SR_KEMI_TRUE;
1164
+	if (msg->rcv.proto == PROTO_WS) return SR_KEMI_TRUE;
1165
+
1166
+	return SR_KEMI_FALSE;
1167
+}
1168
+
1169
+
1158 1170
 /**
1159 1171
  *
1160 1172
  */
... ...
@@ -1888,6 +1900,11 @@ static sr_kemi_t _sr_kemi_core[] = {
1888 1900
 		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
1889 1901
 			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
1890 1902
 	},
1903
+	{ str_init(""), str_init("is_WSX"),
1904
+		SR_KEMIP_BOOL, sr_kemi_core_is_proto_wsx,
1905
+		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
1906
+			SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
1907
+	},
1891 1908
 	{ str_init(""), str_init("is_SCTP"),
1892 1909
 		SR_KEMIP_BOOL, sr_kemi_core_is_proto_sctp,
1893 1910
 		{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,