Module: kamailio
Branch: master
Commit: 20ebfcf3156912d83c087156ec3e8eb15ae26c25
URL:
https://github.com/kamailio/kamailio/commit/20ebfcf3156912d83c087156ec3e8eb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-07-11T15:25:56+02:00
permissions: exported allow_source_address_group() to kemi framework
---
Modified: src/modules/permissions/address.c
Modified: src/modules/permissions/address.h
Modified: src/modules/permissions/permissions.c
---
Diff:
https://github.com/kamailio/kamailio/commit/20ebfcf3156912d83c087156ec3e8eb…
Patch:
https://github.com/kamailio/kamailio/commit/20ebfcf3156912d83c087156ec3e8eb…
---
diff --git a/src/modules/permissions/address.c b/src/modules/permissions/address.c
index 42418b96f8..141806edf0 100644
--- a/src/modules/permissions/address.c
+++ b/src/modules/permissions/address.c
@@ -525,7 +525,7 @@ int w_allow_source_address(struct sip_msg* _msg, char* _addr_group,
char* _str2)
* subnet table in any group. If yes, returns that group. If not returns -1.
* Port value 0 in cached address and group table matches any port.
*/
-int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2)
+int ki_allow_source_address_group(sip_msg_t* _msg)
{
int group = -1;
@@ -550,6 +550,16 @@ int allow_source_address_group(struct sip_msg* _msg, char* _str1,
char* _str2)
}
+/*
+ * Checks if source address/port is found in cached address or
+ * subnet table in any group. If yes, returns that group. If not returns -1.
+ * Port value 0 in cached address and group table matches any port.
+ */
+int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2)
+{
+ return ki_allow_source_address_group(_msg);
+}
+
/*
* Checks if address/port is found in cached address or
* subnet table in any group. If yes, returns that group. If not returns -1.
diff --git a/src/modules/permissions/address.h b/src/modules/permissions/address.h
index a4d12b8350..cc4652a0bc 100644
--- a/src/modules/permissions/address.h
+++ b/src/modules/permissions/address.h
@@ -88,6 +88,7 @@ int w_allow_source_address(struct sip_msg* _msg, char* _addr_group,
char* _str2)
*/
int allow_source_address_group(struct sip_msg* _msg, char* _str1, char* _str2);
+int ki_allow_source_address_group(sip_msg_t* _msg);
/*
* Checks if address/port is found in cached address or
diff --git a/src/modules/permissions/permissions.c
b/src/modules/permissions/permissions.c
index 707ccd315b..822aad5e91 100644
--- a/src/modules/permissions/permissions.c
+++ b/src/modules/permissions/permissions.c
@@ -1036,6 +1036,11 @@ static sr_kemi_t sr_kemi_permissions_exports[] = {
{ SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_INT,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init("permissions"), str_init("allow_source_address_group"),
+ SR_KEMIP_INT, ki_allow_source_address_group,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};