| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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 = ASTERISK_GPL_KEY , .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 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 = AST_MUTEX_INIT_VALUE | 
| 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.
| 
 | static | 
Definition at line 192 of file cdr_csv.c.
References append_string(), ast_localtime(), ast_strftime(), ast_tvzero(), buf, DATE_FORMAT, NULL, and usegmtime.
Referenced by build_csv_record().
| 
 | static | 
Definition at line 174 of file cdr_csv.c.
References buf.
Referenced by build_csv_record().
| 
 | static | 
Definition at line 147 of file cdr_csv.c.
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, buf, 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, reload(), usegmtime, and ast_variable::value.
| 
 | 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.
| 
 | static | 
Definition at line 344 of file cdr_csv.c.
References ast_cdr_unregister(), ast_log, load_config(), loaded, LOG_WARNING, and name.
Referenced by load_config().
| 
 | static | 
| 
 | static | 
Definition at line 268 of file cdr_csv.c.
References ast_log, errno, and LOG_ERROR.
Referenced by csv_log(), and writefile_account().
| 
 | 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(), load_config(), and load_config().