Asterisk - The Open Source Telephony Project
18.5.0
|
Adaptive ODBC CDR backend. More...
#include "asterisk.h"
#include <sys/types.h>
#include <time.h>
#include <sql.h>
#include <sqlext.h>
#include <sqltypes.h>
#include "asterisk/config.h"
#include "asterisk/channel.h"
#include "asterisk/lock.h"
#include "asterisk/linkedlists.h"
#include "asterisk/res_odbc.h"
#include "asterisk/cdr.h"
#include "asterisk/module.h"
Go to the source code of this file.
Data Structures | |
struct | columns |
struct | tables::odbc_columns |
struct | odbc_tables |
struct | tables |
Macros | |
#define | CONFIG "cdr_adaptive_odbc.conf" |
#define | LENGTHEN_BUF(size, var_sql) |
#define | LENGTHEN_BUF1(size) LENGTHEN_BUF(size, sql); |
#define | LENGTHEN_BUF2(size) LENGTHEN_BUF(size, sql2); |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | free_config (void) |
static SQLHSTMT | generic_prepare (struct odbc_obj *obj, void *data) |
static int | load_config (void) |
static int | load_module (void) |
static int | odbc_log (struct ast_cdr *cdr) |
static int | reload (void) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Adaptive ODBC CDR backend" , .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_CDR_DRIVER, .requires = "cdr,res_odbc", } |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static int | maxsize = 512 |
static int | maxsize2 = 512 |
static const char | name [] = "Adaptive ODBC" |
static struct odbc_tables | odbc_tables = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
Adaptive ODBC CDR backend.
Definition in file cdr_adaptive_odbc.c.
#define CONFIG "cdr_adaptive_odbc.conf" |
Definition at line 59 of file cdr_adaptive_odbc.c.
Referenced by load_config().
#define LENGTHEN_BUF | ( | size, | |
var_sql | |||
) |
Definition at line 360 of file cdr_adaptive_odbc.c.
#define LENGTHEN_BUF1 | ( | size | ) | LENGTHEN_BUF(size, sql); |
Definition at line 374 of file cdr_adaptive_odbc.c.
Referenced by odbc_log().
#define LENGTHEN_BUF2 | ( | size | ) | LENGTHEN_BUF(size, sql2); |
Definition at line 376 of file cdr_adaptive_odbc.c.
Referenced by odbc_log().
|
static |
Definition at line 835 of file cdr_adaptive_odbc.c.
|
static |
Definition at line 835 of file cdr_adaptive_odbc.c.
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 835 of file cdr_adaptive_odbc.c.
|
static |
Definition at line 314 of file cdr_adaptive_odbc.c.
References ast_free, AST_LIST_REMOVE_HEAD, AST_RWLIST_REMOVE_HEAD, tables::columns, columns::list, and table.
Referenced by reload(), and unload_module().
|
static |
Definition at line 327 of file cdr_adaptive_odbc.c.
References ast_log, ast_odbc_prepare(), odbc_obj::con, LOG_WARNING, and NULL.
Referenced by free_zone(), and odbc_log().
|
static |
Definition at line 92 of file cdr_adaptive_odbc.c.
References ast_calloc, ast_category_browse(), ast_config_destroy(), ast_config_load, ast_copy_string(), ast_free, AST_LIST_FIRST, AST_LIST_INSERT_TAIL, ast_log, ast_odbc_release_obj(), ast_odbc_request_obj, AST_RWLIST_INSERT_TAIL, ast_strdupa, ast_strip(), ast_strlen_zero, ast_trim_blanks(), ast_true(), ast_variable_browse(), ast_variable_retrieve(), ast_verb, columns::cdrname, tables::columns, odbc_obj::con, CONFIG, CONFIG_STATUS_FILEINVALID, tables::connection, columns::decimals, columns::filtervalue, item, columns::list, LOG_ERROR, LOG_NOTICE, LOG_WARNING, ast_variable::name, columns::name, columns::negatefiltervalue, ast_variable::next, NULL, columns::nullable, columns::octetlen, tables::quoted_identifiers, columns::radix, schema, tables::schema, columns::size, columns::staticvalue, table, tables::table, tmp(), columns::type, usegmtime, tables::usegmtime, ast_variable::value, and var.
Referenced by load_module(), and reload().
|
static |
Definition at line 802 of file cdr_adaptive_odbc.c.
References ast_cdr_register(), ast_log, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_module_info::description, load_config(), LOG_ERROR, columns::name, and odbc_log().
Referenced by reload().
|
static |
Definition at line 379 of file cdr_adaptive_odbc.c.
References ast_cdr::answer, ast_cdr_format_var(), ast_copy_string(), ast_debug, ast_free, AST_LIST_TRAVERSE, ast_localtime(), ast_log, AST_LOG_WARNING, ast_odbc_backslash_is_escape(), ast_odbc_prepare_and_execute(), ast_odbc_release_obj(), ast_odbc_request_obj, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_str_append(), ast_str_buffer(), ast_str_create, ast_str_set(), ast_str_strlen(), ast_strdupa, ast_strftime(), ast_strlen_zero, ast_tvdiff_us(), ast_tvzero(), ast_verb, columns::cdrname, tables::columns, tables::connection, columns::decimals, ast_cdr::end, columns::filtervalue, generic_prepare(), LENGTHEN_BUF1, LENGTHEN_BUF2, columns::list, LOG_ERROR, LOG_WARNING, maxsize, maxsize2, columns::name, columns::negatefiltervalue, NULL, columns::octetlen, tables::quoted_identifiers, columns::radix, tables::schema, ast_cdr::start, columns::staticvalue, tables::table, tmp(), columns::type, and tables::usegmtime.
Referenced by load_module(), and unload_module().
|
static |
Definition at line 815 of file cdr_adaptive_odbc.c.
References ast_log, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CDR_DRIVER, AST_MODULE_INFO(), AST_MODULE_SUPPORT_CORE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ASTERISK_GPL_KEY, free_config(), load_config(), load_module(), LOG_ERROR, and unload_module().
|
static |
Definition at line 785 of file cdr_adaptive_odbc.c.
References ast_cdr_register(), ast_cdr_unregister(), ast_log, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_module_info::description, free_config(), LOG_ERROR, columns::name, and odbc_log().
Referenced by reload().
|
static |
Definition at line 835 of file cdr_adaptive_odbc.c.
|
static |
Definition at line 835 of file cdr_adaptive_odbc.c.
|
static |
Definition at line 63 of file cdr_adaptive_odbc.c.
Referenced by ast_func_read2(), and odbc_log().
|
static |
Definition at line 63 of file cdr_adaptive_odbc.c.
Referenced by odbc_log().
|
static |
Definition at line 61 of file cdr_adaptive_odbc.c.
|
static |