Module: kamailio
Branch: master
Commit: 3988ad296772b09353324557a867425d677fe706
URL: 
https://github.com/kamailio/kamailio/commit/3988ad296772b09353324557a867425d677fe706

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-04-11T13:19:28+02:00

core: added kemi function KSR.is_TCPX()

- return true if incoming base connection is tcp (tcp, tls, ws, wss)

---

Modified: src/core/kemi.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3988ad296772b09353324557a867425d677fe706.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3988ad296772b09353324557a867425d677fe706.patch

---

diff --git a/src/core/kemi.c b/src/core/kemi.c
index 1f936453225..fe2f20078a4 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -1139,6 +1139,17 @@ static int sr_kemi_core_is_proto_tcp(sip_msg_t *msg)
        return (msg->rcv.proto == PROTO_TCP) ? SR_KEMI_TRUE : SR_KEMI_FALSE;
 }
 
+/**
+ *
+ */
+static int sr_kemi_core_is_proto_tcpx(sip_msg_t *msg)
+{
+       return (msg->rcv.proto == PROTO_TCP || msg->rcv.proto == PROTO_TLS
+                                  || msg->rcv.proto == PROTO_WSS || 
msg->rcv.proto == PROTO_WS)
+                                  ? SR_KEMI_TRUE
+                                  : SR_KEMI_FALSE;
+}
+
 /**
  *
  */
@@ -2102,6 +2113,11 @@ static sr_kemi_t _sr_kemi_core[] = {
                        { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
                                SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
        },
+       { str_init(""), str_init("is_TCPX"),
+               SR_KEMIP_BOOL, sr_kemi_core_is_proto_tcpx,
+                       { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+                               SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+       },
        { str_init(""), str_init("is_TLS"),
                SR_KEMIP_BOOL, sr_kemi_core_is_proto_tls,
                        { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to