Module: kamailio
Branch: 5.0
Commit: 9748188734df2a49cc40d96d42641c87b5962603
URL:
https://github.com/kamailio/kamailio/commit/9748188734df2a49cc40d96d42641c8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-04-05T09:38:54+02:00
mtree: revert a0e4a9c18e and let db_table name not set by default
- it breaks some runtime rpc commands, reported by GH #1057
- reset it also if set by mistake when mtree param is used
(cherry picked from commit a4cdacd0b63245c48fcc6e0a20c9b665ef877090)
---
Modified: src/modules/mtree/mtree_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9748188734df2a49cc40d96d42641c8…
Patch:
https://github.com/kamailio/kamailio/commit/9748188734df2a49cc40d96d42641c8…
---
diff --git a/src/modules/mtree/mtree_mod.c b/src/modules/mtree/mtree_mod.c
index ee03da8..259ef1d 100644
--- a/src/modules/mtree/mtree_mod.c
+++ b/src/modules/mtree/mtree_mod.c
@@ -74,7 +74,9 @@ CREATE TABLE mtrees (
/** parameters */
static str db_url = str_init(DEFAULT_DB_URL);
-static str db_table = str_init("mtrees");
+/* default name created by sql scripts is 'mtrees'
+ * - don't set it here with default value, only via config param */
+static str db_table = str_init("");
static str tname_column = str_init("tname");
static str tprefix_column = str_init("tprefix");
static str tvalue_column = str_init("tvalue");
@@ -269,6 +271,9 @@ static int mod_init(void)
}
pt = pt->next;
}
+ /* reset db_table value */
+ db_table.s = "";
+ db_table.len = 0;
} else {
if(db_table.len<=0)
{