49 #define CUSTOM_LOG_DIR "/cel_custom" 50 #define CONFIG "cel_custom.conf" 54 static const char name[] =
"cel-custom";
65 #define CUSTOM_BACKEND_NAME "CEL Custom CSV Logging" 103 ast_log(
LOG_ERROR,
"Unable to allocate memory for configuration settings.\n");
122 ast_verb(1,
"Added CEL CSV mapping for %d files.\n", mappings);
160 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.
A container that holds all config-related information.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
#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)
int ast_cel_backend_register(const char *name, ast_cel_backend_cb backend_callback)
Register a CEL backend.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
static struct ast_threadstorage custom_buf
static enum ast_module_load_result load_module(void)
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
const ast_string_field filename
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
Structure for variables, used for configurations and for channel variables.
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.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define ast_mutex_lock(a)
Definitions to aid in the use of thread local storage.
#define ast_verb(level,...)
#define ast_strlen_zero(foo)
Configuration File Parser.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define ast_config_load(filename, flags)
Load a config file.
General Asterisk PBX channel definitions.
Asterisk file paths, configured in asterisk.conf.
#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.
int ast_cel_backend_unregister(const char *name)
Unregister a CEL backend.
static int unload_module(void)
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.
struct ast_channel * ast_cel_fabricate_channel_from_event(const struct ast_event *event)
Create a fake channel from data in a CEL event.
#define CUSTOM_BACKEND_NAME
static void custom_log(struct ast_event *event)
static int load_config(void)
#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",)
#define AST_RWLIST_INSERT_TAIL
#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.
const ast_string_field format
static void free_config(void)
#define ast_mutex_unlock(a)