Asterisk - The Open Source Telephony Project
18.5.0
|
res_config_sqlite module. More...
#include "asterisk.h"
#include <sqlite.h>
#include "asterisk/logger.h"
#include "asterisk/app.h"
#include "asterisk/pbx.h"
#include "asterisk/cdr.h"
#include "asterisk/cli.h"
#include "asterisk/lock.h"
#include "asterisk/config.h"
#include "asterisk/module.h"
#include "asterisk/linkedlists.h"
Go to the source code of this file.
Data Structures | |
struct | sqlite_cache_tables::_columns |
struct | cfg_entry_args |
struct | rt_cfg_entry_args |
struct | rt_multi_cfg_entry_args |
struct | sqlite_cache_columns |
struct | sqlite_cache_tables |
struct | sqlite_tables |
Macros | |
#define | MACRO_BEGIN do { |
#define | MACRO_END } while (0) |
#define | release_table(a) AST_RWLIST_UNLOCK(&((a)->columns)) |
#define | RES_CONFIG_SQLITE_BEGIN |
#define | RES_CONFIG_SQLITE_CONF_FILE "res_config_sqlite.conf" |
#define | RES_CONFIG_SQLITE_DESCRIPTION "Resource Module for SQLite 2" |
#define | RES_CONFIG_SQLITE_DRIVER "sqlite" |
#define | RES_CONFIG_SQLITE_END(error) |
#define | RES_CONFIG_SQLITE_MAX_LOOPS 10 |
#define | RES_CONFIG_SQLITE_NAME "res_config_sqlite" |
#define | SET_VAR(config, to, from) |
#define | sql_get_config_table |
#define | sql_table_structure "SELECT sql FROM sqlite_master WHERE type='table' AND tbl_name='%s'" |
Functions | |
static void | __init_sql_buf (void) |
static void | __init_where_buf (void) |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | add_cfg_entry (void *arg, int argc, char **argv, char **columnNames) |
SQLite callback function for static configuration. More... | |
static int | add_rt_cfg_entry (void *arg, int argc, char **argv, char **columnNames) |
SQLite callback function for RealTime configuration. More... | |
static int | add_rt_multi_cfg_entry (void *arg, int argc, char **argv, char **columnNames) |
SQLite callback function for RealTime configuration. More... | |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | cdr_handler (struct ast_cdr *cdr) |
Asterisk callback function for CDR support. More... | |
static int | check_vars (void) |
static struct ast_config * | config_handler (const char *database, const char *table, const char *file, struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl, const char *who_asked) |
Asterisk callback function for static configuration. More... | |
static struct sqlite_cache_tables * | find_table (const char *tablename) |
static int | find_table_cb (void *vtblptr, int argc, char **argv, char **columnNames) |
static void | free_table (struct sqlite_cache_tables *tblptr) |
static char * | handle_cli_show_sqlite_status (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
Asterisk callback function for the CLI status command. More... | |
static char * | handle_cli_sqlite_show_tables (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | load_config (void) |
Load the configuration file. More... | |
static int | load_module (void) |
Load the module. More... | |
static int | realtime_destroy_handler (const char *database, const char *table, const char *keyfield, const char *entity, const struct ast_variable *fields) |
Asterisk callback function for RealTime configuration (destroys variable). More... | |
static struct ast_variable * | realtime_handler (const char *database, const char *table, const struct ast_variable *fields) |
Asterisk callback function for RealTime configuration. More... | |
static struct ast_config * | realtime_multi_handler (const char *database, const char *table, const struct ast_variable *fields) |
Asterisk callback function for RealTime configuration. More... | |
static int | realtime_require_handler (const char *database, const char *table, va_list ap) |
static int | realtime_store_handler (const char *database, const char *table, const struct ast_variable *fields) |
Asterisk callback function for RealTime configuration (variable create/store). More... | |
static int | realtime_unload_handler (const char *unused, const char *tablename) |
static int | realtime_update2_handler (const char *database, const char *table, const struct ast_variable *lookup_fields, const struct ast_variable *update_fields) |
static int | realtime_update_handler (const char *database, const char *table, const char *keyfield, const char *entity, const struct ast_variable *fields) |
Asterisk callback function for RealTime configuration (variable update). More... | |
static int | set_var (char **var, const char *name, const char *value) |
Allocate a variable. More... | |
static void | unload_config (void) |
Free resources related to configuration. More... | |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Realtime SQLite configuration" , .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_DEPRECATED, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_REALTIME_DRIVER, .requires = "extconfig", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | cdr_registered |
static char * | cdr_table |
static struct ast_cli_entry | cli_status [] |
static int | cli_status_registered |
static char * | config_table |
static sqlite * | db |
static char * | dbfile |
static ast_mutex_t | mutex = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static struct ast_threadstorage | sql_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_sql_buf , .custom_init = NULL , } |
static char * | sql_create_cdr_table |
static struct ast_config_engine | sqlite_engine |
static struct sqlite_tables | sqlite_tables = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static int | use_cdr |
static struct ast_threadstorage | where_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_where_buf , .custom_init = NULL , } |
res_config_sqlite module.
Definition in file res_config_sqlite.c.
#define MACRO_BEGIN do { |
Definition at line 102 of file res_config_sqlite.c.
#define MACRO_END } while (0) |
Definition at line 103 of file res_config_sqlite.c.
#define release_table | ( | a | ) | AST_RWLIST_UNLOCK(&((a)->columns)) |
Definition at line 693 of file res_config_sqlite.c.
Referenced by cdr_handler().
#define RES_CONFIG_SQLITE_BEGIN |
Macro used before executing a query.
Definition at line 161 of file res_config_sqlite.c.
Referenced by cdr_handler(), config_handler(), load_module(), realtime_destroy_handler(), realtime_handler(), realtime_multi_handler(), realtime_store_handler(), realtime_update2_handler(), and realtime_update_handler().
#define RES_CONFIG_SQLITE_CONF_FILE "res_config_sqlite.conf" |
Definition at line 108 of file res_config_sqlite.c.
Referenced by load_config().
#define RES_CONFIG_SQLITE_DESCRIPTION "Resource Module for SQLite 2" |
Definition at line 107 of file res_config_sqlite.c.
Referenced by load_module().
#define RES_CONFIG_SQLITE_DRIVER "sqlite" |
Definition at line 106 of file res_config_sqlite.c.
#define RES_CONFIG_SQLITE_END | ( | error | ) |
Macro used after executing a query.
Definition at line 172 of file res_config_sqlite.c.
Referenced by cdr_handler(), config_handler(), load_module(), realtime_destroy_handler(), realtime_handler(), realtime_multi_handler(), realtime_store_handler(), realtime_update2_handler(), and realtime_update_handler().
#define RES_CONFIG_SQLITE_MAX_LOOPS 10 |
Maximum number of loops before giving up executing a query. Calls to sqlite_xxx() functions which can return SQLITE_BUSY are enclosed by RES_CONFIG_SQLITE_BEGIN and RES_CONFIG_SQLITE_END, e.g.
char *errormsg; int error;
RES_CONFIG_SQLITE_BEGIN error = sqlite_exec(db, query, NULL, NULL, &errormsg); RES_CONFIG_SQLITE_END(error)
if (error) ...;
Definition at line 154 of file res_config_sqlite.c.
#define RES_CONFIG_SQLITE_NAME "res_config_sqlite" |
Definition at line 105 of file res_config_sqlite.c.
Referenced by load_module(), and unload_module().
#define SET_VAR | ( | config, | |
to, | |||
from | |||
) |
Definition at line 122 of file res_config_sqlite.c.
Referenced by load_config().
#define sql_get_config_table |
SQL query format to fetch the static configuration of a file. Rows must be sorted by category.
Definition at line 551 of file res_config_sqlite.c.
Referenced by config_handler().
SQL query format to describe the table structure
Definition at line 543 of file res_config_sqlite.c.
Referenced by find_table().
anonymous enum |
Definition at line 110 of file res_config_sqlite.c.
|
static |
Definition at line 135 of file res_config_sqlite.c.
|
static |
Definition at line 136 of file res_config_sqlite.c.
|
static |
Definition at line 1787 of file res_config_sqlite.c.
|
static |
Definition at line 1787 of file res_config_sqlite.c.
|
static |
SQLite callback function for static configuration.
This function is passed to the SQLite engine as a callback function to parse a row and store it in a struct ast_config object. It relies on resulting rows being sorted by category.
arg | a pointer to a struct cfg_entry_args object |
argc | number of columns |
argv | values in the row |
columnNames | names and types of the columns |
0 | on success |
1 | if an error occurred |
Definition at line 848 of file res_config_sqlite.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, cfg_entry_args::flags, LOG_WARNING, RES_CONFIG_SQLITE_CONFIG_CATEGORY, RES_CONFIG_SQLITE_CONFIG_COLUMNS, RES_CONFIG_SQLITE_CONFIG_VAR_NAME, RES_CONFIG_SQLITE_CONFIG_VAR_VAL, var, and cfg_entry_args::who_asked.
Referenced by config_handler().
|
static |
SQLite callback function for RealTime configuration.
This function is passed to the SQLite engine as a callback function to parse a row and store it in a linked list of struct ast_variable objects.
arg | a pointer to a struct rt_cfg_entry_args object |
argc | number of columns |
argv | values in the row |
columnNames | names and types of the columns |
0 | on success. |
1 | if an error occurred. |
Definition at line 955 of file res_config_sqlite.c.
References args, ast_variable_new, rt_cfg_entry_args::last, ast_variable::next, rt_cfg_entry_args::var, and var.
Referenced by realtime_handler().
|
static |
SQLite callback function for RealTime configuration.
This function performs the same actions as add_rt_cfg_entry() except that the rt_multi_cfg_entry_args structure is designed to store categories in addition to variables.
arg | a pointer to a struct rt_multi_cfg_entry_args object |
argc | number of columns |
argv | values in the row |
columnNames | names and types of the columns |
0 | on success. |
1 | if an error occurred. |
Definition at line 1061 of file res_config_sqlite.c.
References args, ast_category_append(), ast_category_new_dynamic, ast_log, ast_variable_append(), ast_variable_new, cfg_entry_args::cat, cfg_entry_args::cat_name, rt_multi_cfg_entry_args::cfg, rt_multi_cfg_entry_args::initfield, LOG_ERROR, LOG_WARNING, NULL, and var.
Referenced by realtime_multi_handler().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 1787 of file res_config_sqlite.c.
|
static |
Asterisk callback function for CDR support.
cdr | the CDR entry Asterisk sends us. |
Asterisk will call this function each time a CDR entry must be logged if CDR support is enabled.
0 | on success |
1 | if an error occurred |
Definition at line 774 of file res_config_sqlite.c.
References ast_cdr_format_var(), ast_debug, ast_free, ast_log, ast_mutex_lock, ast_mutex_unlock, AST_RWLIST_TRAVERSE, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), cdr_table, sqlite_cache_tables::columns, db, error(), find_table(), first, sqlite_cache_columns::isint, LOG_ERROR, LOG_WARNING, mutex, sqlite_cache_columns::name, NULL, release_table, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, and tmp().
Referenced by load_module().
|
static |
Definition at line 710 of file res_config_sqlite.c.
References ast_log, cdr_table, dbfile, LOG_ERROR, NULL, and use_cdr.
Referenced by load_config().
|
static |
Asterisk callback function for static configuration.
Asterisk will call this function when it loads its static configuration, which usually happens at startup and reload.
database | the database to use (ignored) |
table | the table to use |
file | the file to load from the database |
cfg | the struct ast_config object to use when storing variables |
flags | Optional flags. Not used. |
suggested_incl | suggest include. |
who_asked |
cfg | object |
NULL | if an error occurred |
Definition at line 905 of file res_config_sqlite.c.
References add_cfg_entry(), ast_debug, ast_free, ast_log, ast_mutex_lock, ast_mutex_unlock, cfg_entry_args::cat, cfg_entry_args::cat_name, cfg_entry_args::cfg, config_table, db, error(), cfg_entry_args::flags, LOG_ERROR, LOG_WARNING, mutex, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, sql_get_config_table, and cfg_entry_args::who_asked.
|
static |
Definition at line 626 of file res_config_sqlite.c.
References ast_asprintf, ast_calloc, ast_debug, ast_free, AST_LIST_EMPTY, ast_log, ast_mutex_lock, ast_mutex_unlock, AST_RWLIST_HEAD_INIT, AST_RWLIST_INSERT_TAIL, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, sqlite_cache_tables::columns, db, find_table_cb(), free_table(), LOG_ERROR, LOG_WARNING, mutex, sqlite_cache_tables::name, NULL, and sql_table_structure.
Referenced by cdr_handler(), and realtime_require_handler().
|
static |
Definition at line 571 of file res_config_sqlite.c.
References AST_APP_ARG, ast_calloc, ast_debug, AST_DECLARE_APP_ARGS, AST_LIST_INSERT_TAIL, AST_RWLIST_TRAVERSE, ast_skip_blanks(), AST_STANDARD_APP_ARGS, ast_strdupa, sqlite_cache_tables::columns, end, sqlite_cache_columns::isint, sqlite_cache_columns::name, strcasestr(), type, and sqlite_cache_columns::type.
Referenced by find_table().
|
static |
Definition at line 557 of file res_config_sqlite.c.
References ast_free, AST_RWLIST_HEAD_DESTROY, AST_RWLIST_REMOVE_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, and sqlite_cache_tables::columns.
Referenced by find_table(), realtime_unload_handler(), and unload_config().
|
static |
Asterisk callback function for the CLI status command.
e | CLI command |
cmd | |
a | CLI argument list |
Definition at line 1561 of file res_config_sqlite.c.
References ast_cli_args::argc, ast_cli(), cdr_table, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, ast_cli_entry::command, config_table, dbfile, ast_cli_args::fd, NULL, and ast_cli_entry::usage.
|
static |
Definition at line 1595 of file res_config_sqlite.c.
References ast_cli_args::argc, ast_cli(), AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, CLI_GENERATE, CLI_INIT, CLI_SHOWUSAGE, CLI_SUCCESS, sqlite_cache_tables::columns, ast_cli_entry::command, ast_cli_args::fd, sqlite_cache_columns::name, sqlite_cache_tables::name, NULL, sqlite_cache_columns::type, and ast_cli_entry::usage.
|
static |
Load the configuration file.
This function sets dbfile, config_table, and cdr_table. It calls check_vars() before returning, and unload_config() if an error occurred.
0 | on success |
1 | if an error occurred |
Definition at line 722 of file res_config_sqlite.c.
References ast_config_destroy(), ast_config_load, ast_log, ast_variable_browse(), cdr_table, check_vars(), config, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, config_table, dbfile, error(), LOG_ERROR, LOG_WARNING, ast_variable::name, ast_variable::next, RES_CONFIG_SQLITE_CONF_FILE, SET_VAR, unload_config(), and var.
Referenced by load_module().
|
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 1663 of file res_config_sqlite.c.
References ARRAY_LEN, ast_cdr_register(), ast_cli_register_multiple, ast_config_engine_register(), ast_debug, ast_log, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_REALTIME_DRIVER, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_DEPRECATED, ASTERISK_GPL_KEY, cdr_handler(), cdr_registered, cdr_table, cli_status_registered, config_table, db, dbfile, error(), load_config(), LOG_ERROR, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_DESCRIPTION, RES_CONFIG_SQLITE_END, RES_CONFIG_SQLITE_NAME, S_OR, sql_create_cdr_table, unload_module(), and use_cdr.
|
static |
Asterisk callback function for RealTime configuration (destroys variable).
Asterisk will call this function each time a variable has been destroyed internally and must be removed from the backend engine. keyfield and entity are used to find the row to delete, e.g. DELETE FROM table WHERE keyfield = 'entity';
. ap is a list of parameters and values with the same format as the other realtime functions.
database | the database to use (ignored) |
table | the table to use |
keyfield | the column of the matching cell |
entity | the value of the matching cell |
fields | list of additional parameters for cell matching |
the | number of affected rows. |
-1 | if an error occurred. |
Definition at line 1443 of file res_config_sqlite.c.
References ast_debug, ast_log, ast_mutex_lock, ast_mutex_unlock, db, error(), LOG_WARNING, mutex, ast_variable::name, ast_variable::next, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, and ast_variable::value.
|
static |
Asterisk callback function for RealTime configuration.
Asterisk will call this function each time it requires a variable through the RealTime architecture. ap is a list of parameters and values used to find a specific row, e.g one parameter "name" and one value "123" so that the SQL query becomes SELECT * FROM table WHERE name = '123';
.
database | the database to use (ignored) |
table | the table to use |
fields | list of parameters and values to match |
a | linked list of struct ast_variable objects |
NULL | if an error occurred |
Definition at line 984 of file res_config_sqlite.c.
References add_rt_cfg_entry(), ast_debug, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_variables_destroy(), config_table, db, error(), rt_cfg_entry_args::last, LOG_WARNING, mutex, ast_variable::name, ast_variable::next, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, ast_variable::value, and rt_cfg_entry_args::var.
|
static |
Asterisk callback function for RealTime configuration.
This function performs the same actions as realtime_handler() except that it can store variables per category, and can return several categories.
database | the database to use (ignored) |
table | the table to use |
fields | list of parameters and values to match |
a | struct ast_config object storing categories and variables. |
NULL | if an error occurred. |
Definition at line 1110 of file res_config_sqlite.c.
References add_rt_multi_cfg_entry(), ast_config_destroy(), ast_config_new(), ast_debug, ast_free, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_strdup, cfg_entry_args::cfg, rt_multi_cfg_entry_args::cfg, config_table, db, error(), rt_multi_cfg_entry_args::initfield, LOG_WARNING, mutex, ast_variable::name, ast_variable::next, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, and ast_variable::value.
|
static |
Definition at line 1510 of file res_config_sqlite.c.
References ast_log, ast_rq_is_int(), AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, sqlite_cache_tables::columns, find_table(), sqlite_cache_columns::isint, LOG_WARNING, sqlite_cache_columns::name, and type.
|
static |
Asterisk callback function for RealTime configuration (variable create/store).
Asterisk will call this function each time a variable has been created internally and must be stored in the backend engine. are used to find the row to update, e.g. ap is a list of parameters and values with the same format as the other realtime functions.
database | the database to use (ignored) |
table | the table to use |
fields | list of parameters and new values to insert into the database |
the | rowid of inserted row. |
-1 | if an error occurred. |
Definition at line 1357 of file res_config_sqlite.c.
References ast_debug, ast_log, ast_mutex_lock, ast_mutex_unlock, db, error(), LOG_WARNING, mutex, ast_variable::name, ast_variable::next, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, and ast_variable::value.
|
static |
Definition at line 1546 of file res_config_sqlite.c.
References AST_RWLIST_REMOVE_CURRENT, AST_RWLIST_TRAVERSE_SAFE_BEGIN, AST_RWLIST_TRAVERSE_SAFE_END, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, free_table(), and sqlite_cache_tables::name.
|
static |
Definition at line 1285 of file res_config_sqlite.c.
References ast_debug, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_str_append(), ast_str_buffer(), ast_str_set(), ast_str_thread_get(), db, error(), first, LOG_ERROR, LOG_WARNING, mutex, ast_variable::name, ast_variable::next, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, sql_buf, ast_variable::value, and where_buf.
|
static |
Asterisk callback function for RealTime configuration (variable update).
Asterisk will call this function each time a variable has been modified internally and must be updated in the backend engine. keyfield and entity are used to find the row to update, e.g. UPDATE table SET ... WHERE keyfield = 'entity';
. ap is a list of parameters and values with the same format as the other realtime functions.
database | the database to use (ignored) |
table | the table to use |
keyfield | the column of the matching cell |
entity | the value of the matching cell |
fields | list of parameters and new values to update in the database |
the | number of affected rows. |
-1 | if an error occurred. |
Definition at line 1214 of file res_config_sqlite.c.
References ast_debug, ast_log, ast_mutex_lock, ast_mutex_unlock, db, error(), LOG_WARNING, mutex, ast_variable::name, ast_variable::next, NULL, RES_CONFIG_SQLITE_BEGIN, RES_CONFIG_SQLITE_END, S_OR, and ast_variable::value.
|
static |
Allocate a variable.
var | the address of the variable to set (it will be allocated) |
name | the name of the variable (for error handling) |
value | the value to store in var |
0 | on success |
1 | if an allocation error occurred |
Definition at line 695 of file res_config_sqlite.c.
References ast_free, ast_log, ast_strdup, and LOG_WARNING.
|
static |
Free resources related to configuration.
Definition at line 758 of file res_config_sqlite.c.
References ast_free, AST_RWLIST_REMOVE_HEAD, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, cdr_table, config_table, dbfile, free_table(), and NULL.
Referenced by load_config(), and unload_module().
|
static |
Definition at line 1633 of file res_config_sqlite.c.
References ARRAY_LEN, ast_cdr_unregister(), ast_cli_unregister_multiple(), ast_config_engine_deregister(), cdr_registered, cli_status_registered, db, RES_CONFIG_SQLITE_NAME, and unload_config().
Referenced by load_module().
|
static |
Definition at line 1787 of file res_config_sqlite.c.
|
static |
Definition at line 1787 of file res_config_sqlite.c.
|
static |
Set to 1 if the CDR callback function was registered.
Definition at line 450 of file res_config_sqlite.c.
Referenced by load_module(), and unload_module().
|
static |
The name of the table used to store CDR entries.
Definition at line 462 of file res_config_sqlite.c.
Referenced by cdr_handler(), check_vars(), handle_cli_show_sqlite_status(), load_config(), load_module(), and unload_config().
|
static |
Structure containing details and callback functions for the CLI status command.
Definition at line 491 of file res_config_sqlite.c.
|
static |
Set to 1 if the CLI status command callback function was registered.
Definition at line 453 of file res_config_sqlite.c.
Referenced by load_module(), and unload_module().
|
static |
The name of the static configuration table.
Definition at line 459 of file res_config_sqlite.c.
Referenced by config_handler(), handle_cli_show_sqlite_status(), load_config(), load_module(), realtime_handler(), realtime_multi_handler(), and unload_config().
|
static |
The SQLite database object.
Definition at line 444 of file res_config_sqlite.c.
Referenced by cdr_handler(), config_handler(), find_table(), load_module(), realtime_destroy_handler(), realtime_handler(), realtime_multi_handler(), realtime_store_handler(), realtime_update2_handler(), realtime_update_handler(), and unload_module().
|
static |
The path of the database file.
Definition at line 456 of file res_config_sqlite.c.
Referenced by check_vars(), handle_cli_show_sqlite_status(), load_config(), load_module(), and unload_config().
|
static |
The mutex used to prevent simultaneous access to the SQLite database.
Definition at line 485 of file res_config_sqlite.c.
Referenced by cdr_handler(), config_handler(), find_table(), realtime_destroy_handler(), realtime_handler(), realtime_multi_handler(), realtime_store_handler(), realtime_update2_handler(), and realtime_update_handler().
|
static |
Definition at line 135 of file res_config_sqlite.c.
Referenced by realtime_update2_handler().
|
static |
SQL query format to create the CDR table if non existent.
Definition at line 516 of file res_config_sqlite.c.
Referenced by load_module().
|
static |
The structure specifying all callback functions used by Asterisk for static and RealTime configuration.
Definition at line 468 of file res_config_sqlite.c.
|
static |
|
static |
Set to 1 if CDR support is enabled.
Definition at line 447 of file res_config_sqlite.c.
Referenced by check_vars(), and load_module().
|
static |
Definition at line 136 of file res_config_sqlite.c.
Referenced by realtime_update2_handler().