summaryrefslogtreecommitdiff
path: root/main/cdr.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-12-12 13:55:12 -0500
committerCorey Farrell <git@cfware.com>2017-12-15 10:14:31 -0500
commitbf2d35931d65c73bbb3efec5ce9d284a730cae5e (patch)
treeaadbe18dfd53e2158c101407bb20401a43529612 /main/cdr.c
parenta455e183206fb506d0f4d24d991c122549e0d464 (diff)
aco: Minimize use of regex.
Remove nearly all use of regex from ACO users. Still remaining: * app_confbridge has a legitamate use of option name regex. * ast_sorcery_object_fields_register is implemented with regex, all callers use simple prefix based regex. I haven't decided the best way to fix this in both 13/15 and master. Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b
Diffstat (limited to 'main/cdr.c')
-rw-r--r--main/cdr.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/main/cdr.c b/main/cdr.c
index 3681cdc6b..d7384f259 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -238,8 +238,29 @@ static struct aco_type general_option = {
.type = ACO_GLOBAL,
.name = "general",
.item_offset = offsetof(struct module_config, general),
- .category = "^general$",
- .category_match = ACO_WHITELIST,
+ .category = "general",
+ .category_match = ACO_WHITELIST_EXACT,
+};
+
+/*! Config sections used by existing modules. Do not add to this list. */
+static const char *ignore_categories[] = {
+ "csv",
+ "custom",
+ "manager",
+ "odbc",
+ "pgsql",
+ "radius",
+ "sqlite",
+ "tds",
+ "mysql",
+ NULL,
+};
+
+static struct aco_type ignore_option = {
+ .type = ACO_IGNORE,
+ .name = "modules",
+ .category = (const char*)ignore_categories,
+ .category_match = ACO_WHITELIST_ARRAY,
};
static void *module_config_alloc(void);
@@ -249,8 +270,7 @@ static void module_config_post_apply(void);
/*! \brief The file definition */
static struct aco_file module_file_conf = {
.filename = "cdr.conf",
- .skip_category = "(^csv$|^custom$|^manager$|^odbc$|^pgsql$|^radius$|^sqlite$|^tds$|^mysql$)",
- .types = ACO_TYPES(&general_option),
+ .types = ACO_TYPES(&general_option, &ignore_option),
};
CONFIG_INFO_CORE("cdr", cfg_info, module_configs, module_config_alloc,