Module: kamailio
Branch: master
Commit: 2c4deee67a1cdd4051bc777101fe2a580c1589a7
URL:
https://github.com/kamailio/kamailio/commit/2c4deee67a1cdd4051bc777101fe2a5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-01-31T09:36:32+01:00
core: kemi - exported helper functions to check myself for dst uri and next nop uri
---
Modified: src/core/kemi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2c4deee67a1cdd4051bc777101fe2a5…
Patch:
https://github.com/kamailio/kamailio/commit/2c4deee67a1cdd4051bc777101fe2a5…
---
diff --git a/src/core/kemi.c b/src/core/kemi.c
index 7a96254159..612e980734 100644
--- a/src/core/kemi.c
+++ b/src/core/kemi.c
@@ -222,6 +222,38 @@ static int sr_kemi_core_is_myself_ruri(sip_msg_t *msg)
return sr_kemi_core_is_myself(msg, &msg->first_line.u.request.uri);
}
+/**
+ *
+ */
+static int sr_kemi_core_is_myself_duri(sip_msg_t *msg)
+{
+ if(msg==NULL) {
+ LM_WARN("invalid msg parameter\n");
+ return SR_KEMI_FALSE;
+ }
+
+ if (msg->dst_uri.s!=NULL)
+ return sr_kemi_core_is_myself(msg, &msg->dst_uri);
+
+ return SR_KEMI_FALSE;
+}
+
+/**
+ *
+ */
+static int sr_kemi_core_is_myself_nhuri(sip_msg_t *msg)
+{
+ if(msg==NULL) {
+ LM_WARN("invalid msg parameter\n");
+ return SR_KEMI_FALSE;
+ }
+
+ if (msg->dst_uri.s!=NULL)
+ return sr_kemi_core_is_myself(msg, &msg->dst_uri);
+
+ return sr_kemi_core_is_myself_ruri(msg);
+}
+
/**
*
*/
@@ -1400,6 +1432,16 @@ 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_myself_duri"),
+ SR_KEMIP_BOOL, sr_kemi_core_is_myself_duri,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init(""), str_init("is_myself_nhuri"),
+ SR_KEMIP_BOOL, sr_kemi_core_is_myself_nhuri,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ str_init(""), str_init("is_myself_furi"),
SR_KEMIP_BOOL, sr_kemi_core_is_myself_furi,
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,