Store CDR records in a SQLite database. More...
#include "asterisk.h"
#include <sqlite.h>
#include "asterisk/channel.h"
#include "asterisk/module.h"
#include "asterisk/utils.h"
#include "asterisk/paths.h"
Go to the source code of this file.
Macros | |
#define | DATE_FORMAT "%Y-%m-%d %T" |
#define | LOG_HRTIME 0 |
#define | LOG_UNIQUEID 0 |
#define | LOG_USERFIELD 0 |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static void | format_date (char *buffer, size_t length, struct timeval *when) |
static int | load_module (void) |
static int | sqlite_log (struct ast_cdr *cdr) |
static int | unload_module (void) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "SQLite 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 = "ac1f6a56484a8820659555499174e588" , .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_CDR_DRIVER, } |
static struct ast_module_info * | ast_module_info = &__mod_info |
static sqlite * | db = NULL |
static const char | name [] = "sqlite" |
static const char | sql_create_table [] |
SQL table format. More... | |
static ast_mutex_t | sqlite_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, 1 } |
Store CDR records in a SQLite database.
See also
Creates the database and table on-the-fly
Definition in file cdr_sqlite.c.
#define DATE_FORMAT "%Y-%m-%d %T" |
Definition at line 59 of file cdr_sqlite.c.
Referenced by format_date().
#define LOG_HRTIME 0 |
Definition at line 56 of file cdr_sqlite.c.
Referenced by sqlite_log().
#define LOG_UNIQUEID 0 |
Definition at line 54 of file cdr_sqlite.c.
Referenced by sqlite_log().
#define LOG_USERFIELD 0 |
Definition at line 55 of file cdr_sqlite.c.
Referenced by sqlite_log().
|
static |
Definition at line 248 of file cdr_sqlite.c.
|
static |
Definition at line 248 of file cdr_sqlite.c.
|
static |
Definition at line 98 of file cdr_sqlite.c.
References ast_localtime(), ast_strftime(), and DATE_FORMAT.
Referenced by sqlite_log().
|
static |
Definition at line 200 of file cdr_sqlite.c.
References ast_cdr_register(), ast_config_AST_LOG_DIR, AST_FILE_MODE, ast_free, ast_log(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_module_info::description, LOG_ERROR, LOG_NOTICE, and sqlite_log().
|
static |
Definition at line 106 of file cdr_sqlite.c.
References ast_cdr::accountcode, ast_cdr::amaflags, ast_cdr::answer, ast_free, ast_log(), ast_mutex_lock, ast_mutex_unlock, ast_tvdiff_us(), ast_tvzero(), ast_cdr::billsec, ast_cdr::channel, ast_cdr::clid, ast_cdr::dcontext, ast_cdr::disposition, ast_cdr::dst, ast_cdr::dstchannel, ast_cdr::duration, ast_cdr::end, format_date(), ast_cdr::lastapp, ast_cdr::lastdata, LOG_ERROR, LOG_HRTIME, LOG_UNIQUEID, LOG_USERFIELD, sqlite_lock, ast_cdr::src, ast_cdr::start, ast_cdr::uniqueid, and ast_cdr::userfield.
Referenced by load_module().
|
static |
Definition at line 191 of file cdr_sqlite.c.
References ast_cdr_unregister().
|
static |
Definition at line 248 of file cdr_sqlite.c.
|
static |
Definition at line 248 of file cdr_sqlite.c.
|
static |
Definition at line 62 of file cdr_sqlite.c.
Referenced by ast_config_internal_load(), ast_destroy_realtime(), ast_load_realtime_helper(), ast_load_realtime_multientry(), ast_realtime_require_field(), ast_store_realtime(), ast_unload_realtime(), ast_update2_realtime(), ast_update_realtime(), and my_swap_subchannels().
|
static |
Definition at line 61 of file cdr_sqlite.c.
|
static |
SQL table format.
Definition at line 67 of file cdr_sqlite.c.
|
static |
Definition at line 64 of file cdr_sqlite.c.
Referenced by sqlite_log().