Asterisk - The Open Source Telephony Project
18.5.0
|
SQLite 3 configuration engine. More...
#include "asterisk.h"
#include <sqlite3.h>
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/paths.h"
#include "asterisk/astobj2.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
Go to the source code of this file.
Data Structures | |
struct | cfg_entry_args |
struct | realtime_sqlite3_db |
struct | row_counter_args |
Macros | |
#define | DB_BUCKETS 7 |
#define | IS_SQL_LIKE_CLAUSE(x) ((x) && ast_ends_with(x, " LIKE")) |
Typedefs | |
typedef int(* | callback_t) (void *, int, char **, char **) |
Enumerations | |
enum | { REALTIME_SQLITE3_REQ_WARN, REALTIME_SQLITE3_REQ_CLOSE, REALTIME_SQLITE3_REQ_CHAR } |
enum | { COL_CATEGORY, COL_VAR_NAME, COL_VAR_VAL, COL_COLUMNS } |
Functions | |
static void | __init_escape_column_buf (void) |
static void | __init_escape_table_buf (void) |
static void | __init_escape_value_buf (void) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | add_column_name (void *arg, int num_columns, char **values, char **columns) |
Callback for creating a hash of column names for comparison in realtime_sqlite3_require. More... | |
static int | append_row_to_cfg (void *arg, int num_columns, char **values, char **columns) |
Callback for creating an ast_config from a successive sqlite3 result rows. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | db_cmp_fn (void *obj, void *arg, int flags) |
static void | db_destructor (void *obj) |
static int | db_hash_fn (const void *obj, const int flags) |
static int | db_open (struct realtime_sqlite3_db *db) |
Open a database and appropriately set debugging on the db handle. More... | |
void | db_start_batch (struct realtime_sqlite3_db *db) |
void | db_stop_batch (struct realtime_sqlite3_db *db) |
static void | db_sync (struct realtime_sqlite3_db *db) |
static void * | db_sync_thread (void *data) |
Wrap commands in transactions increased write performance. More... | |
static void | discover_sqlite3_caps (void) |
static struct realtime_sqlite3_db * | find_database (const char *database) |
static const char * | get_sqlite_column_type (int type) |
Convert Asterisk realtime types to SQLite 3 types. More... | |
static int | handle_missing_column (struct realtime_sqlite3_db *db, const char *table, const char *column, int type, size_t sz) |
If ast_realtime_require sends info about a column we don't have, create it. More... | |
static int | handle_missing_table (struct realtime_sqlite3_db *db, const char *table, va_list ap) |
Create a table if ast_realtime_require shows that we are configured to handle the data. More... | |
static int | is_dirty_cb (void *obj, void *arg, int flags) |
static int | load_module (void) |
Load the module. More... | |
static void | mark_all_databases_dirty (void) |
static int | mark_dirty_cb (void *obj, void *arg, int flags) |
static struct realtime_sqlite3_db * | new_realtime_sqlite3_db (struct ast_config *config, const char *cat) |
Create a db object based on a config category. More... | |
static int | parse_config (int reload) |
Parse the res_config_sqlite3 config file. More... | |
static struct ast_variable * | realtime_sqlite3 (const char *database, const char *table, const struct ast_variable *fields) |
Realtime callback for a single row query. More... | |
static int | realtime_sqlite3_destroy (const char *database, const char *table, const char *keyfield, const char *entity, const struct ast_variable *fields) |
Realtime callback for deleting a row. More... | |
static int | realtime_sqlite3_exec_query (const char *, const char *, callback_t, void *) |
static int | realtime_sqlite3_exec_query_with_handle (struct realtime_sqlite3_db *, const char *, callback_t, void *) |
static int | realtime_sqlite3_exec_update (const char *, const char *) |
static int | realtime_sqlite3_exec_update_with_handle (struct realtime_sqlite3_db *, const char *) |
static int | realtime_sqlite3_helper (const char *database, const char *table, const struct ast_variable *fields, int is_multi, void *arg) |
Helper function for single and multi-row realtime load functions. More... | |
static struct ast_config * | realtime_sqlite3_load (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) |
Realtime callback for static realtime. More... | |
static struct ast_config * | realtime_sqlite3_multi (const char *database, const char *table, const struct ast_variable *fields) |
Realtime callback for a multi-row query. More... | |
static int | realtime_sqlite3_require (const char *database, const char *table, va_list ap) |
Callback for ast_realtime_require. More... | |
static int | realtime_sqlite3_store (const char *database, const char *table, const struct ast_variable *fields) |
Realtime callback for inserting a row. More... | |
static int | realtime_sqlite3_unload (const char *database, const char *table) |
Callback for clearing any cached info. More... | |
static int | realtime_sqlite3_update (const char *database, const char *table, const char *keyfield, const char *entity, const struct ast_variable *fields) |
Realtime callback for updating a row based on a single criteria. More... | |
static int | realtime_sqlite3_update2 (const char *database, const char *table, const struct ast_variable *lookup_fields, const struct ast_variable *update_fields) |
Realtime callback for updating a row based on multiple criteria. More... | |
static int | reload (void) |
static int | row_counter_wrapper (void *arg, int num_columns, char **values, char **columns) |
static int | row_to_varlist (void *arg, int num_columns, char **values, char **columns) |
Create a varlist from a single sqlite3 result row. More... | |
static const char * | sqlite3_escape_column (const char *param) |
static const char * | sqlite3_escape_column_op (const char *param) |
static const char * | sqlite3_escape_string_helper (struct ast_threadstorage *ts, const char *param) |
static const char * | sqlite3_escape_table (const char *param) |
static const char * | sqlite3_escape_value (const char *param) |
static int | static_realtime_cb (void *arg, int num_columns, char **values, char **columns) |
static int | stop_batch_cb (void *obj, void *arg, int flags) |
static int | str_cmp_fn (void *obj, void *arg, int flags) |
static int | str_hash_fn (const void *obj, const int flags) |
static int | str_to_requirements (const char *data) |
static void | trace_cb (void *arg, const char *sql) |
static void | unlink_dirty_databases (void) |
static int | unload_module (void) |
static void | unref_db (struct realtime_sqlite3_db **db) |
static int | update_realtime_sqlite3_db (struct realtime_sqlite3_db *db, struct ast_config *config, const char *cat) |
Update an existing db object based on config data. More... | |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "SQLite 3 realtime config engine" , .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 = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_REALTIME_DRIVER, .requires = "extconfig", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static ast_mutex_t | config_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
struct ao2_container * | databases |
static struct ast_threadstorage | escape_column_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_escape_column_buf , .custom_init = NULL , } |
static struct ast_threadstorage | escape_table_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_escape_table_buf , .custom_init = NULL , } |
static struct ast_threadstorage | escape_value_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_escape_value_buf , .custom_init = NULL , } |
static int | has_explicit_like_escaping |
struct ast_config_engine | sqlite3_config_engine |
static const char * | static_sql = "SELECT category, var_name, var_val FROM \"%q\" WHERE filename = %Q AND commented = 0 ORDER BY cat_metric ASC, var_metric ASC" |
SQLite 3 configuration engine.
This is a realtime configuration engine for the SQLite 3 Database
Definition in file res_config_sqlite3.c.
#define DB_BUCKETS 7 |
Definition at line 111 of file res_config_sqlite3.c.
Referenced by load_module().
#define IS_SQL_LIKE_CLAUSE | ( | x | ) | ((x) && ast_ends_with(x, " LIKE")) |
Definition at line 796 of file res_config_sqlite3.c.
Referenced by realtime_sqlite3_helper().
typedef int(* callback_t) (void *, int, char **, char **) |
Definition at line 120 of file res_config_sqlite3.c.
anonymous enum |
Enumerator | |
---|---|
REALTIME_SQLITE3_REQ_WARN | |
REALTIME_SQLITE3_REQ_CLOSE | |
REALTIME_SQLITE3_REQ_CHAR |
Definition at line 86 of file res_config_sqlite3.c.
anonymous enum |
Enumerator | |
---|---|
COL_CATEGORY | |
COL_VAR_NAME | |
COL_VAR_VAL | |
COL_COLUMNS |
Definition at line 713 of file res_config_sqlite3.c.
|
static |
Definition at line 117 of file res_config_sqlite3.c.
|
static |
Definition at line 116 of file res_config_sqlite3.c.
|
static |
Definition at line 118 of file res_config_sqlite3.c.
|
static |
Definition at line 1403 of file res_config_sqlite3.c.
|
static |
Definition at line 1403 of file res_config_sqlite3.c.
|
static |
Callback for creating a hash of column names for comparison in realtime_sqlite3_require.
Definition at line 1152 of file res_config_sqlite3.c.
References ao2_alloc, ao2_link, ao2_ref, and NULL.
Referenced by realtime_sqlite3_require().
|
static |
Callback for creating an ast_config from a successive sqlite3 result rows.
Definition at line 513 of file res_config_sqlite3.c.
References ast_category_append(), ast_category_new_anonymous, ast_log, ast_variable_append(), ast_variable_new, LOG_ERROR, S_OR, and var.
Referenced by realtime_sqlite3_helper().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1403 of file res_config_sqlite3.c.
|
static |
Definition at line 224 of file res_config_sqlite3.c.
References CMP_MATCH, CMP_STOP, db, realtime_sqlite3_db::name, and OBJ_KEY.
Referenced by load_module().
|
static |
Definition at line 231 of file res_config_sqlite3.c.
References ao2_lock, ao2_unlock, ast_debug, ast_string_field_free_memory, db, db_stop_batch(), realtime_sqlite3_db::handle, and realtime_sqlite3_db::name.
Referenced by new_realtime_sqlite3_db().
|
static |
Definition at line 217 of file res_config_sqlite3.c.
References ast_str_hash(), db, realtime_sqlite3_db::name, and OBJ_KEY.
Referenced by load_module().
|
static |
Open a database and appropriately set debugging on the db handle.
Definition at line 339 of file res_config_sqlite3.c.
References ao2_lock, ao2_unlock, ast_log, realtime_sqlite3_db::busy_timeout, realtime_sqlite3_db::debug, realtime_sqlite3_db::filename, realtime_sqlite3_db::handle, LOG_WARNING, NULL, and trace_cb().
Referenced by parse_config(), and update_realtime_sqlite3_db().
void db_start_batch | ( | struct realtime_sqlite3_db * | db | ) |
Definition at line 366 of file res_config_sqlite3.c.
References ao2_ref, ast_cond_init, ast_pthread_create_background, realtime_sqlite3_db::batch, realtime_sqlite3_db::cond, db_sync_thread(), realtime_sqlite3_db::has_batch_thread, NULL, and realtime_sqlite3_db::syncthread.
Referenced by parse_config(), and update_realtime_sqlite3_db().
void db_stop_batch | ( | struct realtime_sqlite3_db * | db | ) |
Definition at line 375 of file res_config_sqlite3.c.
References db_sync(), realtime_sqlite3_db::exiting, realtime_sqlite3_db::has_batch_thread, NULL, and realtime_sqlite3_db::syncthread.
Referenced by db_destructor(), is_dirty_cb(), stop_batch_cb(), and update_realtime_sqlite3_db().
|
static |
Definition at line 360 of file res_config_sqlite3.c.
References ast_cond_signal, realtime_sqlite3_db::cond, and realtime_sqlite3_db::wakeup.
Referenced by db_stop_batch(), and realtime_sqlite3_exec_update_with_handle().
|
static |
Wrap commands in transactions increased write performance.
Definition at line 310 of file res_config_sqlite3.c.
References ao2_lock, ao2_object_get_lockaddr(), ao2_unlock, ast_cond_wait, realtime_sqlite3_db::batch, realtime_sqlite3_db::cond, db, realtime_sqlite3_db::exiting, NULL, realtime_sqlite3_exec_query_with_handle(), unref_db(), and realtime_sqlite3_db::wakeup.
Referenced by db_start_batch().
|
static |
Definition at line 1339 of file res_config_sqlite3.c.
References ast_debug, and has_explicit_like_escaping.
Referenced by load_module().
|
static |
Definition at line 245 of file res_config_sqlite3.c.
References ao2_find, and OBJ_KEY.
Referenced by parse_config(), realtime_sqlite3_exec_query(), realtime_sqlite3_exec_update(), and realtime_sqlite3_require().
|
static |
Convert Asterisk realtime types to SQLite 3 types.
Definition at line 1053 of file res_config_sqlite3.c.
References RQ_CHAR, RQ_DATE, RQ_DATETIME, RQ_FLOAT, RQ_INTEGER1, RQ_INTEGER2, RQ_INTEGER3, RQ_INTEGER4, RQ_INTEGER8, RQ_UINTEGER1, RQ_UINTEGER2, RQ_UINTEGER3, RQ_UINTEGER4, and RQ_UINTEGER8.
Referenced by handle_missing_column(), and handle_missing_table().
|
static |
If ast_realtime_require sends info about a column we don't have, create it.
Definition at line 1115 of file res_config_sqlite3.c.
References ast_log, get_sqlite_column_type(), LOG_NOTICE, LOG_WARNING, realtime_sqlite3_db::name, realtime_sqlite3_exec_update_with_handle(), REALTIME_SQLITE3_REQ_CHAR, REALTIME_SQLITE3_REQ_WARN, and realtime_sqlite3_db::requirements.
Referenced by realtime_sqlite3_require().
|
static |
Create a table if ast_realtime_require shows that we are configured to handle the data.
Definition at line 1082 of file res_config_sqlite3.c.
References ast_free, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), first, get_sqlite_column_type(), realtime_sqlite3_exec_update_with_handle(), sqlite3_escape_column(), sqlite3_escape_table(), type, and typeof().
Referenced by realtime_sqlite3_require().
|
static |
Definition at line 276 of file res_config_sqlite3.c.
References CMP_MATCH, db, db_stop_batch(), and realtime_sqlite3_db::dirty.
Referenced by unlink_dirty_databases().
|
static |
Load the module.
Module loading including tests for configuration or dependencies. This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails tests return AST_MODULE_LOAD_FAILURE. If the module can not load the configuration file or other non-critical problem return AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS.
Definition at line 1372 of file res_config_sqlite3.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, ast_config_engine_register(), ast_log, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_REALTIME_DRIVER, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, DB_BUCKETS, db_cmp_fn(), db_hash_fn(), discover_sqlite3_caps(), LOG_ERROR, NULL, parse_config(), reload(), and unload_module().
|
static |
Definition at line 271 of file res_config_sqlite3.c.
References ao2_callback, mark_dirty_cb(), NULL, OBJ_MULTIPLE, and OBJ_NODATA.
Referenced by parse_config().
|
static |
Definition at line 264 of file res_config_sqlite3.c.
References CMP_MATCH, db, and realtime_sqlite3_db::dirty.
Referenced by mark_all_databases_dirty().
|
static |
Create a db object based on a config category.
Definition at line 388 of file res_config_sqlite3.c.
References ao2_alloc, ast_app_parse_timelen(), ast_log, ast_parse_arg(), ast_string_field_init, ast_string_field_set, ast_strlen_zero, ast_true(), ast_variable_browse(), realtime_sqlite3_db::batch, realtime_sqlite3_db::busy_timeout, db, db_destructor(), realtime_sqlite3_db::debug, realtime_sqlite3_db::filename, ast_variable::lineno, LOG_WARNING, ast_variable::name, realtime_sqlite3_db::name, ast_variable::next, NULL, PARSE_DEFAULT, PARSE_INT32, REALTIME_SQLITE3_REQ_WARN, realtime_sqlite3_db::requirements, str_to_requirements(), TIMELEN_MILLISECONDS, unref_db(), ast_variable::value, and var.
Referenced by parse_config(), and update_realtime_sqlite3_db().
|
static |
Parse the res_config_sqlite3 config file.
Definition at line 1262 of file res_config_sqlite3.c.
References ao2_link, ast_category_browse(), ast_config_destroy(), ast_config_load, ast_debug, ast_log, ast_mutex_lock, ast_mutex_unlock, config, config_filename, CONFIG_FLAG_FILEUNCHANGED, CONFIG_FLAG_NOREALTIME, config_lock, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, db, db_open(), db_start_batch(), find_database(), LOG_ERROR, LOG_WARNING, mark_all_databases_dirty(), new_realtime_sqlite3_db(), NULL, unlink_dirty_databases(), unref_db(), and update_realtime_sqlite3_db().
Referenced by load_module(), and reload().
|
static |
Realtime callback for a single row query.
Definition at line 851 of file res_config_sqlite3.c.
References NULL, and realtime_sqlite3_helper().
|
static |
Realtime callback for deleting a row.
Definition at line 1015 of file res_config_sqlite3.c.
References ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_strlen_zero, first, LOG_WARNING, ast_variable::name, ast_variable::next, realtime_sqlite3_exec_update(), sqlite3_escape_column_op(), sqlite3_escape_table(), sqlite3_escape_value(), and ast_variable::value.
|
static |
Definition at line 633 of file res_config_sqlite3.c.
References ao2_ref, ast_log, db, find_database(), LOG_WARNING, and realtime_sqlite3_exec_query_with_handle().
Referenced by realtime_sqlite3_helper(), and realtime_sqlite3_load().
|
static |
Definition at line 599 of file res_config_sqlite3.c.
References ao2_lock, ao2_unlock, ast_log, realtime_sqlite3_db::handle, LOG_WARNING, row_counter_args::row_count, row_counter_wrapper(), and row_counter_args::wrapped_callback.
Referenced by db_sync_thread(), realtime_sqlite3_exec_query(), and realtime_sqlite3_require().
|
static |
Definition at line 695 of file res_config_sqlite3.c.
References ao2_ref, ast_log, db, find_database(), LOG_WARNING, and realtime_sqlite3_exec_update_with_handle().
Referenced by realtime_sqlite3_destroy(), realtime_sqlite3_store(), realtime_sqlite3_update(), and realtime_sqlite3_update2().
|
static |
Definition at line 662 of file res_config_sqlite3.c.
References ao2_lock, ao2_unlock, ast_log, db_sync(), realtime_sqlite3_db::handle, LOG_WARNING, and NULL.
Referenced by handle_missing_column(), handle_missing_table(), and realtime_sqlite3_exec_update().
|
static |
Helper function for single and multi-row realtime load functions.
Definition at line 799 of file res_config_sqlite3.c.
References append_row_to_cfg(), ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_strlen_zero, first, has_explicit_like_escaping, IS_SQL_LIKE_CLAUSE, LOG_WARNING, ast_variable::name, ast_variable::next, realtime_sqlite3_exec_query(), row_to_varlist(), sqlite3_escape_column_op(), sqlite3_escape_table(), sqlite3_escape_value(), and ast_variable::value.
Referenced by realtime_sqlite3(), and realtime_sqlite3_multi().
|
static |
Realtime callback for static realtime.
Definition at line 768 of file res_config_sqlite3.c.
References ast_log, ast_strlen_zero, cfg_entry_args::cat, cfg_entry_args::cat_name, cfg_entry_args::cfg, config, cfg_entry_args::flags, LOG_WARNING, NULL, realtime_sqlite3_exec_query(), static_realtime_cb(), static_sql, and cfg_entry_args::who_asked.
|
static |
Realtime callback for a multi-row query.
Definition at line 863 of file res_config_sqlite3.c.
References ast_config_destroy(), ast_config_new(), NULL, and realtime_sqlite3_helper().
|
static |
Callback for ast_realtime_require.
0 | Required fields met specified standards |
-1 | One or more fields was missing or insufficient |
Definition at line 1174 of file res_config_sqlite3.c.
References add_column_name(), AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_find, ao2_ref, ast_log, ast_strlen_zero, columns, db, find_database(), handle_missing_column(), handle_missing_table(), LOG_WARNING, NULL, OBJ_POINTER, OBJ_UNLINK, realtime_sqlite3_exec_query_with_handle(), str_cmp_fn(), str_hash_fn(), type, typeof(), and unref_db().
|
static |
Realtime callback for inserting a row.
Definition at line 971 of file res_config_sqlite3.c.
References ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_strlen_zero, first, LOG_WARNING, ast_variable::name, ast_variable::next, realtime_sqlite3_exec_update(), sqlite3_escape_column(), sqlite3_escape_table(), sqlite3_escape_value(), and ast_variable::value.
|
static |
Callback for clearing any cached info.
0 | If any cache was purged |
-1 | If no cache was found |
Definition at line 1254 of file res_config_sqlite3.c.
|
static |
Realtime callback for updating a row based on a single criteria.
Definition at line 882 of file res_config_sqlite3.c.
References ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_strlen_zero, first, LOG_WARNING, ast_variable::name, ast_variable::next, realtime_sqlite3_exec_update(), sqlite3_escape_column(), sqlite3_escape_column_op(), sqlite3_escape_table(), sqlite3_escape_value(), and ast_variable::value.
|
static |
Realtime callback for updating a row based on multiple criteria.
Definition at line 918 of file res_config_sqlite3.c.
References ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_strlen_zero, first, LOG_WARNING, ast_variable::name, ast_variable::next, realtime_sqlite3_exec_update(), sqlite3_escape_column(), sqlite3_escape_column_op(), sqlite3_escape_table(), sqlite3_escape_value(), and ast_variable::value.
|
static |
Definition at line 1321 of file res_config_sqlite3.c.
References parse_config().
Referenced by load_module().
|
static |
Definition at line 576 of file res_config_sqlite3.c.
References row_counter_args::row_count, row_counter_args::wrapped_arg, and row_counter_args::wrapped_callback.
Referenced by realtime_sqlite3_exec_query_with_handle().
|
static |
Create a varlist from a single sqlite3 result row.
Definition at line 488 of file res_config_sqlite3.c.
References ast_variable_new, ast_variables_destroy(), NULL, and S_OR.
Referenced by realtime_sqlite3_helper().
|
inlinestatic |
Definition at line 167 of file res_config_sqlite3.c.
References escape_column_buf, and sqlite3_escape_string_helper().
Referenced by handle_missing_table(), realtime_sqlite3_store(), realtime_sqlite3_update(), and realtime_sqlite3_update2().
|
static |
Definition at line 173 of file res_config_sqlite3.c.
References ast_str_buffer(), ast_str_make_space, ast_str_reset(), ast_str_size(), ast_str_thread_get(), ast_str_update(), buf, escape_column_buf, and tmp().
Referenced by realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_update(), and realtime_sqlite3_update2().
|
inlinestatic |
Definition at line 130 of file res_config_sqlite3.c.
References ast_str_buffer(), ast_str_make_space, ast_str_reset(), ast_str_size(), ast_str_thread_get(), ast_str_update(), buf, escape_value_buf, and tmp().
Referenced by sqlite3_escape_column(), sqlite3_escape_table(), and sqlite3_escape_value().
|
inlinestatic |
Definition at line 162 of file res_config_sqlite3.c.
References escape_table_buf, and sqlite3_escape_string_helper().
Referenced by handle_missing_table(), realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_store(), realtime_sqlite3_update(), and realtime_sqlite3_update2().
|
inlinestatic |
Definition at line 212 of file res_config_sqlite3.c.
References escape_value_buf, and sqlite3_escape_string_helper().
Referenced by realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_store(), realtime_sqlite3_update(), and realtime_sqlite3_update2().
|
static |
Definition at line 720 of file res_config_sqlite3.c.
References args, ast_category_append(), ast_category_destroy(), ast_category_new_dynamic, ast_config_internal_load(), ast_free, ast_log, ast_strdup, ast_variable_append(), ast_variable_new, cfg_entry_args::cat, cfg_entry_args::cat_name, cfg_entry_args::cfg, COL_CATEGORY, COL_VAR_NAME, COL_VAR_VAL, cfg_entry_args::flags, LOG_WARNING, var, and cfg_entry_args::who_asked.
Referenced by realtime_sqlite3_load().
|
static |
Definition at line 256 of file res_config_sqlite3.c.
References CMP_MATCH, db, and db_stop_batch().
Referenced by unload_module().
|
static |
Definition at line 1146 of file res_config_sqlite3.c.
Referenced by realtime_sqlite3_require().
|
static |
Definition at line 1141 of file res_config_sqlite3.c.
References ast_str_hash().
Referenced by realtime_sqlite3_require().
|
static |
Definition at line 291 of file res_config_sqlite3.c.
References REALTIME_SQLITE3_REQ_CHAR, REALTIME_SQLITE3_REQ_CLOSE, and REALTIME_SQLITE3_REQ_WARN.
Referenced by new_realtime_sqlite3_db().
|
static |
Definition at line 303 of file res_config_sqlite3.c.
References ast_debug, db, and realtime_sqlite3_db::name.
Referenced by db_open(), and update_realtime_sqlite3_db().
|
static |
Definition at line 286 of file res_config_sqlite3.c.
References ao2_callback, is_dirty_cb(), NULL, OBJ_MULTIPLE, OBJ_NODATA, and OBJ_UNLINK.
Referenced by parse_config().
|
static |
Definition at line 1327 of file res_config_sqlite3.c.
References ao2_callback, ao2_ref, ast_config_engine_deregister(), ast_mutex_lock, ast_mutex_unlock, config_lock, NULL, OBJ_MULTIPLE, OBJ_NODATA, OBJ_UNLINK, and stop_batch_cb().
Referenced by load_module().
|
static |
Definition at line 250 of file res_config_sqlite3.c.
Referenced by db_sync_thread(), new_realtime_sqlite3_db(), parse_config(), realtime_sqlite3_require(), and update_realtime_sqlite3_db().
|
static |
Update an existing db object based on config data.
db | The database object to update |
config | The configuration data with which to update the db |
cat | The config category (which becomes db->name) |
Definition at line 438 of file res_config_sqlite3.c.
References ast_string_field_set, realtime_sqlite3_db::batch, realtime_sqlite3_db::busy_timeout, db_open(), db_start_batch(), db_stop_batch(), realtime_sqlite3_db::debug, realtime_sqlite3_db::dirty, realtime_sqlite3_db::filename, realtime_sqlite3_db::handle, new_realtime_sqlite3_db(), NULL, realtime_sqlite3_db::requirements, trace_cb(), and unref_db().
Referenced by parse_config().
|
static |
Definition at line 1403 of file res_config_sqlite3.c.
|
static |
Definition at line 1403 of file res_config_sqlite3.c.
|
static |
Definition at line 113 of file res_config_sqlite3.c.
Referenced by parse_config(), and unload_module().
struct ao2_container* databases |
Definition at line 110 of file res_config_sqlite3.c.
|
static |
Definition at line 117 of file res_config_sqlite3.c.
Referenced by sqlite3_escape_column(), and sqlite3_escape_column_op().
|
static |
Definition at line 116 of file res_config_sqlite3.c.
Referenced by sqlite3_escape_table().
|
static |
Definition at line 118 of file res_config_sqlite3.c.
Referenced by sqlite3_escape_string_helper(), and sqlite3_escape_value().
|
static |
Definition at line 61 of file res_config_sqlite3.c.
Referenced by discover_sqlite3_caps(), and realtime_sqlite3_helper().
struct ast_config_engine sqlite3_config_engine |
Definition at line 73 of file res_config_sqlite3.c.
|
static |
Definition at line 712 of file res_config_sqlite3.c.
Referenced by realtime_sqlite3_load().