56 static const char CONFIG[] =
"cdr_syslog.conf";
60 static const char name[] =
"cdr-syslog";
138 int default_facility = LOG_LOCAL4;
139 int default_priority = LOG_INFO;
145 "Unable to load %s. Not logging custom CSV CDRs to syslog.\n",
CONFIG);
159 "Invalid facility '%s' specified, defaulting to '%s'\n",
170 "Invalid priority '%s' specified, defaulting to '%s'\n",
180 if (!strcasecmp(catg,
"general")) {
186 "No 'template' parameter found for '%s'. Skipping.\n", catg);
194 "Unable to allocate memory for configuration settings.\n");
209 "Invalid facility '%s' specified for '%s,' defaulting to '%s'\n",
222 "Invalid priority '%s' specified for '%s,' defaulting to '%s'\n",
#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.
int ast_syslog_priority(const char *priority)
Maps a syslog priority name from a string to a syslog priority constant.
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...
static int load_config(int reload)
#define ast_channel_unref(c)
Decrease channel reference count.
#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
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
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.
#define AST_DECLARE_STRING_FIELDS(field_list)
Declare the fields needed in a structure.
#define ast_mutex_lock(a)
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
const char * ast_syslog_priority_name(int priority)
Maps a syslog priority constant to a string.
static void free_config(void)
#define ast_strlen_zero(foo)
#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.
#define ast_dummy_channel_alloc()
Create a fake channel structure.
static int syslog_log(struct ast_cdr *cdr)
#define AST_STRING_FIELD(name)
Declare a string field.
void ast_config_destroy(struct ast_config *config)
Destroys a config.
struct cdr_syslog_config::@102 list
Syslog support functions for Asterisk logging.
Core PBX routines and definitions.
#define CONFIG_STATUS_FILEUNCHANGED
Responsible for call detail data.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static enum ast_module_load_result load_module(void)
static struct ast_threadstorage syslog_buf
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_RWLIST_REMOVE_HEAD
Module has failed to load, may be in an inconsistent state.
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 const char CONFIG[]
#define CONFIG_STATUS_FILEMISSING
const char * ast_variable_retrieve(struct ast_config *config, const char *category, const char *variable)
#define AST_RWLIST_INSERT_TAIL
int ast_syslog_facility(const char *facility)
Maps a syslog facility name from a string to a syslog facility constant.
const ast_string_field ident
#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.
const ast_string_field format
Asterisk module definitions.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
static int unload_module(void)
const char * ast_syslog_facility_name(int facility)
Maps a syslog facility constant to a string.
Structure for mutex and tracking information.
#define ast_mutex_unlock(a)
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.