Module: sip-router Branch: master Commit: 099852dfb53b922d74bccb17b3a81df012ad37f6 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=099852df...
Author: Elena-Ramona Modroiu ramona@asipto.com Committer: Elena-Ramona Modroiu ramona@asipto.com Date: Tue Dec 20 21:39:05 2011 +0100
pdt(k): MI commands can be disabled via define PDT_NO_MI
---
modules_k/pdt/pdt.c | 4 ++++ modules_k/pdt/pdt_mi.c | 3 +++ modules_k/pdt/pdtree.h | 5 ++++- 3 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/modules_k/pdt/pdt.c b/modules_k/pdt/pdt.c index 276ea16..2748ea2 100644 --- a/modules_k/pdt/pdt.c +++ b/modules_k/pdt/pdt.c @@ -151,11 +151,15 @@ struct module_exports exports = { */ static int mod_init(void) { + +#ifndef PDT_NO_MI if(pdt_init_mi(exports.name)<0) { LM_ERR("cannot register MI commands\n"); return -1; } +#endif + db_url.len = strlen(db_url.s); db_table.len = strlen(db_table.s); sdomain_column.len = strlen(sdomain_column.s); diff --git a/modules_k/pdt/pdt_mi.c b/modules_k/pdt/pdt_mi.c index deca4de..29d877b 100644 --- a/modules_k/pdt/pdt_mi.c +++ b/modules_k/pdt/pdt_mi.c @@ -23,6 +23,8 @@ * */
+#ifndef PDT_NO_MI + #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -281,3 +283,4 @@ error: return 0; }
+#endif diff --git a/modules_k/pdt/pdtree.h b/modules_k/pdt/pdtree.h index 610a14d..03055c2 100644 --- a/modules_k/pdt/pdtree.h +++ b/modules_k/pdt/pdtree.h @@ -66,10 +66,13 @@ int pdt_check_pd(pdt_tree_t *pt, str* sdomain, str *sp, str *sd);
int pdt_init_db(void); int pdt_load_db(void); -int pdt_init_mi(char *mod); str *pdt_get_char_list(void);
pdt_tree_t **pdt_get_ptree(void);
+#ifndef PDT_NO_MI +int pdt_init_mi(char *mod); +#endif + #endif