Module: sip-router
Branch: master
Commit: aab8df4fbedb7cd7f7dbb8d8ef6564f721e90444
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=aab8df4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Mar 28 19:37:03 2010 +0200
permissions(ka): exported allow_source_address()
- alias to allow_source_address("1"), 1 is default value for group id
---
modules_k/permissions/address.c | 5 +++--
modules_k/permissions/permissions.c | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules_k/permissions/address.c b/modules_k/permissions/address.c
index 916f6b0..bc27be2 100644
--- a/modules_k/permissions/address.c
+++ b/modules_k/permissions/address.c
@@ -378,9 +378,10 @@ int allow_address(struct sip_msg* _msg, char* _addr_group, char*
_addr_sp,
*/
int allow_source_address(struct sip_msg* _msg, char* _addr_group, char* _str2)
{
- int addr_group = 0;
+ int addr_group = 1;
- if(fixup_get_ivalue(_msg, (gparam_p)_addr_group, &addr_group) !=0 ) {
+ if(_addr_group!=NULL
+ && fixup_get_ivalue(_msg, (gparam_p)_addr_group, &addr_group) !=0 ) {
LM_ERR("cannot get group value\n");
return -1;
}
diff --git a/modules_k/permissions/permissions.c b/modules_k/permissions/permissions.c
index 97cc18f..0915437 100644
--- a/modules_k/permissions/permissions.c
+++ b/modules_k/permissions/permissions.c
@@ -137,6 +137,8 @@ static cmd_export_t cmds[] = {
fixup_free_igp_pvar_pvar, REQUEST_ROUTE|FAILURE_ROUTE|LOCAL_ROUTE},
{"allow_source_address", (cmd_function)allow_source_address, 1,
fixup_igp_null, 0,
REQUEST_ROUTE | FAILURE_ROUTE},
+ {"allow_source_address", (cmd_function)allow_source_address, 0, 0, 0,
+ REQUEST_ROUTE | FAILURE_ROUTE},
{"allow_source_address_group", (cmd_function)allow_source_address_group, 0, 0,
0,
REQUEST_ROUTE | FAILURE_ROUTE},
{0, 0, 0, 0, 0, 0}