Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
Custom SQLite3 CDR records. More...
#include "asterisk.h"
#include <sqlite3.h>
#include "asterisk/paths.h"
#include "asterisk/channel.h"
#include "asterisk/cdr.h"
#include "asterisk/module.h"
#include "asterisk/config.h"
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
#include "asterisk/cli.h"
#include "asterisk/app.h"
Go to the source code of this file.
Data Structures | |
struct | sql_values |
struct | values |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static void | free_config (int reload) |
static int | load_column_config (const char *tmp) |
static int | load_config (int reload) |
static int | load_module (void) |
static int | load_values_config (const char *tmp) |
static int | reload (void) |
static int | unload_module (void) |
static int | write_cdr (struct ast_cdr *cdr) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "SQLite3 Custom CDR Module" , .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_EXTENDED, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CDR_DRIVER, .requires = "cdr", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | busy_timeout |
static char * | columns |
static const char | config_file [] = "cdr_sqlite3_custom.conf" |
static sqlite3 * | db = NULL |
static const char | desc [] = "Customizable SQLite3 CDR Backend" |
static ast_mutex_t | lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static const char | name [] = "cdr_sqlite3_custom" |
static struct sql_values | sql_values = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static char | table [80] |
Custom SQLite3 CDR records.
Definition in file cdr_sqlite3_custom.c.
|
static |
Definition at line 364 of file cdr_sqlite3_custom.c.
|
static |
Definition at line 364 of file cdr_sqlite3_custom.c.
struct ast_module * AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 364 of file cdr_sqlite3_custom.c.
|
static |
Definition at line 215 of file cdr_sqlite3_custom.c.
References ast_free, AST_LIST_REMOVE_HEAD, db, values::list, NULL, reload(), and value.
Referenced by load_config(), load_module(), and unload_module().
|
static |
Definition at line 75 of file cdr_sqlite3_custom.c.
References ast_free, ast_log, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_strlen(), ast_strdup, ast_strip(), ast_strlen_zero(), LOG_ERROR, LOG_WARNING, NULL, strsep(), table, and tmp().
Referenced by load_config().
|
static |
Definition at line 154 of file cdr_sqlite3_custom.c.
References ast_config_destroy(), ast_config_load, ast_copy_string(), ast_log, ast_parse_arg(), ast_strlen_zero(), ast_variable_browse(), ast_variable_retrieve(), ast_verb, busy_timeout, config_file, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEMISSING, CONFIG_STATUS_FILEUNCHANGED, free_config(), load_column_config(), load_values_config(), LOG_WARNING, NULL, PARSE_DEFAULT, PARSE_INT32, reload(), table, and tmp().
Referenced by load_module(), and reload().
|
static |
Definition at line 299 of file cdr_sqlite3_custom.c.
References ast_cdr_register(), ast_config_AST_LOG_DIR, ast_log, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, busy_timeout, db, desc, error(), free_config(), load_config(), LOG_ERROR, LOG_WARNING, name, NULL, PATH_MAX, table, and write_cdr().
|
static |
Definition at line 119 of file cdr_sqlite3_custom.c.
References AST_APP_ARG, ast_calloc, AST_DECLARE_APP_ARGS, ast_free, AST_LIST_INSERT_TAIL, ast_log, AST_STANDARD_RAW_ARGS, ast_strdup, ast_strip_quoted(), ast_strlen_zero(), values::list, LOG_ERROR, LOG_WARNING, NULL, tmp(), and value.
Referenced by load_config().
|
static |
Definition at line 346 of file cdr_sqlite3_custom.c.
References ast_mutex_lock, ast_mutex_unlock, load_config(), and lock.
Referenced by free_config(), and load_config().
|
static |
Definition at line 288 of file cdr_sqlite3_custom.c.
References ast_cdr_unregister(), free_config(), and name.
|
static |
Definition at line 234 of file cdr_sqlite3_custom.c.
References ast_cdr_dup(), ast_channel_cdr_set(), ast_channel_unref, ast_debug, ast_dummy_channel_alloc, ast_free, AST_LIST_TRAVERSE, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_strlen(), db, dummy(), error(), lock, LOG_ERROR, NULL, pbx_substitute_variables_helper(), table, and value.
Referenced by load_module().
|
static |
Definition at line 364 of file cdr_sqlite3_custom.c.
|
static |
Definition at line 364 of file cdr_sqlite3_custom.c.
|
static |
Definition at line 64 of file cdr_sqlite3_custom.c.
Referenced by load_config(), and load_module().
|
static |
Definition at line 63 of file cdr_sqlite3_custom.c.
Referenced by display_results(), and realtime_sqlite3_require().
|
static |
Definition at line 56 of file cdr_sqlite3_custom.c.
Referenced by load_config().
|
static |
Definition at line 60 of file cdr_sqlite3_custom.c.
Referenced by __bt_put(), __rec_iput(), ast_config_internal_load(), ast_destroy_realtime_fields(), ast_dsp_set_freqmode(), ast_freq_detect_init(), ast_load_realtime_all_fields(), ast_load_realtime_multientry_fields(), ast_realtime_require_field(), ast_store_realtime_fields(), ast_unload_realtime(), ast_update2_realtime_fields(), ast_update_realtime_fields(), db_cmp_fn(), db_destructor(), db_hash_fn(), db_open(), db_start_batch(), db_stop_batch(), db_sync(), db_sync_thread(), dbm_clearerr(), dbm_close(), dbm_delete(), dbm_dirfno(), dbm_error(), dbm_fetch(), dbm_firstkey(), dbm_nextkey(), dbm_open(), dbm_store(), detect_write(), free_config(), handle_missing_column(), handle_missing_table(), is_dirty_cb(), load_module(), mark_dirty_cb(), my_swap_subchannels(), new_realtime_sqlite3_db(), parse_config(), realtime_sqlite3_exec_query(), realtime_sqlite3_exec_query_with_handle(), realtime_sqlite3_exec_update(), realtime_sqlite3_exec_update_with_handle(), realtime_sqlite3_require(), stop_batch_cb(), trace_cb(), unref_db(), update_realtime_sqlite3_db(), wait_exec(), and write_cdr().
|
static |
Definition at line 58 of file cdr_sqlite3_custom.c.
Referenced by load_module().
|
static |
Definition at line 54 of file cdr_sqlite3_custom.c.
Referenced by reload(), and write_cdr().
|
static |
Definition at line 59 of file cdr_sqlite3_custom.c.
Referenced by load_module(), and unload_module().
|
static |
|
static |
Definition at line 62 of file cdr_sqlite3_custom.c.
Referenced by load_column_config(), load_config(), load_module(), and write_cdr().