mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
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
This commit is contained in:
@@ -457,11 +457,17 @@ struct agents_cfg {
|
|||||||
struct ao2_container *agents;
|
struct ao2_container *agents;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const char *agent_type_blacklist[] = {
|
||||||
|
"general",
|
||||||
|
"agents",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
static struct aco_type agent_type = {
|
static struct aco_type agent_type = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "agent-id",
|
.name = "agent-id",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_ARRAY,
|
||||||
.category = "^(general|agents)$",
|
.category = (const char *)agent_type_blacklist,
|
||||||
.item_alloc = agent_cfg_alloc,
|
.item_alloc = agent_cfg_alloc,
|
||||||
.item_find = agent_cfg_find,
|
.item_find = agent_cfg_find,
|
||||||
.item_offset = offsetof(struct agents_cfg, agents),
|
.item_offset = offsetof(struct agents_cfg, agents),
|
||||||
@@ -473,8 +479,8 @@ static struct aco_type *agent_types[] = ACO_TYPES(&agent_type);
|
|||||||
static struct aco_type general_type = {
|
static struct aco_type general_type = {
|
||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "global",
|
.name = "global",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_file agents_conf = {
|
static struct aco_file agents_conf = {
|
||||||
|
@@ -244,8 +244,8 @@ static struct aco_type global_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "globals",
|
.name = "globals",
|
||||||
.item_offset = offsetof(struct skel_config, global),
|
.item_offset = offsetof(struct skel_config, global),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
||||||
@@ -255,18 +255,24 @@ static struct aco_type sound_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "sounds",
|
.name = "sounds",
|
||||||
.item_offset = offsetof(struct skel_config, global),
|
.item_offset = offsetof(struct skel_config, global),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^sounds$",
|
.category = "sounds",
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aco_type *sound_options[] = ACO_TYPES(&sound_option);
|
struct aco_type *sound_options[] = ACO_TYPES(&sound_option);
|
||||||
|
|
||||||
|
static const char *level_categories[] = {
|
||||||
|
"general",
|
||||||
|
"sounds",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
/*! \brief An aco_type structure to link the everything but the "general" and "sounds" categories to the skel_level type */
|
/*! \brief An aco_type structure to link the everything but the "general" and "sounds" categories to the skel_level type */
|
||||||
static struct aco_type level_option = {
|
static struct aco_type level_option = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "level",
|
.name = "level",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_ARRAY,
|
||||||
.category = "^(general|sounds)$",
|
.category = (const char *)level_categories,
|
||||||
.item_alloc = skel_level_alloc,
|
.item_alloc = skel_level_alloc,
|
||||||
.item_find = skel_level_find,
|
.item_find = skel_level_find,
|
||||||
.item_offset = offsetof(struct skel_config, levels),
|
.item_offset = offsetof(struct skel_config, levels),
|
||||||
|
@@ -377,7 +377,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
regardless if this limit is reached or not.
|
regardless if this limit is reached or not.
|
||||||
</para></description>
|
</para></description>
|
||||||
</configOption>
|
</configOption>
|
||||||
<configOption name="^sound_">
|
<configOption name="sound_">
|
||||||
<synopsis>Override the various conference bridge sound files</synopsis>
|
<synopsis>Override the various conference bridge sound files</synopsis>
|
||||||
<description><para>
|
<description><para>
|
||||||
All sounds in the conference are customizable using the bridge profile options below.
|
All sounds in the conference are customizable using the bridge profile options below.
|
||||||
@@ -592,8 +592,8 @@ static void *bridge_profile_find(struct ao2_container *container, const char *ca
|
|||||||
static struct aco_type bridge_type = {
|
static struct aco_type bridge_type = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "bridge_profile",
|
.name = "bridge_profile",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.matchfield = "type",
|
.matchfield = "type",
|
||||||
.matchvalue = "bridge",
|
.matchvalue = "bridge",
|
||||||
.item_alloc = bridge_profile_alloc,
|
.item_alloc = bridge_profile_alloc,
|
||||||
@@ -629,8 +629,8 @@ static void *user_profile_find(struct ao2_container *container, const char *cate
|
|||||||
static struct aco_type user_type = {
|
static struct aco_type user_type = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "user_profile",
|
.name = "user_profile",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.matchfield = "type",
|
.matchfield = "type",
|
||||||
.matchvalue = "user",
|
.matchvalue = "user",
|
||||||
.item_alloc = user_profile_alloc,
|
.item_alloc = user_profile_alloc,
|
||||||
@@ -660,8 +660,8 @@ static void *menu_find(struct ao2_container *container, const char *category)
|
|||||||
static struct aco_type menu_type = {
|
static struct aco_type menu_type = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "menu",
|
.name = "menu",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.matchfield = "type",
|
.matchfield = "type",
|
||||||
.matchvalue = "menu",
|
.matchvalue = "menu",
|
||||||
.item_alloc = menu_alloc,
|
.item_alloc = menu_alloc,
|
||||||
@@ -678,8 +678,8 @@ static struct aco_type *user_types[] = ACO_TYPES(&user_type);
|
|||||||
static struct aco_type general_type = {
|
static struct aco_type general_type = {
|
||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "global",
|
.name = "global",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_file confbridge_conf = {
|
static struct aco_file confbridge_conf = {
|
||||||
@@ -2149,7 +2149,7 @@ int conf_load_config(void)
|
|||||||
aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
|
aco_option_register(&cfg_info, "record_file", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, rec_file));
|
||||||
aco_option_register(&cfg_info, "regcontext", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, regcontext));
|
aco_option_register(&cfg_info, "regcontext", ACO_EXACT, bridge_types, NULL, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, regcontext));
|
||||||
aco_option_register(&cfg_info, "language", ACO_EXACT, bridge_types, "en", OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, language));
|
aco_option_register(&cfg_info, "language", ACO_EXACT, bridge_types, "en", OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct bridge_profile, language));
|
||||||
aco_option_register_custom(&cfg_info, "^sound_", ACO_REGEX, bridge_types, NULL, sound_option_handler, 0);
|
aco_option_register_custom(&cfg_info, "sound_", ACO_PREFIX, bridge_types, NULL, sound_option_handler, 0);
|
||||||
/* This option should only be used with the CONFBRIDGE dialplan function */
|
/* This option should only be used with the CONFBRIDGE dialplan function */
|
||||||
aco_option_register_custom(&cfg_info, "template", ACO_EXACT, bridge_types, NULL, bridge_template_handler, 0);
|
aco_option_register_custom(&cfg_info, "template", ACO_EXACT, bridge_types, NULL, bridge_template_handler, 0);
|
||||||
|
|
||||||
|
@@ -543,8 +543,8 @@ static int jingle_endpoint_cmp(void *obj, void *arg, int flags)
|
|||||||
static struct aco_type endpoint_option = {
|
static struct aco_type endpoint_option = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "endpoint",
|
.name = "endpoint",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.item_alloc = jingle_endpoint_alloc,
|
.item_alloc = jingle_endpoint_alloc,
|
||||||
.item_find = jingle_endpoint_find,
|
.item_find = jingle_endpoint_find,
|
||||||
.item_offset = offsetof(struct jingle_config, endpoints),
|
.item_offset = offsetof(struct jingle_config, endpoints),
|
||||||
|
28
main/cdr.c
28
main/cdr.c
@@ -241,8 +241,29 @@ static struct aco_type general_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "general",
|
.name = "general",
|
||||||
.item_offset = offsetof(struct module_config, general),
|
.item_offset = offsetof(struct module_config, general),
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.category_match = ACO_WHITELIST,
|
.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);
|
static void *module_config_alloc(void);
|
||||||
@@ -252,8 +273,7 @@ static void module_config_post_apply(void);
|
|||||||
/*! \brief The file definition */
|
/*! \brief The file definition */
|
||||||
static struct aco_file module_file_conf = {
|
static struct aco_file module_file_conf = {
|
||||||
.filename = "cdr.conf",
|
.filename = "cdr.conf",
|
||||||
.skip_category = "(^csv$|^custom$|^manager$|^odbc$|^pgsql$|^radius$|^sqlite$|^tds$|^mysql$)",
|
.types = ACO_TYPES(&general_option, &ignore_option),
|
||||||
.types = ACO_TYPES(&general_option),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CONFIG_INFO_CORE("cdr", cfg_info, module_configs, module_config_alloc,
|
CONFIG_INFO_CORE("cdr", cfg_info, module_configs, module_config_alloc,
|
||||||
|
21
main/cel.c
21
main/cel.c
@@ -244,15 +244,28 @@ static struct aco_type general_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "general",
|
.name = "general",
|
||||||
.item_offset = offsetof(struct cel_config, general),
|
.item_offset = offsetof(struct cel_config, general),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
|
};
|
||||||
|
|
||||||
|
/*! Config sections used by existing modules. Do not add to this list. */
|
||||||
|
static const char *ignore_categories[] = {
|
||||||
|
"manager",
|
||||||
|
"radius",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct aco_type ignore_option = {
|
||||||
|
.type = ACO_IGNORE,
|
||||||
|
.name = "modules",
|
||||||
|
.category = (const char*)ignore_categories,
|
||||||
|
.category_match = ACO_WHITELIST_ARRAY,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! \brief The config file to be processed for the module. */
|
/*! \brief The config file to be processed for the module. */
|
||||||
static struct aco_file cel_conf = {
|
static struct aco_file cel_conf = {
|
||||||
.filename = "cel.conf", /*!< The name of the config file */
|
.filename = "cel.conf", /*!< The name of the config file */
|
||||||
.types = ACO_TYPES(&general_option), /*!< The mapping object types to be processed */
|
.types = ACO_TYPES(&general_option, &ignore_option), /*!< The mapping object types to be processed */
|
||||||
.skip_category = "(^manager$|^radius$)", /*!< Config sections used by existing modules. Do not add to this list. */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cel_pre_apply_config(void);
|
static int cel_pre_apply_config(void);
|
||||||
|
@@ -219,7 +219,7 @@
|
|||||||
The <replaceable>DYNAMIC_FEATURES</replaceable> is a <literal>#</literal> separated list of
|
The <replaceable>DYNAMIC_FEATURES</replaceable> is a <literal>#</literal> separated list of
|
||||||
either applicationmap item names or featuregroup names.</para>
|
either applicationmap item names or featuregroup names.</para>
|
||||||
</description>
|
</description>
|
||||||
<configOption name="^.*$" regex="true">
|
<configOption name="">
|
||||||
<synopsis>A custom feature to invoke during a bridged call</synopsis>
|
<synopsis>A custom feature to invoke during a bridged call</synopsis>
|
||||||
<description>
|
<description>
|
||||||
<para>Each item listed here is a comma-separated list of parameters that determine
|
<para>Each item listed here is a comma-separated list of parameters that determine
|
||||||
@@ -272,7 +272,7 @@
|
|||||||
DTMF sequence used to invoke an applicationmap item to be overridden with
|
DTMF sequence used to invoke an applicationmap item to be overridden with
|
||||||
a different sequence.</para>
|
a different sequence.</para>
|
||||||
</description>
|
</description>
|
||||||
<configOption name="^.*$" regex="true">
|
<configOption name="">
|
||||||
<synopsis>Applicationmap item to place in the feature group</synopsis>
|
<synopsis>Applicationmap item to place in the feature group</synopsis>
|
||||||
<description>
|
<description>
|
||||||
<para>Each item here must be a name of an item in the applicationmap. The
|
<para>Each item here must be a name of an item in the applicationmap. The
|
||||||
@@ -578,24 +578,24 @@ struct features_config {
|
|||||||
static struct aco_type global_option = {
|
static struct aco_type global_option = {
|
||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "globals",
|
.name = "globals",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.item_offset = offsetof(struct features_config, global),
|
.item_offset = offsetof(struct features_config, global),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_type featuremap_option = {
|
static struct aco_type featuremap_option = {
|
||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "featuremap",
|
.name = "featuremap",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^featuremap$",
|
.category = "featuremap",
|
||||||
.item_offset = offsetof(struct features_config, featuremap),
|
.item_offset = offsetof(struct features_config, featuremap),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_type applicationmap_option = {
|
static struct aco_type applicationmap_option = {
|
||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "applicationmap",
|
.name = "applicationmap",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^applicationmap$",
|
.category = "applicationmap",
|
||||||
.item_offset = offsetof(struct features_config, applicationmap),
|
.item_offset = offsetof(struct features_config, applicationmap),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1851,13 +1851,13 @@ static int load_config(void)
|
|||||||
aco_option_register_custom(&cfg_info, "automixmon", ACO_EXACT, featuremap_options,
|
aco_option_register_custom(&cfg_info, "automixmon", ACO_EXACT, featuremap_options,
|
||||||
DEFAULT_FEATUREMAP_AUTOMIXMON, featuremap_handler, 0);
|
DEFAULT_FEATUREMAP_AUTOMIXMON, featuremap_handler, 0);
|
||||||
|
|
||||||
aco_option_register_custom(&cfg_info, "^.*$", ACO_REGEX, applicationmap_options,
|
aco_option_register_custom(&cfg_info, "", ACO_PREFIX, applicationmap_options,
|
||||||
"", applicationmap_handler, 0);
|
"", applicationmap_handler, 0);
|
||||||
|
|
||||||
aco_option_register_custom(&cfg_info, "^.*$", ACO_REGEX, featuregroup_options,
|
aco_option_register_custom(&cfg_info, "", ACO_PREFIX, featuregroup_options,
|
||||||
"", featuregroup_handler, 0);
|
"", featuregroup_handler, 0);
|
||||||
|
|
||||||
aco_option_register_custom_nodoc(&cfg_info, "^.*$", ACO_REGEX, parkinglot_options,
|
aco_option_register_custom_nodoc(&cfg_info, "", ACO_PREFIX, parkinglot_options,
|
||||||
"", unsupported_handler, 0);
|
"", unsupported_handler, 0);
|
||||||
|
|
||||||
if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
|
if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
|
||||||
|
@@ -82,8 +82,8 @@ static void *named_acl_find(struct ao2_container *container, const char *cat);
|
|||||||
static struct aco_type named_acl_type = {
|
static struct aco_type named_acl_type = {
|
||||||
.type = ACO_ITEM, /*!< named_acls are items stored in containers, not individual global objects */
|
.type = ACO_ITEM, /*!< named_acls are items stored in containers, not individual global objects */
|
||||||
.name = "named_acl",
|
.name = "named_acl",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^general$", /*!< Match everything but "general" */
|
.category = "general", /*!< Match everything but "general" */
|
||||||
.item_alloc = named_acl_alloc, /*!< A callback to allocate a new named_acl based on category */
|
.item_alloc = named_acl_alloc, /*!< A callback to allocate a new named_acl based on category */
|
||||||
.item_find = named_acl_find, /*!< A callback to find a named_acl in some container of named_acls */
|
.item_find = named_acl_find, /*!< A callback to find a named_acl in some container of named_acls */
|
||||||
.item_offset = offsetof(struct named_acl_config, named_acl_list), /*!< Could leave this out since 0 */
|
.item_offset = offsetof(struct named_acl_config, named_acl_list), /*!< Could leave this out since 0 */
|
||||||
|
@@ -1436,8 +1436,8 @@ static struct aco_type threadpool_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "threadpool",
|
.name = "threadpool",
|
||||||
.item_offset = offsetof(struct stasis_config, threadpool_options),
|
.item_offset = offsetof(struct stasis_config, threadpool_options),
|
||||||
.category = "^threadpool$",
|
.category = "threadpool",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_type *threadpool_options[] = ACO_TYPES(&threadpool_option);
|
static struct aco_type *threadpool_options[] = ACO_TYPES(&threadpool_option);
|
||||||
@@ -1447,8 +1447,8 @@ static struct aco_type declined_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "declined_message_types",
|
.name = "declined_message_types",
|
||||||
.item_offset = offsetof(struct stasis_config, declined_message_types),
|
.item_offset = offsetof(struct stasis_config, declined_message_types),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^declined_message_types$",
|
.category = "declined_message_types",
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aco_type *declined_options[] = ACO_TYPES(&declined_option);
|
struct aco_type *declined_options[] = ACO_TYPES(&declined_option);
|
||||||
|
@@ -239,9 +239,9 @@ static int udptl_pre_apply_config(void);
|
|||||||
static struct aco_type general_option = {
|
static struct aco_type general_option = {
|
||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "global",
|
.name = "global",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.item_offset = offsetof(struct udptl_config, general),
|
.item_offset = offsetof(struct udptl_config, general),
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_type *general_options[] = ACO_TYPES(&general_option);
|
static struct aco_type *general_options[] = ACO_TYPES(&general_option);
|
||||||
|
@@ -39,8 +39,8 @@ static struct aco_type general_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "general",
|
.name = "general",
|
||||||
.item_offset = offsetof(struct ast_ari_conf, general),
|
.item_offset = offsetof(struct ast_ari_conf, general),
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_type *general_options[] = ACO_TYPES(&general_option);
|
static struct aco_type *general_options[] = ACO_TYPES(&general_option);
|
||||||
@@ -156,8 +156,8 @@ static void *user_find(struct ao2_container *tmp_container, const char *cat)
|
|||||||
static struct aco_type user_option = {
|
static struct aco_type user_option = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "user",
|
.name = "user",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.matchfield = "type",
|
.matchfield = "type",
|
||||||
.matchvalue = "user",
|
.matchvalue = "user",
|
||||||
.item_alloc = user_alloc,
|
.item_alloc = user_alloc,
|
||||||
|
@@ -260,8 +260,8 @@ static struct aco_type global_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "general",
|
.name = "general",
|
||||||
.item_offset = offsetof(struct module_config, general),
|
.item_offset = offsetof(struct module_config, general),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
||||||
|
@@ -291,8 +291,8 @@ static struct aco_type global_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "globals",
|
.name = "globals",
|
||||||
.item_offset = offsetof(struct parking_config, global),
|
.item_offset = offsetof(struct parking_config, global),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
||||||
@@ -300,8 +300,8 @@ struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
|||||||
static struct aco_type parking_lot_type = {
|
static struct aco_type parking_lot_type = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "parking_lot",
|
.name = "parking_lot",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^(general)$",
|
.category = "general",
|
||||||
.item_alloc = parking_lot_cfg_alloc,
|
.item_alloc = parking_lot_cfg_alloc,
|
||||||
.item_find = named_item_find,
|
.item_find = named_item_find,
|
||||||
.item_offset = offsetof(struct parking_config, parking_lots),
|
.item_offset = offsetof(struct parking_config, parking_lots),
|
||||||
|
@@ -82,7 +82,7 @@
|
|||||||
order; any other header is treated as part of the SIP
|
order; any other header is treated as part of the SIP
|
||||||
request.</para>
|
request.</para>
|
||||||
</description>
|
</description>
|
||||||
<configOption name="^.*$">
|
<configOption name="">
|
||||||
<synopsis>A key/value pair to add to a NOTIFY request.</synopsis>
|
<synopsis>A key/value pair to add to a NOTIFY request.</synopsis>
|
||||||
<description>
|
<description>
|
||||||
<para>If the key is <literal>Content</literal>,
|
<para>If the key is <literal>Content</literal>,
|
||||||
@@ -234,8 +234,8 @@ static void *notify_cfg_alloc(void)
|
|||||||
static struct aco_type notify_option = {
|
static struct aco_type notify_option = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "notify",
|
.name = "notify",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.item_offset = offsetof(struct notify_cfg, notify_options),
|
.item_offset = offsetof(struct notify_cfg, notify_options),
|
||||||
.item_alloc = notify_option_alloc,
|
.item_alloc = notify_option_alloc,
|
||||||
.item_find = notify_option_find
|
.item_find = notify_option_find
|
||||||
@@ -993,7 +993,7 @@ static int load_module(void)
|
|||||||
return AST_MODULE_LOAD_DECLINE;
|
return AST_MODULE_LOAD_DECLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
aco_option_register_custom(¬ify_cfg, "^.*$", ACO_REGEX, notify_options,
|
aco_option_register_custom(¬ify_cfg, "", ACO_PREFIX, notify_options,
|
||||||
"", notify_option_handler, 0);
|
"", notify_option_handler, 0);
|
||||||
|
|
||||||
if (aco_process_config(¬ify_cfg, 0)) {
|
if (aco_process_config(¬ify_cfg, 0)) {
|
||||||
|
@@ -233,8 +233,8 @@ static struct aco_type global_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "global",
|
.name = "global",
|
||||||
.item_offset = offsetof(struct conf, global),
|
.item_offset = offsetof(struct conf, global),
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
.category_match = ACO_WHITELIST
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
static struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
||||||
|
@@ -822,8 +822,8 @@ static struct aco_type global_option = {
|
|||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.name = "global",
|
.name = "global",
|
||||||
.item_offset = offsetof(struct xmpp_config, global),
|
.item_offset = offsetof(struct xmpp_config, global),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^general$",
|
.category = "general",
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
||||||
@@ -831,8 +831,8 @@ struct aco_type *global_options[] = ACO_TYPES(&global_option);
|
|||||||
static struct aco_type client_option = {
|
static struct aco_type client_option = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.name = "client",
|
.name = "client",
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_EXACT,
|
||||||
.category = "^(general)$",
|
.category = "general",
|
||||||
.item_alloc = ast_xmpp_client_config_alloc,
|
.item_alloc = ast_xmpp_client_config_alloc,
|
||||||
.item_find = xmpp_config_find,
|
.item_find = xmpp_config_find,
|
||||||
.item_prelink = xmpp_config_prelink,
|
.item_prelink = xmpp_config_prelink,
|
||||||
|
@@ -1458,13 +1458,19 @@ static struct aco_type global = {
|
|||||||
static struct aco_type global_defaults = {
|
static struct aco_type global_defaults = {
|
||||||
.type = ACO_GLOBAL,
|
.type = ACO_GLOBAL,
|
||||||
.item_offset = offsetof(struct test_config, global_defaults),
|
.item_offset = offsetof(struct test_config, global_defaults),
|
||||||
.category_match = ACO_WHITELIST,
|
.category_match = ACO_WHITELIST_EXACT,
|
||||||
.category = "^global_defaults$",
|
.category = "global_defaults",
|
||||||
};
|
};
|
||||||
|
static const char *item_blacklist[] = {
|
||||||
|
"global",
|
||||||
|
"global_defaults",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
static struct aco_type item = {
|
static struct aco_type item = {
|
||||||
.type = ACO_ITEM,
|
.type = ACO_ITEM,
|
||||||
.category_match = ACO_BLACKLIST,
|
.category_match = ACO_BLACKLIST_ARRAY,
|
||||||
.category = "^(global|global_defaults)$",
|
.category = (const char *)item_blacklist,
|
||||||
.item_alloc = test_item_alloc,
|
.item_alloc = test_item_alloc,
|
||||||
.item_find = test_item_find,
|
.item_find = test_item_find,
|
||||||
.item_offset = offsetof(struct test_config, items),
|
.item_offset = offsetof(struct test_config, items),
|
||||||
|
Reference in New Issue
Block a user