179#define DATE_FORMAT "%Y-%m-%d %T"
180#define CONF_FILE "cdr_manager.conf"
181#define CUSTOM_FIELDS_BUF_SIZE 1024
183static const char name[] =
"cdr_manager";
198 int newenablecdr = 0;
230 if (!strcasecmp(cat,
"general")) {
233 if (!strcasecmp(v->
name,
"enabled"))
238 }
else if (!strcasecmp(cat,
"mappings")) {
265 }
else if (newenablecdr) {
276 char strStartTime[80] =
"";
277 char strAnswerTime[80] =
"";
278 char strEndTime[80] =
"";
300 ast_log(
LOG_ERROR,
"Unable to allocate channel for variable substitution.\n");
310 "AccountCode: %s\r\n"
312 "Destination: %s\r\n"
313 "DestinationContext: %s\r\n"
316 "DestinationChannel: %s\r\n"
317 "LastApplication: %s\r\n"
323 "BillableSeconds: %ld\r\n"
324 "Disposition: %s\r\n"
Asterisk main include file. File version handling, generic pbx functions.
int ast_cdr_backend_unsuspend(const char *name)
Unsuspend a CDR backend.
int ast_cdr_unregister(const char *name)
Unregister a CDR handling engine.
const char * ast_cdr_disp2str(int disposition)
Disposition to a string.
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR handling engine.
int ast_cdr_backend_suspend(const char *name)
Suspend a CDR backend temporarily.
struct ast_cdr * ast_cdr_dup(struct ast_cdr *cdr)
Duplicate a public CDR.
static int manager_log(struct ast_cdr *cdr)
static struct ast_str * customfields
#define CUSTOM_FIELDS_BUF_SIZE
static int load_module(void)
static int unload_module(void)
static int load_config(int reload)
static ast_rwlock_t customfields_lock
static void dummy(char *unused,...)
General Asterisk PBX channel definitions.
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
#define ast_channel_unref(c)
Decrease channel reference count.
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
#define ast_dummy_channel_alloc()
Create a fake channel structure.
Configuration File Parser.
#define ast_config_load(filename, flags)
Load a config file.
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
#define CONFIG_STATUS_FILEUNCHANGED
#define CONFIG_STATUS_FILEINVALID
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
@ CONFIG_FLAG_FILEUNCHANGED
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
#define ast_rwlock_wrlock(a)
#define ast_rwlock_rdlock(a)
#define AST_RWLOCK_DEFINE_STATIC(rwlock)
#define ast_rwlock_unlock(a)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Core PBX routines and definitions.
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
Responsible for call detail data.
char dstchannel[AST_MAX_EXTENSION]
char lastdata[AST_MAX_EXTENSION]
char userfield[AST_MAX_USER_FIELD]
char channel[AST_MAX_EXTENSION]
char src[AST_MAX_EXTENSION]
char dst[AST_MAX_EXTENSION]
char clid[AST_MAX_EXTENSION]
char uniqueid[AST_MAX_UNIQUEID]
char accountcode[AST_MAX_ACCOUNT_CODE]
char lastapp[AST_MAX_EXTENSION]
char dcontext[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
Structure used to handle boolean flags.
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
Time-related functions and macros.