Module: kamailio Branch: master Commit: a4cdacd0b63245c48fcc6e0a20c9b665ef877090 URL: https://github.com/kamailio/kamailio/commit/a4cdacd0b63245c48fcc6e0a20c9b665...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-04-05T09:34:07+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
---
Modified: src/modules/mtree/mtree_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/a4cdacd0b63245c48fcc6e0a20c9b665... Patch: https://github.com/kamailio/kamailio/commit/a4cdacd0b63245c48fcc6e0a20c9b665...
---
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) {