Configuration File Parser. More...
Go to the source code of this file.
Data Structures | |
struct | ast_config_engine |
Configuration engine structure, used to define realtime drivers. More... | |
struct | ast_variable |
Structure for variables, used for configurations and for channel variables. More... | |
Macros | |
#define | ast_config_load(filename, flags) ast_config_load2(filename, AST_MODULE, flags) |
Load a config file. More... | |
#define | CONFIG_STATUS_FILEINVALID (void *)-2 |
#define | CONFIG_STATUS_FILEMISSING (void *)0 |
#define | CONFIG_STATUS_FILEUNCHANGED (void *)-1 |
#define | CV_BOOL(__x, __dst) CV_F(__x, (__dst) = ast_true(__val) ) |
helper macros to assign the value to a BOOL, UINT, static string and dynamic string More... | |
#define | CV_DSTR(__x, __dst) CV_F(__x, ast_free(__dst); __dst = ast_strdup(__val)) |
#define | CV_END } while (0) |
close a variable parsing block More... | |
#define | CV_F(__pattern, __body) if (!strcasecmp((__var), __pattern)) { __body; break; } |
call a generic function if the name matches. More... | |
#define | CV_START(__in_var, __in_val) |
the macro to open a block for variable parsing More... | |
#define | CV_STR(__x, __dst) CV_F(__x, ast_copy_string(__dst, __val, sizeof(__dst))) |
#define | CV_STRFIELD(__x, __obj, __field) CV_F(__x, ast_string_field_set(__obj, __field, __val)) |
#define | CV_UINT(__x, __dst) CV_F(__x, (__dst) = strtoul(__val, NULL, 0) ) |
Typedefs | |
typedef struct ast_config * | config_load_func (const char *database, const char *table, const char *configfile, struct ast_config *config, struct ast_flags flags, const char *suggested_include_file, const char *who_asked) |
typedef int | realtime_destroy (const char *database, const char *table, const char *keyfield, const char *entity, va_list ap) |
typedef struct ast_config * | realtime_multi_get (const char *database, const char *table, va_list ap) |
typedef int | realtime_require (const char *database, const char *table, va_list ap) |
Function pointer called to ensure database schema is properly configured for realtime use. More... | |
typedef int | realtime_store (const char *database, const char *table, va_list ap) |
typedef int | realtime_unload (const char *database, const char *table) |
Function pointer called to clear the database cache and free resources used for such. More... | |
typedef int | realtime_update (const char *database, const char *table, const char *keyfield, const char *entity, va_list ap) |
typedef int | realtime_update2 (const char *database, const char *table, va_list ap) |
typedef struct ast_variable * | realtime_var_get (const char *database, const char *table, va_list ap) |
Enumerations | |
enum | { CONFIG_FLAG_WITHCOMMENTS = (1 << 0), CONFIG_FLAG_FILEUNCHANGED = (1 << 1), CONFIG_FLAG_NOCACHE = (1 << 2), CONFIG_FLAG_NOREALTIME = (1 << 3) } |
enum | ast_parse_flags { PARSE_TYPE = 0x000f, PARSE_INT32 = 0x0001, PARSE_UINT32 = 0x0002, PARSE_DOUBLE = 0x0003, PARSE_ADDR = 0x000e, PARSE_INADDR = 0x000f, PARSE_DEFAULT = 0x0010, PARSE_IN_RANGE = 0x0020, PARSE_OUT_RANGE = 0x0040, PARSE_PORT_MASK = 0x0300, PARSE_PORT_IGNORE = 0x0100, PARSE_PORT_REQUIRE = 0x0200, PARSE_PORT_FORBID = 0x0300 } |
Support code to parse config file arguments. More... | |
enum | require_type { RQ_INTEGER1, RQ_UINTEGER1, RQ_INTEGER2, RQ_UINTEGER2, RQ_INTEGER3, RQ_UINTEGER3, RQ_INTEGER4, RQ_UINTEGER4, RQ_INTEGER8, RQ_UINTEGER8, RQ_CHAR, RQ_FLOAT, RQ_DATE, RQ_DATETIME } |
Types used in ast_realtime_require_field. More... | |
Functions | |
void | ast_category_append (struct ast_config *config, struct ast_category *cat) |
char * | ast_category_browse (struct ast_config *config, const char *prev) |
Goes through categories. More... | |
int | ast_category_delete (struct ast_config *cfg, const char *category) |
void | ast_category_destroy (struct ast_category *cat) |
struct ast_variable * | ast_category_detach_variables (struct ast_category *cat) |
int | ast_category_empty (struct ast_config *cfg, const char *category) |
Removes and destroys all variables within a category. More... | |
int | ast_category_exist (const struct ast_config *config, const char *category_name) |
Check for category duplicates. More... | |
struct ast_variable * | ast_category_first (struct ast_category *cat) |
given a pointer to a category, return the root variable. More... | |
struct ast_category * | ast_category_get (const struct ast_config *config, const char *category_name) |
Retrieve a category if it exists. More... | |
int | ast_category_insert (struct ast_config *config, struct ast_category *cat, const char *match) |
Inserts new category. More... | |
struct ast_category * | ast_category_new (const char *name, const char *in_file, int lineno) |
Create a category structure. More... | |
void | ast_category_rename (struct ast_category *cat, const char *name) |
struct ast_variable * | ast_category_root (struct ast_config *config, char *cat) |
returns the root ast_variable of a config More... | |
int | ast_check_realtime (const char *family) |
Check if realtime engine is configured for family. More... | |
void | ast_config_destroy (struct ast_config *config) |
Destroys a config. More... | |
int | ast_config_engine_deregister (struct ast_config_engine *del) |
Deregister config engine. More... | |
int | ast_config_engine_register (struct ast_config_engine *newconfig) |
Register config engine. More... | |
struct ast_category * | ast_config_get_current_category (const struct ast_config *cfg) |
Retrieve the current category name being built. More... | |
struct ast_config * | ast_config_internal_load (const char *configfile, struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl_file, const char *who_asked) |
struct ast_config * | ast_config_load2 (const char *filename, const char *who_asked, struct ast_flags flags) |
Load a config file. More... | |
struct ast_config * | ast_config_new (void) |
Create a new base configuration structure. More... | |
const char * | ast_config_option (struct ast_config *cfg, const char *cat, const char *var) |
Retrieve a configuration variable within the configuration set. More... | |
void | ast_config_set_current_category (struct ast_config *cfg, const struct ast_category *cat) |
Set the category within the configuration as being current. More... | |
int | ast_config_text_file_save (const char *filename, const struct ast_config *cfg, const char *generator) |
int | ast_destroy_realtime (const char *family, const char *keyfield, const char *lookup,...) attribute_sentinel |
Destroy realtime configuration. More... | |
struct ast_config_include * | ast_include_find (struct ast_config *conf, const char *included_file) |
struct ast_config_include * | ast_include_new (struct ast_config *conf, const char *from_file, const char *included_file, int is_exec, const char *exec_file, int from_lineno, char *real_included_file_name, int real_included_file_name_size) |
void | ast_include_rename (struct ast_config *conf, const char *from_file, const char *to_file) |
struct ast_variable * | ast_load_realtime (const char *family,...) attribute_sentinel |
Retrieve realtime configuration. More... | |
struct ast_variable * | ast_load_realtime_all (const char *family,...) attribute_sentinel |
struct ast_config * | ast_load_realtime_multientry (const char *family,...) attribute_sentinel |
Retrieve realtime configuration. More... | |
int | ast_parse_arg (const char *arg, enum ast_parse_flags flags, void *result,...) |
The argument parsing routine. More... | |
char * | ast_realtime_decode_chunk (char *chunk) |
Remove standard encoding from realtime values, which ensures that a semicolon embedded within a single value is not treated upon retrieval as multiple values. More... | |
int | ast_realtime_enabled (void) |
Check if there's any realtime engines loaded. More... | |
char * | ast_realtime_encode_chunk (struct ast_str **dest, ssize_t maxlen, const char *chunk) |
Encodes a chunk of data for realtime. More... | |
int | ast_realtime_require_field (const char *family,...) attribute_sentinel |
Inform realtime what fields that may be stored. More... | |
int | ast_rq_is_int (require_type type) |
Check if require type is an integer type. More... | |
int | ast_store_realtime (const char *family,...) attribute_sentinel |
Create realtime configuration. More... | |
int | ast_unload_realtime (const char *family) |
Release any resources cached for a realtime family. More... | |
int | ast_update2_realtime (const char *family,...) attribute_sentinel |
Update realtime configuration. More... | |
int | ast_update_realtime (const char *family, const char *keyfield, const char *lookup,...) attribute_sentinel |
Update realtime configuration. More... | |
void | ast_variable_append (struct ast_category *category, struct ast_variable *variable) |
struct ast_variable * | ast_variable_browse (const struct ast_config *config, const char *category) |
Goes through variables. More... | |
int | ast_variable_delete (struct ast_category *category, const char *variable, const char *match, const char *line) |
void | ast_variable_insert (struct ast_category *category, struct ast_variable *variable, const char *line) |
struct ast_variable * | ast_variable_new (const char *name, const char *value, const char *filename) |
const char * | ast_variable_retrieve (const struct ast_config *config, const char *category, const char *variable) |
Gets a variable. More... | |
int | ast_variable_update (struct ast_category *category, const char *variable, const char *value, const char *match, unsigned int object) |
Update variable value within a config. More... | |
void | ast_variables_destroy (struct ast_variable *var) |
Free variable list. More... | |
struct ast_variable * | ast_variables_dup (struct ast_variable *var) |
Duplicate variable list. More... | |
struct ast_variable * | ast_variables_reverse (struct ast_variable *var) |
Reverse a variable list. More... | |
int | config_text_file_save (const char *filename, const struct ast_config *cfg, const char *generator) |
int | read_config_maps (void) |
Exposed re-initialization method for core process. More... | |
int | register_config_cli (void) |
Exposed initialization method for core process. More... | |
Configuration File Parser.
Definition in file config.h.
#define ast_config_load | ( | filename, | |
flags | |||
) | ast_config_load2(filename, AST_MODULE, flags) |
Load a config file.
filename | path of file to open. If no preceding '/' character, path is considered relative to AST_CONFIG_DIR |
flags | Optional flags: CONFIG_FLAG_WITHCOMMENTS - load the file with comments intact; CONFIG_FLAG_FILEUNCHANGED - check the file mtime and return CONFIG_STATUS_FILEUNCHANGED if the mtime is the same; or CONFIG_FLAG_NOCACHE - don't cache file mtime (main purpose of this option is to save memory on temporary files). |
Create a config structure from a given configuration file.
NULL | on error |
Definition at line 170 of file config.h.
Referenced by adsi_load(), advanced_options(), aji_load_config(), ast_plc_reload(), conf_exec(), config_function_read(), config_load(), config_module(), directory_exec(), festival_exec(), find_conf(), gtalk_load_config(), handle_cli_dialplan_save(), jingle_load_config(), load_config(), load_config_meetme(), load_module(), load_moh_classes(), load_odbc_config(), load_pktccops_config(), make_email_file(), odbc_load_module(), osp_load(), parse_config(), pbx_load_config(), pbx_load_users(), play_message(), prep_email_sub_vars(), read_agent_config(), read_password_from_file(), realtime_directory(), reload(), reload_config(), reload_followme(), reload_module(), reload_queue_rules(), reload_queues(), set_config(), setup_dahdi_int(), sla_load_config(), smdi_load(), tds_load_module(), vm_change_password(), and vm_forwardoptions().
#define CONFIG_STATUS_FILEINVALID (void *)-2 |
Definition at line 52 of file config.h.
Referenced by __ast_http_load(), __ast_http_post_load(), __ast_udptl_reload(), __init_manager(), _dsp_init(), action_getconfig(), action_getconfigjson(), action_listcategories(), action_updateconfig(), adsi_load(), aji_load_config(), ast_config_internal_load(), ast_config_load2(), ast_plc_reload(), ast_readconfig(), ast_xmldoc_load_documentation(), conf_exec(), config_function_read(), config_load(), config_module(), config_text_file_load(), directory_exec(), do_reload(), festival_exec(), find_conf(), gtalk_load_config(), iax_provision_reload(), init_logger_chain(), initialize_cc_max_requests(), jingle_load_config(), load_config(), load_config_meetme(), load_indications(), load_module(), load_modules(), load_moh_classes(), load_odbc_config(), misdn_cfg_init(), odbc_load_module(), osp_load(), parse_config(), pbx_load_config(), private_enum_init(), read_agent_config(), read_config_maps(), realtime_directory(), reload(), reload_config(), reload_followme(), reload_module(), reload_queue_rules(), reload_queues(), rtp_reload(), run_startup_commands(), set_config(), setup_dahdi_int(), sla_load_config(), smdi_load(), tds_load_module(), and valid_config().
#define CONFIG_STATUS_FILEMISSING (void *)0 |
Definition at line 50 of file config.h.
Referenced by __ast_http_load(), __ast_http_post_load(), __ast_udptl_reload(), _dsp_init(), action_getconfig(), adsi_load(), aji_load_config(), ast_plc_reload(), ast_readconfig(), do_reload(), load_config(), load_indications(), load_modules(), load_moh_classes(), load_odbc_config(), parse_config(), private_enum_init(), rtp_reload(), and run_startup_commands().
#define CONFIG_STATUS_FILEUNCHANGED (void *)-1 |
Definition at line 51 of file config.h.
Referenced by __ast_http_load(), __ast_http_post_load(), __ast_udptl_reload(), __init_manager(), _dsp_init(), adsi_load(), aji_load_config(), ast_cli_perms_init(), ast_config_internal_load(), ast_config_load2(), ast_plc_reload(), ast_readconfig(), config_function_read(), config_module(), config_text_file_load(), do_reload(), iax_provision_reload(), load_config(), load_indications(), load_moh_classes(), misdn_cfg_init(), odbc_load_module(), osp_load(), parse_config(), private_enum_init(), read_agent_config(), reload(), reload_config(), reload_followme(), reload_queue_rules(), reload_queues(), rtp_reload(), run_startup_commands(), set_config(), setup_dahdi_int(), sla_load_config(), smdi_load(), and tds_load_module().
helper macros to assign the value to a BOOL, UINT, static string and dynamic string
Definition at line 742 of file config.h.
Referenced by store_config_core().
#define CV_DSTR | ( | __x, | |
__dst | |||
) | CV_F(__x, ast_free(__dst); __dst = ast_strdup(__val)) |
#define CV_END } while (0) |
close a variable parsing block
Definition at line 733 of file config.h.
Referenced by store_config_core(), and store_config_tone_zone().
#define CV_F | ( | __pattern, | |
__body | |||
) | if (!strcasecmp((__var), __pattern)) { __body; break; } |
call a generic function if the name matches.
Definition at line 736 of file config.h.
Referenced by store_config_core(), and store_config_tone_zone().
#define CV_START | ( | __in_var, | |
__in_val | |||
) |
the macro to open a block for variable parsing
Definition at line 727 of file config.h.
Referenced by store_config_core(), and store_config_tone_zone().
#define CV_STR | ( | __x, | |
__dst | |||
) | CV_F(__x, ast_copy_string(__dst, __val, sizeof(__dst))) |
Definition at line 744 of file config.h.
Referenced by store_config_core(), and store_config_tone_zone().
#define CV_STRFIELD | ( | __x, | |
__obj, | |||
__field | |||
) | CV_F(__x, ast_string_field_set(__obj, __field, __val)) |
Definition at line 746 of file config.h.
Referenced by store_config_core().
#define CV_UINT | ( | __x, | |
__dst | |||
) | CV_F(__x, (__dst) = strtoul(__val, NULL, 0) ) |
Definition at line 743 of file config.h.
Referenced by store_config_core().
typedef struct ast_config* config_load_func(const char *database, const char *table, const char *configfile, struct ast_config *config, struct ast_flags flags, const char *suggested_include_file, const char *who_asked) |
typedef struct ast_config* realtime_multi_get(const char *database, const char *table, va_list ap) |
typedef int realtime_require(const char *database, const char *table, va_list ap) |
typedef int realtime_store(const char *database, const char *table, va_list ap) |
typedef int realtime_unload(const char *database, const char *table) |
typedef int realtime_update2(const char *database, const char *table, va_list ap) |
typedef struct ast_variable* realtime_var_get(const char *database, const char *table, va_list ap) |
anonymous enum |
Options for ast_config_load()
enum ast_parse_flags |
Support code to parse config file arguments.
The function ast_parse_arg() provides a generic interface to parse strings (e.g. numbers, network addresses and so on) in a flexible way, e.g. by doing proper error and bound checks, provide default values, and so on. The function (described later) takes a string as an argument, a set of flags to specify the result format and checks to perform, a pointer to the result, and optionally some additional arguments.
Enumerator | |
---|---|
PARSE_TYPE | |
PARSE_INT32 | |
PARSE_UINT32 | |
PARSE_DOUBLE | |
PARSE_ADDR | |
PARSE_INADDR | |
PARSE_DEFAULT | |
PARSE_IN_RANGE | |
PARSE_OUT_RANGE | |
PARSE_PORT_MASK | |
PARSE_PORT_IGNORE | |
PARSE_PORT_REQUIRE | |
PARSE_PORT_FORBID |
Definition at line 620 of file config.h.
enum require_type |
Types used in ast_realtime_require_field.
Enumerator | |
---|---|
RQ_INTEGER1 | |
RQ_UINTEGER1 | |
RQ_INTEGER2 | |
RQ_UINTEGER2 | |
RQ_INTEGER3 | |
RQ_UINTEGER3 | |
RQ_INTEGER4 | |
RQ_UINTEGER4 | |
RQ_INTEGER8 | |
RQ_UINTEGER8 | |
RQ_CHAR | |
RQ_FLOAT | |
RQ_DATE | |
RQ_DATETIME |
Definition at line 57 of file config.h.
void ast_category_append | ( | struct ast_config * | config, |
struct ast_category * | cat | ||
) |
Definition at line 719 of file config.c.
References ast_config::current, ast_category::include_level, ast_config::include_level, ast_config::last, ast_category::next, and ast_config::root.
Referenced by add_cfg_entry(), add_rt_multi_cfg_entry(), config_curl(), config_ldap(), config_odbc(), config_pgsql(), handle_updates(), process_text_line(), realtime_directory(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), and write_password_to_file().
char* ast_category_browse | ( | struct ast_config * | config, |
const char * | prev | ||
) |
Goes through categories.
config | Which config structure you wish to "browse" |
prev | A pointer to a previous category. |
This function is kind of non-intuitive in it's use. To begin, one passes NULL as the second argument. It will return a pointer to the string of the first category in the file. From here on after, one must then pass the previous usage's return value as the second pointer, and it will return a pointer to the category name afterwards.
a | category on success |
NULL | on failure/no-more-categories |
Definition at line 810 of file config.c.
References ast_config::last_browse, ast_category::name, ast_category::next, next_available_category(), and ast_config::root.
Referenced by __init_manager(), __queues_show(), action_getconfig(), action_getconfigjson(), action_listcategories(), actual_load_config(), aji_load_config(), ast_cli_perms_init(), complete_sipnotify(), conf_exec(), config_load(), find_queue_by_name_rt(), find_realtime(), get_insecure_variable_from_config(), get_insecure_variable_from_sipregs(), gtalk_load_config(), iax_provision_reload(), jingle_load_config(), load_config(), load_indications(), load_module(), load_moh_classes(), load_odbc_config(), load_pktccops_config(), load_tech_calendars(), misdn_cfg_init(), osp_load(), parse_config(), pbx_load_config(), pbx_load_users(), process_config(), queues_data_provider_get(), read_agent_config(), realtime_directory(), realtime_switch_common(), reload(), reload_config(), reload_followme(), reload_queue_rules(), reload_queues(), search_directory(), search_directory_sub(), set_config(), setup_dahdi_int(), show_users_realtime(), sla_load_config(), update_realtime_members(), and vm_change_password().
int ast_category_delete | ( | struct ast_config * | cfg, |
const char * | category | ||
) |
Definition at line 976 of file config.c.
References ast_category_destroy(), ast_config::last, ast_category::next, and ast_config::root.
Referenced by handle_updates().
void ast_category_destroy | ( | struct ast_category * | cat | ) |
Definition at line 762 of file config.c.
References ast_comment_destroy(), ast_destroy_template_list(), ast_free, ast_variables_destroy(), ast_category::file, ast_category::last, ast_category::precomments, ast_category::root, ast_category::sameline, and ast_category::trailing.
Referenced by add_cfg_entry(), ast_category_delete(), ast_category_new(), ast_config_destroy(), handle_updates(), process_text_line(), realtime_multi_odbc(), and write_password_to_file().
struct ast_variable* ast_category_detach_variables | ( | struct ast_category * | cat | ) |
Definition at line 856 of file config.c.
References ast_category::last, and ast_category::root.
Referenced by realtime_switch_common().
int ast_category_empty | ( | struct ast_config * | cfg, |
const char * | category | ||
) |
Removes and destroys all variables within a category.
0 | if the category was found and emptied |
-1 | if the category was not found |
Definition at line 1021 of file config.c.
References ast_variables_destroy(), ast_category::last, ast_category::name, ast_category::next, ast_category::root, and ast_config::root.
Referenced by handle_updates().
int ast_category_exist | ( | const struct ast_config * | config, |
const char * | category_name | ||
) |
Check for category duplicates.
config | which config to use |
category_name | name of the category you're looking for |
This will search through the categories within a given config file for a match.
Definition at line 714 of file config.c.
References ast_category_get().
struct ast_variable* ast_category_first | ( | struct ast_category * | cat | ) |
given a pointer to a category, return the root variable.
This is equivalent to ast_variable_browse(), but more efficient if we already have the struct ast_category * (e.g. from ast_category_get())
return the first var of a category
Definition at line 796 of file config.c.
References ast_category::root.
Referenced by process_text_line().
struct ast_category* ast_category_get | ( | const struct ast_config * | config, |
const char * | category_name | ||
) |
Retrieve a category if it exists.
config | which config to use |
category_name | name of the category you're looking for |
This will search through the categories within a given config file for a match.
pointer | to category if found |
NULL | if not. |
Definition at line 709 of file config.c.
References category_get().
Referenced by ast_category_exist(), ast_category_root(), ast_variable_browse(), handle_updates(), realtime_directory(), realtime_switch_common(), vm_change_password(), and vm_forwardoptions().
int ast_category_insert | ( | struct ast_config * | config, |
struct ast_category * | cat, | ||
const char * | match | ||
) |
Inserts new category.
config | which config to use |
cat | newly created category to insert |
match | which category to insert above |
This function is used to insert a new category above another category matching the match parameter.
0 | if succeeded |
-1 | if NULL parameters or match category was not found |
Definition at line 730 of file config.c.
References ast_category::name, ast_category::next, and ast_config::root.
Referenced by handle_updates().
struct ast_category* ast_category_new | ( | const char * | name, |
const char * | in_file, | ||
int | lineno | ||
) |
Create a category structure.
Definition at line 673 of file config.c.
References ast_calloc, ast_category_destroy(), ast_copy_string(), ast_strdup, ast_category::file, ast_category::lineno, and ast_category::name.
Referenced by add_cfg_entry(), add_rt_multi_cfg_entry(), config_curl(), config_ldap(), config_odbc(), config_pgsql(), handle_updates(), process_text_line(), realtime_directory(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), and write_password_to_file().
void ast_category_rename | ( | struct ast_category * | cat, |
const char * | name | ||
) |
Definition at line 867 of file config.c.
References ast_copy_string(), and ast_category::name.
Referenced by handle_updates(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), and realtime_multi_pgsql().
struct ast_variable* ast_category_root | ( | struct ast_config * | config, |
char * | cat | ||
) |
returns the root ast_variable of a config
config | pointer to an ast_config data structure |
cat | name of the category for which you want the root |
Definition at line 801 of file config.c.
References ast_category_get(), and ast_category::root.
Referenced by get_insecure_variable_from_config(), and get_insecure_variable_from_sipregs().
int ast_check_realtime | ( | const char * | family | ) |
Check if realtime engine is configured for family.
family | which family/config to be checked |
Definition at line 2587 of file config.c.
References ast_realtime_enabled(), and find_engine().
Referenced by __queues_show(), _sip_show_peer(), _sip_show_peers(), ast_queue_log(), close_mailbox(), copy_plain_file(), destroy_association(), find_realtime_gw(), handle_response_peerpoke(), handle_voicemail_show_users(), leave_voicemail(), load_module(), load_moh_classes(), local_ast_moh_start(), logger_queue_rt_start(), realtime_peer(), realtime_update_peer(), rename_file(), sip_poke_noanswer(), sip_show_settings(), and vm_delete().
void ast_config_destroy | ( | struct ast_config * | config | ) |
Destroys a config.
config | pointer to config data structure |
Free memory associated with a given config
Definition at line 1037 of file config.c.
References ast_category_destroy(), ast_free, ast_includes_destroy(), ast_config::includes, ast_category::next, and ast_config::root.
Referenced by __ast_http_load(), __ast_http_post_load(), __ast_udptl_reload(), __init_manager(), __queues_show(), _dsp_init(), action_getconfig(), action_getconfigjson(), action_listcategories(), action_updateconfig(), adsi_load(), advanced_options(), aji_load_config(), ast_cli_perms_init(), ast_config_load2(), ast_load_realtime_multientry(), ast_plc_reload(), ast_readconfig(), ast_xmldoc_load_documentation(), conf_exec(), config_function_read(), config_load(), config_module(), directory_exec(), do_reload(), festival_exec(), find_conf(), find_realtime(), get_insecure_variable_from_sippeers(), get_insecure_variable_from_sipregs(), gtalk_load_config(), handle_cli_dialplan_save(), iax_provision_reload(), init_logger_chain(), initialize_cc_max_requests(), jingle_load_config(), load_config(), load_config_meetme(), load_indications(), load_module(), load_modules(), load_moh_classes(), load_odbc_config(), load_pktccops_config(), load_realtime_queue(), make_email_file(), misdn_cfg_init(), odbc_load_module(), osp_load(), parse_config(), pbx_load_config(), pbx_load_users(), play_message(), prep_email_sub_vars(), private_enum_init(), queues_data_provider_get(), read_agent_config(), read_config_maps(), read_password_from_file(), realtime_directory(), realtime_multi_handler(), realtime_multi_pgsql(), realtime_switch_common(), reload(), reload_config(), reload_followme(), reload_module(), reload_queue_rules(), reload_queues(), rtp_reload(), run_startup_commands(), set_config(), setup_dahdi_int(), show_users_realtime(), sla_load_config(), smdi_load(), tds_load_module(), unload_module(), update_realtime_members(), vm_change_password(), vm_forwardoptions(), and write_password_to_file().
int ast_config_engine_deregister | ( | struct ast_config_engine * | del | ) |
Deregister config engine.
0 | Always |
Definition at line 2397 of file config.c.
References ast_mutex_lock, ast_mutex_unlock, config_lock, last, and ast_config_engine::next.
Referenced by unload_module().
int ast_config_engine_register | ( | struct ast_config_engine * | newconfig | ) |
Register config engine.
1 | Always |
Definition at line 2378 of file config.c.
References ast_log(), ast_mutex_lock, ast_mutex_unlock, config_lock, LOG_NOTICE, and ast_config_engine::next.
Referenced by load_module().
struct ast_category* ast_config_get_current_category | ( | const struct ast_config * | cfg | ) |
Retrieve the current category name being built.
API for backend configuration engines while building a configuration set.
Definition at line 1055 of file config.c.
References ast_config::current.
Referenced by config_curl(), config_odbc(), and config_text_file_load().
struct ast_config* ast_config_internal_load | ( | const char * | configfile, |
struct ast_config * | cfg, | ||
struct ast_flags | flags, | ||
const char * | suggested_incl_file, | ||
const char * | who_asked | ||
) |
Definition at line 2459 of file config.c.
References ast_log(), ast_test_flag, CONFIG_FLAG_NOREALTIME, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, db, find_engine(), ast_config::include_level, ast_config_engine::load_func, LOG_WARNING, ast_config::max_include_level, table, and text_file_engine.
Referenced by add_cfg_entry(), ast_config_load2(), config_curl(), config_ldap(), config_odbc(), config_pgsql(), process_text_line(), and read_config_maps().
struct ast_config* ast_config_load2 | ( | const char * | filename, |
const char * | who_asked, | ||
struct ast_flags | flags | ||
) |
Load a config file.
filename | path of file to open. If no preceding '/' character, path is considered relative to AST_CONFIG_DIR |
who_asked | The module which is making this request. |
flags | Optional flags: CONFIG_FLAG_WITHCOMMENTS - load the file with comments intact; CONFIG_FLAG_FILEUNCHANGED - check the file mtime and return CONFIG_STATUS_FILEUNCHANGED if the mtime is the same; or CONFIG_FLAG_NOCACHE - don't cache file mtime (main purpose of this option is to save memory on temporary files). |
Create a config structure from a given configuration file.
NULL | on error |
Definition at line 2499 of file config.c.
References ast_config_destroy(), ast_config_internal_load(), ast_config_new(), CONFIG_STATUS_FILEINVALID, and CONFIG_STATUS_FILEUNCHANGED.
Referenced by __ast_http_load(), __ast_http_post_load(), __ast_udptl_reload(), __init_manager(), _dsp_init(), action_getconfig(), action_getconfigjson(), action_listcategories(), action_updateconfig(), ast_cli_perms_init(), ast_readconfig(), ast_xmldoc_load_documentation(), do_reload(), iax_provision_reload(), init_logger_chain(), initialize_cc_max_requests(), load_config(), load_indications(), load_modules(), misdn_cfg_init(), private_enum_init(), rtp_reload(), run_startup_commands(), and set_config().
struct ast_config* ast_config_new | ( | void | ) |
Create a new base configuration structure.
Definition at line 888 of file config.c.
References ast_calloc, config, MAX_INCLUDE_LEVEL, and ast_config::max_include_level.
Referenced by ast_config_load2(), load_realtime_queue(), read_config_maps(), realtime_multi_curl(), realtime_multi_handler(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), setup_dahdi_int(), and write_password_to_file().
const char* ast_config_option | ( | struct ast_config * | cfg, |
const char * | cat, | ||
const char * | var | ||
) |
Retrieve a configuration variable within the configuration set.
Retrieves the named variable var
within category cat
of configuration set cfg
. If not found, attempts to retrieve the named variable var
from within category general.
var
, or NULL if not found. Definition at line 614 of file config.c.
References ast_variable_retrieve().
Referenced by actual_load_config(), pbx_load_users(), and search_directory_sub().
void ast_config_set_current_category | ( | struct ast_config * | cfg, |
const struct ast_category * | cat | ||
) |
Set the category within the configuration as being current.
API for backend configuration engines while building a configuration set.
Definition at line 1060 of file config.c.
References ast_config::current.
int ast_config_text_file_save | ( | const char * | filename, |
const struct ast_config * | cfg, | ||
const char * | generator | ||
) |
Definition at line 1977 of file config.c.
References ao2_container_alloc, ao2_ref, ast_debug, AST_LIST_EMPTY, AST_LIST_LAST, AST_LIST_TRAVERSE, ast_log(), ast_verb, ast_variable::blanklines, ast_comment::cmt, errno, ast_config_include::exec, ast_config_include::exec_file, f, ast_variable::file, ast_category::file, gen_header(), hash_string(), hashtab_compare_strings(), ast_category::ignored, ast_config_include::include_location_file, ast_config_include::include_location_lineno, ast_config_include::included_file, ast_config::includes, insert_leading_blank_lines(), ast_category_template_instance::inst, ast_variable::lineno, ast_category::lineno, LOG_ERROR, make_fn(), ast_variable::name, ast_category_template_instance::name, ast_category::name, ast_comment::next, ast_variable::next, ast_category::next, ast_config_include::next, ast_variable::object, option_debug, ast_config_include::output, ast_variable::precomments, ast_category::precomments, ast_category::root, ast_config::root, ast_variable::sameline, ast_category::sameline, set_fn(), ast_category::template_instances, ast_variable::trailing, ast_category::trailing, ast_variable::value, and var.
Referenced by action_updateconfig(), config_text_file_save(), vm_change_password(), vm_forwardoptions(), and write_password_to_file().
int ast_destroy_realtime | ( | const char * | family, |
const char * | keyfield, | ||
const char * | lookup, | ||
... | |||
) |
Destroy realtime configuration.
family | which family/config to be destroyed |
keyfield | which field to use as the key |
lookup | which value to look for in the key field to match the entry. |
This function is used to destroy an entry in realtime configuration space. Additional params are used as keys.
Definition at line 2750 of file config.c.
References db, ast_config_engine::destroy_func, find_engine(), and table.
Referenced by cli_realtime_destroy(), function_realtime_readdestroy(), leave_voicemail(), and vm_delete().
struct ast_config_include* ast_include_find | ( | struct ast_config * | conf, |
const char * | included_file | ||
) |
Definition at line 472 of file config.c.
References ast_config_include::included_file, ast_config::includes, and ast_config_include::next.
Referenced by ast_include_new().
struct ast_config_include* ast_include_new | ( | struct ast_config * | conf, |
const char * | from_file, | ||
const char * | included_file, | ||
int | is_exec, | ||
const char * | exec_file, | ||
int | from_lineno, | ||
char * | real_included_file_name, | ||
int | real_included_file_name_size | ||
) |
Definition at line 332 of file config.c.
References ast_calloc, ast_include_find(), ast_includes_destroy(), ast_log(), ast_strdup, ast_strlen_zero(), ast_config::includes, and LOG_WARNING.
Referenced by process_text_line().
void ast_include_rename | ( | struct ast_config * | conf, |
const char * | from_file, | ||
const char * | to_file | ||
) |
Definition at line 380 of file config.c.
References ast_free, ast_strdup, ast_variable_destroy(), ast_variable_move(), ast_variable_new(), ast_variable::file, ast_category::file, ast_config_include::include_location_file, ast_config::includes, ast_category::last, ast_variable::name, ast_variable::next, ast_category::next, ast_config_include::next, ast_category::root, ast_config::root, str, and ast_variable::value.
Referenced by action_updateconfig().
struct ast_variable* ast_load_realtime | ( | const char * | family, |
... | |||
) |
Retrieve realtime configuration.
family | which family/config to lookup |
This will use builtin configuration backends to look up a particular entity in realtime and return a variable list of its parameters.
Definition at line 2548 of file config.c.
References ast_load_realtime_helper(), ast_strlen_zero(), ast_variable_destroy(), cache_file_include::next, ast_variable::next, and ast_variable::value.
Referenced by conf_run(), copy_plain_file(), find_conf_realtime(), find_realtime(), find_realtime_gw(), find_user_realtime(), leave_queue(), load_realtime_queue(), local_ast_moh_start(), queue_function_queuewaitingcount(), realtime_alias(), realtime_peer(), realtime_peer_by_addr(), realtime_peer_by_name(), realtime_peer_get_sippeer_helper(), realtime_switch_common(), realtime_user(), and rt_extend_conf().
struct ast_variable* ast_load_realtime_all | ( | const char * | family, |
... | |||
) |
Definition at line 2536 of file config.c.
References ast_load_realtime_helper().
Referenced by cli_realtime_load(), function_realtime_read(), function_realtime_readdestroy(), and realtimefield_read().
struct ast_config* ast_load_realtime_multientry | ( | const char * | family, |
... | |||
) |
Retrieve realtime configuration.
family | which family/config to lookup |
This will use builtin configuration backends to look up a particular entity in realtime and return a variable list of its parameters. Unlike the ast_load_realtime, this function can return more than one entry and is thus stored inside a traditional ast_config structure rather than just returning a linked list of variables.
NULL | Error or no results returned |
Definition at line 2650 of file config.c.
References ast_config_destroy(), db, find_engine(), ast_config_engine::realtime_multi_func, ast_config::root, and table.
Referenced by __queues_show(), conf_exec(), find_realtime(), get_insecure_variable_from_sippeers(), get_insecure_variable_from_sipregs(), load_realtime_queue(), queues_data_provider_get(), realtime_directory(), realtime_switch_common(), show_users_realtime(), and update_realtime_members().
int ast_parse_arg | ( | const char * | arg, |
enum ast_parse_flags | flags, | ||
void * | p_result, | ||
... | |||
) |
The argument parsing routine.
arg | the string to parse. It is not modified. |
flags | combination of ast_parse_flags to specify the return type and additional checks. |
result | pointer to the result. NULL is valid here, and can be used to perform only the validity checks. |
... | extra arguments are required according to flags. |
0 | in case of success, != 0 otherwise. |
result | returns the parsed value in case of success, the default value in case of error, or it is left unchanged in case of error and no default specified. Note that in certain cases (e.g. sockaddr_in, with multi-field return values) some of the fields in result may be changed even if an error occurs. |
Examples of use: ast_parse_arg("223", PARSE_INT32|PARSE_IN_RANGE, &a, -1000, 1000); returns 0, a = 223 ast_parse_arg("22345", PARSE_INT32|PARSE_IN_RANGE|PARSE_DEFAULT, &a, 9999, 10, 100); returns 1, a = 9999 ast_parse_arg("22345ssf", PARSE_UINT32|PARSE_IN_RANGE, &b, 10, 100); returns 1, b unchanged ast_parse_arg("www.foo.biz:44", PARSE_INADDR, &sa); returns 0, sa contains address and port ast_parse_arg("www.foo.biz", PARSE_INADDR|PARSE_PORT_REQUIRE, &sa); returns 1 because port is missing, sa contains address
The argument parsing routine.
Definition at line 2805 of file config.c.
References ast_debug, ast_gethostbyname(), ast_inet_ntoa(), ast_skip_blanks(), ast_sockaddr_parse(), ast_sockaddr_stringify(), ast_strdupa, ast_strlen_zero(), errno, hp, INT32_MAX, INT32_MIN, PARSE_ADDR, PARSE_DEFAULT, PARSE_DOUBLE, PARSE_IN_RANGE, PARSE_INADDR, PARSE_INT32, PARSE_OUT_RANGE, PARSE_PORT_FORBID, PARSE_PORT_IGNORE, PARSE_PORT_MASK, PARSE_PORT_REQUIRE, PARSE_TYPE, PARSE_UINT32, strsep(), and UINT32_MAX.
Referenced by __ast_http_load(), ast_tls_read_conf(), check_via_response(), gtalk_load_config(), and reload_config().
char* ast_realtime_decode_chunk | ( | char * | chunk | ) |
Remove standard encoding from realtime values, which ensures that a semicolon embedded within a single value is not treated upon retrieval as multiple values.
chunk | Data to be decoded |
Definition at line 2773 of file config.c.
Referenced by realtime_multi_pgsql(), and realtime_pgsql().
int ast_realtime_enabled | ( | void | ) |
Check if there's any realtime engines loaded.
Definition at line 2601 of file config.c.
References config_maps.
Referenced by action_coresettings(), ast_check_realtime(), and handle_show_settings().
char* ast_realtime_encode_chunk | ( | struct ast_str ** | dest, |
ssize_t | maxlen, | ||
const char * | chunk | ||
) |
Encodes a chunk of data for realtime.
dest | Destination buffer |
maxlen | Length passed through to ast_str_* functions |
chunk | Source data to be encoded |
Definition at line 2785 of file config.c.
References ast_str_append(), ast_str_buffer(), ast_str_reset(), and ast_str_set().
int ast_realtime_require_field | ( | const char * | family, |
... | |||
) |
Inform realtime what fields that may be stored.
family | which family/config is referenced |
This will inform builtin configuration backends that particular fields may be updated during the use of that configuration section. This is mainly to be used during startup routines, to ensure that various fields exist in the backend. The backends may take various actions, such as creating new fields in the data store or warning the administrator that new fields may need to be created, in order to ensure proper function.
The arguments are specified in groups of 3: column name, column type, and column size. The column types are specified as integer constants, defined by the enum require_type. Note that the size is specified as the number of equivalent character fields that a field may take up, even if a field is otherwise specified as an integer type. This is due to the fact that some fields have historically been specified as character types, even if they contained integer values.
A family should always specify its fields to the minimum necessary requirements to fulfill all possible values (within reason; for example, a timeout value may reasonably be specified as an INTEGER2, with size 5. Even though values above 32767 seconds are possible, they are unlikely to be useful, and we should not complain about that size).
0 | Required fields met specified standards |
-1 | One or more fields was missing or insufficient |
Definition at line 2606 of file config.c.
References db, find_engine(), ast_config_engine::require_func, and table.
Referenced by ast_queue_log(), change_password_realtime(), conf_run(), load_module(), and logger_queue_rt_start().
|
inline |
Check if require type is an integer type.
Definition at line 768 of file config.h.
Referenced by realtime_require_handler(), require_odbc(), and require_pgsql().
int ast_store_realtime | ( | const char * | family, |
... | |||
) |
Create realtime configuration.
family | which family/config to be created |
This function is used to create a parameter in realtime configuration space.
Definition at line 2726 of file config.c.
References db, find_engine(), ast_config_engine::store_func, and table.
Referenced by ast_queue_log(), cli_realtime_store(), copy_plain_file(), function_realtime_store(), and leave_voicemail().
int ast_unload_realtime | ( | const char * | family | ) |
Release any resources cached for a realtime family.
family | which family/config to destroy |
Various backends may cache attributes about a realtime data storage facility; on reload, a front end resource may request to purge that cache.
0 | If any cache was purged |
-1 | If no cache was found |
Definition at line 2630 of file config.c.
References db, find_engine(), table, and ast_config_engine::unload_func.
Referenced by __unload_module(), load_config(), logger_queue_init(), reload(), reload_config(), reload_logger(), and unload_module().
int ast_update2_realtime | ( | const char * | family, |
... | |||
) |
Update realtime configuration.
family | which family/config to be updated |
This function is used to update a parameter in realtime configuration space. It includes the ability to lookup a row based upon multiple key criteria. As a result, this function includes two sentinel values, one to terminate lookup values and the other to terminate the listing of fields to update.
Definition at line 2703 of file config.c.
References db, find_engine(), table, and ast_config_engine::update2_func.
Referenced by change_password_realtime(), and cli_realtime_update2().
int ast_update_realtime | ( | const char * | family, |
const char * | keyfield, | ||
const char * | lookup, | ||
... | |||
) |
Update realtime configuration.
family | which family/config to be updated |
keyfield | which field to use as the key |
lookup | which value to look for in the key field to match the entry. |
This function is used to update a parameter in realtime configuration space.
Definition at line 2679 of file config.c.
References db, find_engine(), table, and ast_config_engine::update_func.
Referenced by cli_realtime_update(), conf_run(), destroy_association(), function_realtime_write(), handle_response_peerpoke(), leave_voicemail(), realtime_update_peer(), rename_file(), rt_extend_conf(), sip_poke_noanswer(), and update_realtime_member_field().
void ast_variable_append | ( | struct ast_category * | category, |
struct ast_variable * | variable | ||
) |
Definition at line 483 of file config.c.
References ast_category::last, ast_variable::next, and ast_category::root.
Referenced by add_cfg_entry(), add_rt_multi_cfg_entry(), config_curl(), config_ldap(), config_odbc(), config_pgsql(), handle_updates(), inherit_category(), move_variables(), process_text_line(), realtime_directory(), realtime_multi_curl(), realtime_multi_ldap(), realtime_multi_odbc(), realtime_multi_pgsql(), vm_change_password(), and write_password_to_file().
struct ast_variable* ast_variable_browse | ( | const struct ast_config * | config, |
const char * | category | ||
) |
Goes through variables.
Somewhat similar in intent as the ast_category_browse. List variables of config file category
ast_variable | list on success |
NULL | on failure |
Definition at line 597 of file config.c.
References ast_category_get(), ast_config::last_browse, ast_category::name, and ast_category::root.
Referenced by __ast_http_load(), __ast_http_post_load(), __init_manager(), _dsp_init(), action_getconfig(), action_getconfigjson(), actual_load_config(), adsi_load(), aji_load_config(), ast_cli_perms_init(), ast_plc_reload(), ast_readconfig(), ast_variable_retrieve(), ast_xmldoc_load_documentation(), build_calendar(), build_device(), build_event_channel(), caldav_load_calendar(), conf_exec(), config_load(), config_module(), do_say(), ewscal_load_calendar(), exchangecal_load_calendar(), find_conf(), gtalk_load_config(), handle_cli_dialplan_save(), iax_template_parse(), ical_load_calendar(), init_logger_chain(), jingle_load_config(), load_config(), load_module(), load_modules(), load_moh_classes(), load_odbc_config(), load_pktccops_config(), misdn_cfg_init(), odbc_load_module(), osp_create_provider(), parse_config(), parse_tone_zone(), pbx_load_config(), process_config(), read_agent_config(), read_config_maps(), reload(), reload_config(), reload_followme(), reload_module(), reload_queue_rules(), reload_single_queue(), run_startup_commands(), search_directory_sub(), set_config(), setup_dahdi_int(), show_users_realtime(), sip_cli_notify(), sla_build_station(), sla_build_trunk(), smdi_load(), store_config(), and tds_load_module().
int ast_variable_delete | ( | struct ast_category * | category, |
const char * | variable, | ||
const char * | match, | ||
const char * | line | ||
) |
Definition at line 897 of file config.c.
References ast_strlen_zero(), ast_variable_destroy(), ast_category::last, ast_variable::name, ast_variable::next, ast_category::root, and ast_variable::value.
Referenced by handle_updates().
void ast_variable_insert | ( | struct ast_category * | category, |
struct ast_variable * | variable, | ||
const char * | line | ||
) |
Definition at line 496 of file config.c.
References ast_variable::lineno, ast_variable::next, and ast_category::root.
Referenced by handle_updates().
struct ast_variable* ast_variable_new | ( | const char * | name, |
const char * | value, | ||
const char * | filename | ||
) |
Definition at line 278 of file config.c.
References __ast_calloc(), ast_calloc, ast_variable::file, MIN_VARIABLE_FNAME_SPACE, ast_variable::name, ast_variable::stuff, and ast_variable::value.
Referenced by add_cfg_entry(), add_rt_cfg_entry(), add_rt_multi_cfg_entry(), add_var(), apply_outgoing(), ast_channeltype_list(), ast_http_get_post_vars(), ast_include_rename(), ast_variable_update(), ast_variables_dup(), build_user(), check_access(), config_curl(), config_ldap(), config_odbc(), config_pgsql(), copy_vars(), create_vmaccount(), dup_vars(), handle_updates(), handle_uri(), httpd_helper_thread(), iax_parse_ies(), ldap_table_config_add_attribute(), man_do_variable_value(), manager_sipnotify(), mkintf(), parkandannounce_exec(), parse_cookies(), process_dahdi(), process_text_line(), realtime_curl(), realtime_directory(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_multi_curl(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_pgsql(), sip_cli_notify(), variable_clone(), vm_change_password(), and write_password_to_file().
const char* ast_variable_retrieve | ( | const struct ast_config * | config, |
const char * | category, | ||
const char * | variable | ||
) |
Gets a variable.
config | which (opened) config to use |
category | category under which the variable lies |
variable | which variable you wish to get the data for |
Goes through a given config file in the given category and searches for the given variable
The | variable value on success |
NULL | if unable to find it. |
Definition at line 625 of file config.c.
References ast_variable_browse(), ast_variable::name, ast_variable::next, ast_category::next, ast_category::root, ast_config::root, and ast_variable::value.
Referenced by __ast_udptl_reload(), __init_manager(), actual_load_config(), advanced_options(), aji_load_config(), ast_config_option(), conf_exec(), config_function_read(), config_module(), directory_exec(), do_reload(), festival_exec(), find_queue_by_name_rt(), find_realtime(), get_insecure_variable_from_config(), get_insecure_variable_from_sipregs(), gtalk_load_config(), iax_template_parse(), init_acf_query(), init_logger_chain(), initialize_cc_max_requests(), jingle_load_config(), load_config(), load_config_meetme(), load_indications(), load_module(), load_modules(), load_tech_calendars(), make_email_file(), odbc_load_module(), osp_load(), parse_config(), pbx_load_config(), pbx_load_users(), play_message(), prep_email_sub_vars(), private_enum_init(), queue_set_global_params(), read_agent_config(), read_password_from_file(), realtime_directory(), reload_config(), reload_followme(), reload_single_queue(), rtp_reload(), search_directory(), search_directory_sub(), set_config(), setup_dahdi_int(), sla_build_station(), sla_build_trunk(), sla_load_config(), tds_load_module(), update_realtime_members(), vm_change_password(), and vm_forwardoptions().
int ast_variable_update | ( | struct ast_category * | category, |
const char * | variable, | ||
const char * | value, | ||
const char * | match, | ||
unsigned int | object | ||
) |
Update variable value within a config.
category | Category element within the config |
variable | Name of the variable to change |
value | New value of the variable |
match | If set, previous value of the variable (if NULL or zero-length, no matching will be done) |
object | Boolean of whether to make the new variable an object |
Definition at line 942 of file config.c.
References ast_strlen_zero(), ast_variable_destroy(), ast_variable_move(), ast_variable_new(), ast_variable::file, ast_category::last, ast_variable::name, ast_variable::next, ast_variable::object, ast_category::root, and ast_variable::value.
Referenced by handle_updates(), process_text_line(), vm_change_password(), and vm_forwardoptions().
void ast_variables_destroy | ( | struct ast_variable * | var | ) |
Free variable list.
var | the linked list of variables to free |
This function frees a list of variables.
Definition at line 586 of file config.c.
References ast_variable_destroy(), and ast_variable::next.
Referenced by __sip_destroy(), action_originate(), ast_category_destroy(), ast_category_empty(), ast_http_get_cookies(), ast_http_manid_from_vars(), ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_var_channel_types(), ast_var_channel_types_table(), ast_variables_dup(), auth_http_callback(), build_gateway(), build_peer(), build_user(), check_peer_ok(), cli_realtime_load(), conf_run(), copy_plain_file(), destroy_dahdi_pvt(), destroy_endpoint(), destroy_fast_originate_helper(), dup_vars(), find_conf_realtime(), find_realtime(), find_realtime_gw(), find_user_realtime(), free_entry(), free_outgoing(), free_user(), function_realtime_read(), function_realtime_readdestroy(), generic_http_callback(), get_insecure_variable_from_sipregs(), handle_uri(), http_post_callback(), httpd_helper_thread(), httpstatus_callback(), ldap_loadentry(), leave_queue(), load_realtime_queue(), local_ast_moh_start(), manager_sipnotify(), mkintf(), parkandannounce_exec(), process_dahdi(), pvt_destructor(), queue_function_queuewaitingcount(), realtime_alias(), realtime_canmatch(), realtime_common(), realtime_exec(), realtime_exists(), realtime_handler(), realtime_ldap_base_ap(), realtime_ldap_result_to_vars(), realtime_matchmore(), realtime_odbc(), realtime_peer(), realtime_peer_by_addr(), realtime_peer_by_name(), realtime_peer_get_sippeer_helper(), realtime_user(), realtimefield_read(), rt_extend_conf(), sip_destroy_peer(), socket_process(), table_configs_free(), and user_destructor().
struct ast_variable* ast_variables_dup | ( | struct ast_variable * | var | ) |
Duplicate variable list.
var | the linked list of variables to clone |
Definition at line 540 of file config.c.
References ast_variable_new(), ast_variables_destroy(), ast_variable::file, ast_variable::name, ast_variable::next, and ast_variable::value.
Referenced by get_insecure_variable_from_sippeers(), and get_insecure_variable_from_sipregs().
struct ast_variable* ast_variables_reverse | ( | struct ast_variable * | var | ) |
Reverse a variable list.
var | the linked list of variables to reverse |
Definition at line 562 of file config.c.
References cache_file_include::next, ast_variable::next, and var.
Referenced by astman_get_variables_order().
int config_text_file_save | ( | const char * | filename, |
const struct ast_config * | cfg, | ||
const char * | generator | ||
) |
Definition at line 1972 of file config.c.
References ast_config_text_file_save().
int read_config_maps | ( | void | ) |
Exposed re-initialization method for core process.
This method is intended for use only with the core re-initialization and is not designed to be called from any user applications.
Definition at line 2298 of file config.c.
References append_mapping(), ast_config_destroy(), ast_config_internal_load(), ast_config_new(), ast_copy_string(), ast_log(), ast_variable_browse(), clear_config_maps(), config, CONFIG_FLAG_NOREALTIME, CONFIG_STATUS_FILEINVALID, LOG_ERROR, LOG_WARNING, ast_variable::name, ast_variable::next, strsep(), table, and ast_variable::value.
Referenced by main().
int register_config_cli | ( | void | ) |
Exposed initialization method for core process.
This method is intended for use only with the core initialization and is not designed to be called from any user applications.
Definition at line 3145 of file config.c.
References ARRAY_LEN, ast_cli_register_multiple(), ast_register_atexit(), and config_shutdown().
Referenced by main().