179 #define DATE_FORMAT "%Y-%m-%d %T" 180 #define CONF_FILE "cdr_manager.conf" 181 #define CUSTOM_FIELDS_BUF_SIZE 1024 183 static const char name[] =
"cdr_manager";
198 int newenablecdr = 0;
224 if (reload && customfields) {
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" struct ast_variable * next
#define ast_rwlock_rdlock(a)
int ast_cdr_backend_suspend(const char *name)
Suspend a CDR backend temporarily.
Main Channel structure associated with a channel.
char accountcode[AST_MAX_ACCOUNT_CODE]
Asterisk main include file. File version handling, generic pbx functions.
int ast_cdr_unregister(const char *name)
Unregister a CDR handling engine.
#define AST_RWLOCK_DEFINE_STATIC(rwlock)
char dstchannel[AST_MAX_EXTENSION]
#define ast_channel_unref(c)
Decrease channel reference count.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
static struct ast_str * customfields
size_t ast_str_size(const struct ast_str *buf)
Returns the current maximum length (without reallocation) of the current buffer.
Time-related functions and macros.
#define CUSTOM_FIELDS_BUF_SIZE
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
int ast_cdr_backend_unsuspend(const char *name)
Unsuspend a CDR backend.
static void dummy(char *unused,...)
#define CONFIG_STATUS_FILEINVALID
char dcontext[AST_MAX_EXTENSION]
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
Structure for variables, used for configurations and for channel variables.
static int unload_module(void)
struct ast_cdr * ast_cdr_dup(struct ast_cdr *cdr)
Duplicate a public CDR.
static int load_config(int reload)
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static int load_module(void)
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
#define ast_rwlock_unlock(a)
#define ast_strlen_zero(foo)
char lastdata[AST_MAX_EXTENSION]
Configuration File Parser.
void ast_channel_cdr_set(struct ast_channel *chan, struct ast_cdr *value)
#define ast_config_load(filename, flags)
Load a config file.
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR handling engine.
General Asterisk PBX channel definitions.
#define ast_dummy_channel_alloc()
Create a fake channel structure.
void ast_config_destroy(struct ast_config *config)
Destroys a config.
char uniqueid[AST_MAX_UNIQUEID]
char dst[AST_MAX_EXTENSION]
char channel[AST_MAX_EXTENSION]
Core PBX routines and definitions.
#define CONFIG_STATUS_FILEUNCHANGED
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Responsible for call detail data.
char lastapp[AST_MAX_EXTENSION]
const char * ast_cdr_disp2str(int disposition)
Disposition to a string.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static int manager_log(struct ast_cdr *cdr)
Module has failed to load, may be in an inconsistent state.
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...
Structure used to handle boolean flags.
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
char src[AST_MAX_EXTENSION]
#define ast_rwlock_wrlock(a)
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
void pbx_substitute_variables_helper(struct ast_channel *c, const char *cp1, char *cp2, int count)
char clid[AST_MAX_EXTENSION]
#define ASTERISK_GPL_KEY
The text the key() function should return.
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
Asterisk module definitions.
static ast_rwlock_t customfields_lock
char userfield[AST_MAX_USER_FIELD]
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.