61 #define CUSTOM_LOG_DIR "/cdr_custom" 62 #define CONFIG "cdr_custom.conf" 66 static const char name[] =
"cdr-custom";
109 ast_log(
LOG_ERROR,
"Unable to allocate memory for configuration settings.\n");
142 ast_log(
LOG_ERROR,
"Unable to allocate channel for variable subsitution.\n");
167 if ((out = fopen(config->
filename,
"a"))) {
struct ast_variable * next
#define AST_THREADSTORAGE(name)
Define a thread storage variable.
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
const ast_string_field filename
Asterisk main include file. File version handling, generic pbx functions.
int ast_cdr_unregister(const char *name)
Unregister a CDR handling engine.
#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.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
Time-related functions and macros.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static void dummy(char *unused,...)
#define CONFIG_STATUS_FILEINVALID
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 public CDR.
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
#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.
const ast_string_field format
#define ast_mutex_lock(a)
Definitions to aid in the use of thread local storage.
static int custom_log(struct ast_cdr *cdr)
#define ast_strlen_zero(foo)
static struct ast_threadstorage custom_buf
Configuration File Parser.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
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.
Asterisk file paths, configured in asterisk.conf.
#define ast_dummy_channel_alloc()
Create a fake channel structure.
#define AST_STRING_FIELD(name)
Declare a string field.
void ast_config_destroy(struct ast_config *config)
Destroys a config.
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 ...
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
Module has failed to load, may be in an inconsistent state.
#define ast_string_field_build(x, field, fmt, args...)
Set a field to a complex (built) value.
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",)
static void free_config(void)
#define AST_RWLIST_INSERT_TAIL
static int load_config(void)
#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 ast_mutex_destroy(a)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
Structure for mutex and tracking information.
#define ast_mutex_unlock(a)