Asterisk - The Open Source Telephony Project
18.5.0
|
Comma Separated Value CDR records. More...
#include "asterisk.h"
#include "asterisk/paths.h"
#include "asterisk/config.h"
#include "asterisk/channel.h"
#include "asterisk/cdr.h"
#include "asterisk/module.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
Go to the source code of this file.
Macros | |
#define | CSV_LOG_DIR "/cdr-csv" |
#define | CSV_MASTER "/Master.csv" |
#define | DATE_FORMAT "%Y-%m-%d %T" |
Functions | |
static void | __reg_module (void) |
static void | __unreg_module (void) |
static int | append_date (char *buf, struct timeval when, size_t bufsize) |
static int | append_int (char *buf, int s, size_t bufsize) |
static int | append_string (char *buf, const char *s, size_t bufsize) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static int | build_csv_record (char *buf, size_t bufsize, struct ast_cdr *cdr) |
static int | csv_log (struct ast_cdr *cdr) |
static int | load_config (int reload) |
static int | load_module (void) |
static int | reload (void) |
static int | unload_module (void) |
static int | writefile (char *s, char *file_path) |
static int | writefile_account (char *s, char *acc) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Comma Separated Values 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_EXTENDED, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CDR_DRIVER, .requires = "cdr", } |
static int | accountlogs = 1 |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static const char | config [] = "cdr.conf" |
static ast_mutex_t | f_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
static char | file_csv_master [PATH_MAX] |
static int | loaded = 0 |
static int | loguniqueid = 0 |
static int | loguserfield = 0 |
static char * | name = "csv" |
static int | newcdrcolumns = 0 |
static int | usegmtime = 0 |
Comma Separated Value CDR records.
Definition in file cdr_csv.c.
#define CSV_LOG_DIR "/cdr-csv" |
Definition at line 49 of file cdr_csv.c.
Referenced by load_config(), and writefile_account().
#define CSV_MASTER "/Master.csv" |
Definition at line 50 of file cdr_csv.c.
Referenced by load_config().
#define DATE_FORMAT "%Y-%m-%d %T" |
Definition at line 52 of file cdr_csv.c.
Referenced by append_date().
|
static |
Definition at line 192 of file cdr_csv.c.
References append_string(), ast_localtime(), ast_strftime(), ast_tvzero(), DATE_FORMAT, NULL, tmp(), and usegmtime.
Referenced by build_csv_record().
|
static |
|
static |
Definition at line 147 of file cdr_csv.c.
References error().
Referenced by append_date(), and build_csv_record().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
|
static |
Definition at line 211 of file cdr_csv.c.
References ast_cdr::accountcode, ast_cdr::amaflags, ast_cdr::answer, append_date(), append_int(), append_string(), ast_cdr_disp2str(), ast_channel_amaflags2string(), 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, ast_cdr::lastapp, ast_cdr::lastdata, ast_cdr::linkedid, loguniqueid, loguserfield, newcdrcolumns, ast_cdr::peeraccount, ast_cdr::sequence, ast_cdr::src, ast_cdr::start, ast_cdr::uniqueid, and ast_cdr::userfield.
Referenced by csv_log().
|
static |
Definition at line 297 of file cdr_csv.c.
References ast_cdr::accountcode, accountlogs, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_strlen_zero, buf, build_csv_record(), errno, f_lock, file_csv_master, LOG_WARNING, writefile(), and writefile_account().
Referenced by load_module().
|
static |
Definition at line 98 of file cdr_csv.c.
References accountlogs, ast_config_AST_LOG_DIR, ast_config_destroy(), ast_config_load, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_true(), ast_variable_browse(), config, CONFIG_FLAG_FILEUNCHANGED, CONFIG_STATUS_FILEINVALID, CONFIG_STATUS_FILEUNCHANGED, CSV_LOG_DIR, CSV_MASTER, f_lock, file_csv_master, LOG_WARNING, loguniqueid, loguserfield, ast_variable::name, newcdrcolumns, ast_variable::next, usegmtime, and ast_variable::value.
Referenced by load_module(), and reload().
|
static |
Definition at line 328 of file cdr_csv.c.
References ast_cdr_register(), ast_log, AST_MODULE_LOAD_DECLINE, csv_log(), ast_module_info::description, load_config(), loaded, LOG_ERROR, and name.
Referenced by reload().
|
static |
Definition at line 344 of file cdr_csv.c.
References ast_cdr_unregister(), ast_log, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_CDR_DRIVER, AST_MODULE_INFO(), AST_MODULE_SUPPORT_EXTENDED, ASTERISK_GPL_KEY, load_config(), load_module(), loaded, LOG_WARNING, name, and unload_module().
|
static |
Definition at line 318 of file cdr_csv.c.
References ast_cdr_unregister(), loaded, and name.
Referenced by reload().
|
static |
|
static |
Definition at line 286 of file cdr_csv.c.
References ast_config_AST_LOG_DIR, ast_log, CSV_LOG_DIR, LOG_WARNING, PATH_MAX, and writefile().
Referenced by csv_log().
|
static |
|
static |
Definition at line 55 of file cdr_csv.c.
Referenced by csv_log(), and load_config().
|
static |
|
static |
Definition at line 60 of file cdr_csv.c.
Referenced by load_config().
|
static |
Definition at line 96 of file cdr_csv.c.
Referenced by csv_log(), and load_config().
|
static |
Definition at line 61 of file cdr_csv.c.
Referenced by csv_log(), and load_config().
|
static |
Definition at line 58 of file cdr_csv.c.
Referenced by load_module(), load_or_reload_lua_stuff(), reload(), and unload_module().
|
static |
Definition at line 56 of file cdr_csv.c.
Referenced by build_csv_record(), and load_config().
|
static |
Definition at line 57 of file cdr_csv.c.
Referenced by build_csv_record(), and load_config().
|
static |
Definition at line 94 of file cdr_csv.c.
Referenced by load_module(), reload(), and unload_module().
|
static |
Definition at line 59 of file cdr_csv.c.
Referenced by build_csv_record(), and load_config().
|
static |
Definition at line 54 of file cdr_csv.c.
Referenced by append_date(), and load_config().