Asterisk - The Open Source Telephony Project
18.5.0
|
Sorcery Astdb Object Wizard. More...
#include "asterisk.h"
#include <regex.h>
#include "asterisk/module.h"
#include "asterisk/sorcery.h"
#include "asterisk/astdb.h"
#include "asterisk/json.h"
Go to the source code of this file.
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | load_module (void) |
static int | make_astdb_prefix_pattern (char *tree, const char *regex) |
static void | sorcery_astdb_close (void *data) |
static int | sorcery_astdb_create (const struct ast_sorcery *sorcery, void *data, void *object) |
static int | sorcery_astdb_delete (const struct ast_sorcery *sorcery, void *data, void *object) |
static struct ast_variable * | sorcery_astdb_filter_objectset (struct ast_variable *objectset, const struct ast_sorcery *sorcery, const char *type) |
Internal helper function which returns a filtered objectset. More... | |
static void * | sorcery_astdb_open (const char *data) |
static void * | sorcery_astdb_retrieve_fields (const struct ast_sorcery *sorcery, void *data, const char *type, const struct ast_variable *fields) |
static void * | sorcery_astdb_retrieve_fields_common (const struct ast_sorcery *sorcery, void *data, const char *type, const struct ast_variable *fields, struct ao2_container *objects) |
Internal helper function which retrieves an object, or multiple objects, using fields for criteria. More... | |
static void * | sorcery_astdb_retrieve_id (const struct ast_sorcery *sorcery, void *data, const char *type, const char *id) |
static void | sorcery_astdb_retrieve_multiple (const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const struct ast_variable *fields) |
static void | sorcery_astdb_retrieve_prefix (const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *prefix, const size_t prefix_len) |
static void | sorcery_astdb_retrieve_regex (const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *regex) |
static int | sorcery_astdb_update (const struct ast_sorcery *sorcery, void *data, void *object) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER , .description = "Sorcery Astdb Object Wizard" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_REALTIME_DRIVER, } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_sorcery_wizard | astdb_object_wizard |
Sorcery Astdb Object Wizard.
Definition in file res_sorcery_astdb.c.
|
static |
Definition at line 434 of file res_sorcery_astdb.c.
|
static |
Definition at line 434 of file res_sorcery_astdb.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 434 of file res_sorcery_astdb.c.
|
static |
Definition at line 414 of file res_sorcery_astdb.c.
References AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, and ast_sorcery_wizard_register.
Referenced by unload_module().
|
static |
Definition at line 235 of file res_sorcery_astdb.c.
Referenced by sorcery_astdb_retrieve_regex().
|
static |
Definition at line 409 of file res_sorcery_astdb.c.
References ast_free.
|
static |
Definition at line 66 of file res_sorcery_astdb.c.
References ast_db_put(), ast_json_dump_string, ast_json_free(), ast_json_unref(), ast_sorcery_object_get_id(), ast_sorcery_object_get_type(), ast_sorcery_objectset_json_create(), NULL, prefix, RAII_VAR, and value.
Referenced by sorcery_astdb_update().
|
static |
Definition at line 384 of file res_sorcery_astdb.c.
References ast_db_del(), ast_db_get(), ast_sorcery_object_get_id(), ast_sorcery_object_get_type(), prefix, and value.
|
static |
Internal helper function which returns a filtered objectset.
The following are filtered out of the objectset:
objectset | Objectset to filter. |
sorcery | The sorcery instance that is requesting an objectset. |
type | The object type |
Definition at line 93 of file res_sorcery_astdb.c.
References ao2_cleanup, ast_debug, ast_log, ast_sorcery_get_object_type(), ast_sorcery_is_object_field_registered(), ast_variables_destroy(), LOG_WARNING, ast_sorcery_object_type::name, ast_variable::next, and NULL.
Referenced by sorcery_astdb_retrieve_fields_common(), sorcery_astdb_retrieve_id(), sorcery_astdb_retrieve_prefix(), and sorcery_astdb_retrieve_regex().
|
static |
Definition at line 399 of file res_sorcery_astdb.c.
References ast_strdup, ast_strlen_zero, and NULL.
|
static |
Definition at line 186 of file res_sorcery_astdb.c.
References NULL, and sorcery_astdb_retrieve_fields_common().
|
static |
Internal helper function which retrieves an object, or multiple objects, using fields for criteria.
Definition at line 135 of file res_sorcery_astdb.c.
References ao2_cleanup, ao2_link, ast_db_freetree(), ast_db_gettree(), ast_json_load_string(), ast_json_to_ast_variables(), AST_JSON_TO_AST_VARS_CODE_SUCCESS, ast_json_unref(), ast_sorcery_alloc(), ast_sorcery_objectset_apply(), ast_variable_lists_match(), ast_variables_destroy(), ast_db_entry::data, ast_db_entry::key, ast_db_entry::next, NULL, prefix, RAII_VAR, and sorcery_astdb_filter_objectset().
Referenced by sorcery_astdb_retrieve_fields(), and sorcery_astdb_retrieve_multiple().
|
static |
Definition at line 191 of file res_sorcery_astdb.c.
References ao2_cleanup, ast_db_get_allocated(), ast_debug, ast_free_ptr(), ast_json_load_string(), ast_json_to_ast_variables(), AST_JSON_TO_AST_VARS_CODE_SUCCESS, ast_json_unref(), ast_sorcery_alloc(), ast_sorcery_objectset_apply(), ast_variables_destroy(), NULL, prefix, RAII_VAR, sorcery_astdb_filter_objectset(), and value.
|
static |
Definition at line 217 of file res_sorcery_astdb.c.
References sorcery_astdb_retrieve_fields_common().
|
static |
Definition at line 332 of file res_sorcery_astdb.c.
References ao2_cleanup, ao2_link, ast_db_freetree(), ast_db_gettree_by_prefix(), ast_json_load_string(), ast_json_to_ast_variables(), AST_JSON_TO_AST_VARS_CODE_SUCCESS, ast_json_unref(), ast_sorcery_alloc(), ast_sorcery_objectset_apply(), ast_variables_destroy(), ast_db_entry::data, ast_db_entry::key, ast_db_entry::next, NULL, RAII_VAR, and sorcery_astdb_filter_objectset().
|
static |
Definition at line 278 of file res_sorcery_astdb.c.
References ao2_cleanup, ao2_link, ast_db_freetree(), ast_db_gettree(), ast_json_load_string(), ast_json_to_ast_variables(), AST_JSON_TO_AST_VARS_CODE_SUCCESS, ast_json_unref(), ast_sorcery_alloc(), ast_sorcery_objectset_apply(), ast_variables_destroy(), ast_db_entry::data, ast_db_entry::key, make_astdb_prefix_pattern(), ast_db_entry::next, NULL, prefix, RAII_VAR, and sorcery_astdb_filter_objectset().
|
static |
Definition at line 368 of file res_sorcery_astdb.c.
References ast_db_get(), ast_sorcery_object_get_id(), ast_sorcery_object_get_type(), prefix, sorcery_astdb_create(), and value.
|
static |
Definition at line 423 of file res_sorcery_astdb.c.
References AST_MODFLAG_GLOBAL_SYMBOLS, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_REALTIME_DRIVER, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, ast_sorcery_wizard_unregister(), ASTERISK_GPL_KEY, and load_module().
|
static |
Definition at line 434 of file res_sorcery_astdb.c.
|
static |
Definition at line 434 of file res_sorcery_astdb.c.
|
static |
Definition at line 52 of file res_sorcery_astdb.c.