211#define CEL_AMI_ENABLED_DEFAULT 0
216#define CEL_SHOW_USERDEF_DEFAULT 0
218#define MANAGER_BACKEND_NAME "Manager Event Logging"
226 char start_time[80] =
"";
227 char user_defined_header[160];
228 const char *event_name;
246 user_defined_header[0] =
'\0';
249 snprintf(user_defined_header,
sizeof(user_defined_header),
262 "AccountCode: %s\r\n"
263 "CallerIDnum: %s\r\n"
264 "CallerIDname: %s\r\n"
265 "CallerIDani: %s\r\n"
266 "CallerIDrdnis: %s\r\n"
267 "CallerIDdnid: %s\r\n"
271 "Application: %s\r\n"
280 "PeerAccount: %s\r\n"
309 const char *cat =
NULL;
322 ast_log(
LOG_WARNING,
"Configuration file '%s' is invalid. CEL manager Module not activated.\n",
327 ast_log(
LOG_WARNING,
"Failed to load configuration file. CEL manager Module not activated.\n");
333 if (strcasecmp(cat,
"manager")) {
338 if (!strcasecmp(v->
name,
"enabled")) {
340 }
else if (!strcasecmp(v->
name,
"show_user_defined")) {
344 "for cel_manager.\n", v->
name);
356 ast_log(
LOG_ERROR,
"Unable to register Asterisk Call Manager CEL handling\n");
Asterisk main include file. File version handling, generic pbx functions.
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
int ast_cel_backend_unregister(const char *name)
Unregister a CEL backend.
@ AST_CEL_USER_DEFINED
a user-defined event, the event name field should be set
int ast_cel_fill_record(const struct ast_event *event, struct ast_cel_event_record *r)
Fill in an ast_cel_event_record from a CEL event.
#define AST_CEL_EVENT_RECORD_VERSION
struct ABI version
int ast_cel_backend_register(const char *name, ast_cel_backend_cb backend_callback)
Register a CEL backend.
#define CEL_SHOW_USERDEF_DEFAULT
show_user_def is off by default
static const char DATE_FORMAT[]
static void manager_log(struct ast_event *event)
#define CEL_AMI_ENABLED_DEFAULT
AMI CEL is off by default.
static unsigned char cel_show_user_def
static int load_module(void)
static int unload_module(void)
static int load_config(int reload)
#define MANAGER_BACKEND_NAME
static const char CONF_FILE[]
General Asterisk PBX channel definitions.
const char * ast_channel_amaflags2string(enum ama_flags flags)
Convert the enum representation of an AMA flag to a string representation.
Configuration File Parser.
#define ast_config_load(filename, flags)
Load a config file.
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
#define CONFIG_STATUS_FILEUNCHANGED
#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)
@ CONFIG_FLAG_FILEUNCHANGED
Support for logging to various files, console and syslog Configuration in file logger....
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm)
Special version of strftime(3) that handles fractions of a second. Takes the same arguments as strfti...
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define manager_event(category, event, contents,...)
External routines may send asterisk manager events this way.
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_CORE
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Helper struct for getting the fields out of a CEL event.
const char * caller_id_dnid
const char * application_data
const char * account_code
const char * caller_id_rdnis
const char * caller_id_num
const char * channel_name
const char * peer_account
enum ast_cel_event_type event_type
const char * user_defined_name
const char * application_name
struct timeval event_time
uint32_t version
struct ABI version
const char * caller_id_ani
const char * caller_id_name
Structure used to handle boolean flags.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.