Module: kamailio
Branch: master
Commit: c216abc532df9f22b023d26b46bd6322a217cdfe
URL:
https://github.com/kamailio/kamailio/commit/c216abc532df9f22b023d26b46bd632…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-08-21T08:30:00+02:00
mtree: rpc reload without table name reloads all tables
- lost feature in rpc which was available in mi command
---
Modified: src/modules/mtree/mtree_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c216abc532df9f22b023d26b46bd632…
Patch:
https://github.com/kamailio/kamailio/commit/c216abc532df9f22b023d26b46bd632…
---
diff --git a/src/modules/mtree/mtree_mod.c b/src/modules/mtree/mtree_mod.c
index 4ce2786afb..0710186869 100644
--- a/src/modules/mtree/mtree_mod.c
+++ b/src/modules/mtree/mtree_mod.c
@@ -930,7 +930,8 @@ static const char* rpc_mtree_summary_doc[2] = {
void rpc_mtree_reload(rpc_t* rpc, void* c)
{
str tname = {0, 0};
- m_tree_t *pt;
+ m_tree_t *pt = NULL;
+ int treloaded = 0;
if(db_table.len>0)
{
@@ -949,8 +950,13 @@ void rpc_mtree_reload(rpc_t* rpc, void* c)
/* read tree name */
if (rpc->scan(c, "S", &tname) != 1) {
- rpc->fault(c, 500, "Failed to get table name parameter");
- return;
+ tname.s = 0;
+ tname.len = 0;
+ } else {
+ if(*tname.s=='.') {
+ tname.s = 0;
+ tname.len = 0;
+ }
}
pt = mt_get_first_tree();
@@ -967,9 +973,13 @@ void rpc_mtree_reload(rpc_t* rpc, void* c)
LM_ERR("cannot re-load mtree from database\n");
goto error;
}
+ treloaded = 1;
}
pt = pt->next;
}
+ if(treloaded == 0) {
+ rpc->fault(c, 500, "No Mtree Name Matching");
+ }
}
return;