|
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Customizable Comma Separated Values CEL Backend" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CDR_DRIVER, .requires = "cel", } |
|
static const struct ast_module_info * | ast_module_info = &__mod_info |
|
static struct ast_threadstorage | custom_buf = { .once = PTHREAD_ONCE_INIT , .key_init = __init_custom_buf , .custom_init = NULL , } |
|
static const char | name [] = "cel-custom" |
|
static struct sinks | sinks = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
|
Custom Comma Separated Value CEL records.
- Author
- Steve Murphy murf@.nosp@m.digi.nosp@m.um.co.nosp@m.m Logs in LOG_DIR/cel_custom
Definition in file cel_custom.c.
static void custom_log |
( |
struct ast_event * |
event | ) |
|
|
static |
Definition at line 124 of file cel_custom.c.
125{
129
130
132 return;
133 }
134
138 return;
139 }
140
142
145
147
148
149
150
151
153
154
155
156
157 if ((
out = fopen(
config->filename,
"a"))) {
161 } else {
163 }
164
166 }
167
169
171}
struct ast_channel * ast_cel_fabricate_channel_from_event(const struct ast_event *event)
Create a fake channel from data in a CEL event.
static struct ast_threadstorage custom_buf
static const char config[]
static void dummy(char *unused,...)
#define ast_channel_unref(c)
Decrease channel reference count.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define ast_mutex_unlock(a)
#define ast_mutex_lock(a)
void ast_str_substitute_variables(struct ast_str **buf, ssize_t maxlen, struct ast_channel *chan, const char *templ)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
struct ast_str * ast_str_thread_get(struct ast_threadstorage *ts, size_t init_len)
Retrieve a thread locally stored dynamic string.
Main Channel structure associated with a channel.
Support for dynamic strings.
A container that holds all config-related information.
References ast_cel_fabricate_channel_from_event(), ast_channel_unref, AST_LIST_TRAVERSE, ast_log, ast_mutex_lock, ast_mutex_unlock, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_str_buffer(), ast_str_substitute_variables(), ast_str_thread_get(), config, custom_buf, dummy(), errno, LOG_ERROR, out, and str.
Referenced by load_module().
static int load_config |
( |
void |
| ) |
|
|
static |
Definition at line 77 of file cel_custom.c.
78{
83 int res = 0;
84
88 return -1;
89 }
90
93 }
94
98
99 if (!sink) {
100 ast_log(
LOG_ERROR,
"Unable to allocate memory for configuration settings.\n");
101 res = -2;
102 break;
103 }
104
108
112 } else {
113 ast_log(
LOG_NOTICE,
"Mapping must have both a filename and a format at line %d\n",
var->lineno);
114 }
116 }
118
120
121 return res;
122}
#define ast_config_load(filename, flags)
Load a config file.
#define CONFIG_STATUS_FILEINVALID
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
struct ast_variable * ast_variable_browse(const struct ast_config *config, const char *category_name)
#define ast_verb(level,...)
#define AST_RWLIST_INSERT_TAIL
#define ast_mutex_init(pmutex)
const char * ast_config_AST_LOG_DIR
#define ast_calloc_with_stringfields(n, type, size)
Allocate a structure with embedded stringfields in a single allocation.
#define ast_string_field_build(x, field, fmt, args...)
Set a field to a complex (built) value.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Structure used to handle boolean flags.
Structure for variables, used for configurations and for channel variables.
const ast_string_field filename
const ast_string_field format
References ast_calloc_with_stringfields, ast_config_AST_LOG_DIR, ast_config_destroy(), ast_config_load, ast_log, ast_mutex_init, AST_RWLIST_INSERT_TAIL, ast_string_field_build, ast_strlen_zero(), ast_variable_browse(), ast_verb, CONFIG, CONFIG_STATUS_FILEINVALID, cel_config::filename, cel_config::format, cel_config::lock, LOG_ERROR, LOG_NOTICE, name, and var.
Referenced by load_module(), and reload().