54 #define CUSTOM_LOG_DIR "/cdr_custom"
55 #define CONFIG "cdr_custom.conf"
59 static const char name[] =
"cdr-custom";
74 struct cdr_config *sink;
100 ast_log(
LOG_ERROR,
"Unable to allocate memory for configuration settings.\n");
133 ast_log(
LOG_ERROR,
"Unable to allocate channel for variable subsitution.\n");
158 if ((out = fopen(config->
filename,
"a"))) {
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
static const char config[]
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
String manipulation functions.
#define ast_channel_unref(c)
Decrease channel reference count.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
const ast_string_field filename
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category)
Goes through variables.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static void dummy(char *unused,...)
static int unload_module(void)
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
Structure for variables, used for configurations and for channel variables.
struct ast_cdr * ast_cdr_dup(struct ast_cdr *cdr)
Duplicate a record.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
Configuration File Parser.
#define ast_calloc_with_stringfields(n, type, size)
Allocate a structure with embedded stringfields in a single allocation.
static enum ast_module_load_result load_module(void)
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define ast_mutex_lock(a)
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
Definitions to aid in the use of thread local storage.
void ast_config_destroy(struct ast_config *config)
Destroys a config.
static int custom_log(struct ast_cdr *cdr)
static struct ast_threadstorage custom_buf
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR handling engine.
General Asterisk PBX channel definitions.
Asterisk file paths, configured in asterisk.conf.
struct cdr_config::@76 list
#define ast_config_load(filename, flags)
Load a config file.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define AST_STRING_FIELD(name)
Declare a string field.
Core PBX routines and definitions.
Responsible for call detail data.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
const char * ast_config_AST_LOG_DIR
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_RWLIST_REMOVE_HEAD
#define ast_string_field_build(x, field, fmt, args...)
Set a field to a complex (built) value.
Structure used to handle boolean flags.
static void free_config(void)
#define AST_RWLIST_INSERT_TAIL
static int load_config(void)
const ast_string_field format
struct ast_variable * next
#define ast_mutex_init(pmutex)
struct ast_str * ast_str_thread_get(struct ast_threadstorage *ts, size_t init_len)
Retrieve a thread locally stored dynamic string.
#define CONFIG_STATUS_FILEINVALID
#define ast_mutex_destroy(a)
struct ast_channel * ast_dummy_channel_alloc(void)
Create a fake channel structure.
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
void ast_cdr_unregister(const char *name)
Unregister a CDR handling engine.
Structure for mutex and tracking information.
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
#define ast_mutex_unlock(a)