Asterisk - The Open Source Telephony Project  21.4.1
Macros | Functions | Variables
cdr_csv.c File Reference

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_moduleAST_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 = "da6642af068ee5e6490c5b1d2cc1d238" , .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_infoast_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
 

Detailed Description

Comma Separated Value CDR records.

Author
Mark Spencer marks.nosp@m.ter@.nosp@m.digiu.nosp@m.m.co.nosp@m.m

Definition in file cdr_csv.c.