[sr-dev] git:master:eb3fd4c2: utils: add secfilter DB to kamdbctl file, for DB creation

2019-01-01 Thread Henning Westerholt
Module: kamailio
Branch: master
Commit: eb3fd4c2672a18f3851ca255b9c6cb40cb0829ad
URL: 
https://github.com/kamailio/kamailio/commit/eb3fd4c2672a18f3851ca255b9c6cb40cb0829ad

Author: Henning Westerholt 
Committer: Henning Westerholt 
Date: 2019-01-02T02:27:06+01:00

utils: add secfilter DB to kamdbctl file, for DB creation

---

Modified: utils/kamctl/kamdbctl.base

---

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

---

diff --git a/utils/kamctl/kamdbctl.base b/utils/kamctl/kamdbctl.base
index 587e874757..79b0b12874 100644
--- a/utils/kamctl/kamdbctl.base
+++ b/utils/kamctl/kamdbctl.base
@@ -42,7 +42,7 @@ EXTRA_TABLES=${EXTRA_TABLES:-imc_members imc_rooms cpl 
sip_trace domainpolicy
carrierroute carrier_name domain_name carrierfailureroute 
userblacklist
globalblacklist htable purplemap uacreg pl_pipes mtree mtrees
sca_subscriptions mohqcalls mohqueues rtpproxy rtpengine
-   dr_gateways dr_rules dr_gw_lists dr_groups}
+   dr_gateways dr_rules dr_gw_lists dr_groups secfilter}
 PRESENCE_TABLES=${PRESENCE_TABLES:-presentity active_watchers watchers xcap
pua rls_presentity rls_watchers}
 DBUID_TABLES=${UID_TABLES:-uid_credentials uid_domain uid_domain_attrs
@@ -77,7 +77,7 @@ PRESENCE_MODULES=${PRESENCE_MODULES:-presence rls}
 
 EXTRA_MODULES=${EXTRA_MODULES:-imc cpl siptrace domainpolicy carrierroute
drouting userblacklist htable purple uac pipelimit mtree sca 
mohqueue
-   rtpproxy rtpengine}
+   rtpproxy rtpengine secfilter}
 
 DBUID_MODULES=${UID_MODULES:-uid_auth_db uid_avp_db uid_domain uid_gflags
uid_uri_db}


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:689854e5: secfilter: use default read-only DB URL, as the other DB modules (for testing)

2019-01-01 Thread Henning Westerholt
Module: kamailio
Branch: master
Commit: 689854e517a9c4c0907eaaab9e76625bc717ed85
URL: 
https://github.com/kamailio/kamailio/commit/689854e517a9c4c0907eaaab9e76625bc717ed85

Author: Henning Westerholt 
Committer: Henning Westerholt 
Date: 2019-01-02T02:26:17+01:00

secfilter: use default read-only DB URL, as the other DB modules (for testing)

---

Modified: src/modules/secfilter/secfilter.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/689854e517a9c4c0907eaaab9e76625bc717ed85.diff
Patch: 
https://github.com/kamailio/kamailio/commit/689854e517a9c4c0907eaaab9e76625bc717ed85.patch

---

diff --git a/src/modules/secfilter/secfilter.c 
b/src/modules/secfilter/secfilter.c
index ef1a7f1fb4..5ec680d1b1 100644
--- a/src/modules/secfilter/secfilter.c
+++ b/src/modules/secfilter/secfilter.c
@@ -61,7 +61,7 @@ static int w_check_sqli_hdr(struct sip_msg *msg, char *val);
 
 /* Exported module parameters - default values */
 int secf_dst_exact_match = 1;
-str secf_db_url = {NULL, 0};
+str secf_db_url = str_init(DEFAULT_RODB_URL);
 str secf_table_name = str_init("secfilter");
 str secf_action_col = str_init("action");
 str secf_type_col = str_init("type");


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:0ccc6d38: secfilter: fix a few errors from previous refactoring in commit #2ebd6a5b8570d6

2019-01-01 Thread Henning Westerholt
Module: kamailio
Branch: master
Commit: 0ccc6d380d6a939f1b33d77b853ee80b6332e23b
URL: 
https://github.com/kamailio/kamailio/commit/0ccc6d380d6a939f1b33d77b853ee80b6332e23b

Author: Henning Westerholt 
Committer: Henning Westerholt 
Date: 2019-01-02T02:09:53+01:00

secfilter: fix a few errors from previous refactoring in commit #2ebd6a5b8570d6

---

Modified: src/modules/secfilter/secfilter.c
Modified: src/modules/secfilter/secfilter_rpc.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/0ccc6d380d6a939f1b33d77b853ee80b6332e23b.diff
Patch: 
https://github.com/kamailio/kamailio/commit/0ccc6d380d6a939f1b33d77b853ee80b6332e23b.patch

---

diff --git a/src/modules/secfilter/secfilter.c 
b/src/modules/secfilter/secfilter.c
index 7ae1153a62..ef1a7f1fb4 100644
--- a/src/modules/secfilter/secfilter.c
+++ b/src/modules/secfilter/secfilter.c
@@ -38,12 +38,12 @@ secf_data_p secf_data = NULL;
 
 /* Static and shared functions */
 static int mod_init(void);
-int init_data(void);
+int secf_init_data(void);
 static int child_init(int rank);
 static int rpc_init(void);
 static void free_str_list(struct str_list *l);
 static void free_sec_info(secf_info_p info);
-void free_data(void);
+void secf_free_data(void);
 static void mod_destroy(void);
 static int w_check_sqli(str val);
 static int check_user(struct sip_msg *msg, int type);
@@ -621,7 +621,7 @@ static int mod_init(void)
 {
LM_DBG("SECFILTER module init\n");
/* Init data to store database values */
-   if(init_data() == -1)
+   if(secf_init_data() == -1)
return -1;
/* Init RPC */
if(rpc_init() < 0)
@@ -661,7 +661,7 @@ static void mod_destroy(void)
if(!secf_data)
return;
/* Free shared data */
-   free_data();
+   secf_free_data();
/* Destroy lock */
lock_destroy(_data->lock);
shm_free(secf_data);
diff --git a/src/modules/secfilter/secfilter_rpc.c 
b/src/modules/secfilter/secfilter_rpc.c
index 002ff9e875..97adf5e633 100644
--- a/src/modules/secfilter/secfilter_rpc.c
+++ b/src/modules/secfilter/secfilter_rpc.c
@@ -54,7 +54,7 @@ static int get_type(char *ctype)
 
 
 /* Add blacklist destination value */
-void rpc_add_dst(rpc_t *rpc, void *ctx)
+void secf_rpc_add_dst(rpc_t *rpc, void *ctx)
 {
int number;
str data = STR_NULL;
@@ -88,7 +88,7 @@ void rpc_add_dst(rpc_t *rpc, void *ctx)
 }
 
 /* Add blacklist value */
-void rpc_add_bl(rpc_t *rpc, void *ctx)
+void secf_rpc_add_bl(rpc_t *rpc, void *ctx)
 {
char *ctype = NULL;
str data = STR_NULL;
@@ -116,7 +116,7 @@ void rpc_add_bl(rpc_t *rpc, void *ctx)
 
 
 /* Add whitelist value */
-void rpc_add_wl(rpc_t *rpc, void *ctx)
+void secf_rpc_add_wl(rpc_t *rpc, void *ctx)
 {
char *ctype = NULL;
str data = STR_NULL;
@@ -148,7 +148,7 @@ void secf_rpc_reload(rpc_t *rpc, void *ctx)
 {
secf_free_data();
 
-   if(load_db() == -1) {
+   if(secf_load_db() == -1) {
LM_ERR("Error loading data from database\n");
rpc->rpl_printf(ctx, "Error loading data from database");
} else {
@@ -171,7 +171,7 @@ static void rpc_print_data(rpc_t *rpc, void *ctx, struct 
str_list *list)
 
 
 /* Print values */
-void rpc_print(rpc_t *rpc, void *ctx)
+void secf_rpc_print(rpc_t *rpc, void *ctx)
 {
char *param = NULL;
int showall = 0;


___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git: new commits in branch master

2019-01-01 Thread Henning Westerholt
- URL:  
https://github.com/kamailio/kamailio/commit/b14dc38c38a547b252c713e287dbb47caa6ca491
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

core: add DB_TABLE_VERSION_ERROR(table) error helper #define to DB1 API

- add DB_TABLE_VERSION_ERROR(table) error helper #define to DB1 API
- should used for db table check errors from modules, with table as parameter
- example log message:
  "Error during version check for db table: location, check database 
structure.\n"

- URL:  
https://github.com/kamailio/kamailio/commit/dcbb63a0900c44adfd27a797517139051647a270
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

auth_db: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/d5dc411c1056d47d22f24133a3fe573a0ee4a247
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

carrierroute: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/54842c2ce5d226a4bd2ab0b4e960e3ab62ee0d2e
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

cplc: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/a41a0c20701818060fa82e9fde8db7c156660dbb
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

dialog: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/5f90b1f9838fe38aa8cd8c6e1af71dbd92c75da0
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

dialplan: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/f53aa8f000d396566a26ae4eff3a1aab35d1b71f
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

domain: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/57865f20449bd60b28aa95647cd46ccb4cc8e69e
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

group: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/47d9d13256bd0b1478fd5511840c6b0af861809b
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

ims_charging: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/0be172beffb7948d60e386b323ef85205ca58f8e
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

ims_dialog: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/26b1f71bab4e93ed2391f8062e883951ea0bb16c
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

lcr: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/a0db9f5af3a14a380f4a82597de7f3397f204014
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

matrix: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/5507edd5d75fbad207d94173c0e9d023f1e5196b
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

mohqueue: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on errors, null db handle)

- URL:  
https://github.com/kamailio/kamailio/commit/21e24b16428f23fad03c43794d3c60b9f3bff422
Author: Henning Westerholt 
Date:   2019-01-01T20:11:09+01:00

msilo: convert module to use DB_TABLE_VERSION_ERROR helper

- convert module to use DB_TABLE_VERSION_ERROR helper
- unify error handling (properly close database on