59static const char CONF_FILE[] =
"cel_beanstalkd.conf";
62#define CEL_BEANSTALK_ENABLED_DEFAULT 0
67#define CEL_SHOW_USERDEF_DEFAULT 0
69#define CEL_BACKEND_NAME "Beanstalk Event Logging"
71#define BEANSTALK_JOB_SIZE 4096
72#define BEANSTALK_JOB_PRIORITY 99
73#define BEANSTALK_JOB_TTR 60
74#define BEANSTALK_JOB_DELAY 0
75#define DEFAULT_BEANSTALK_HOST "127.0.0.1"
76#define DEFAULT_BEANSTALK_PORT 11300
77#define DEFAULT_BEANSTALK_TUBE "asterisk-cel"
110 if (bs_use(bs_socket,
bs_tube) != BS_STATUS_OK) {
121 t_cel_json =
ast_json_pack(
"{s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s, s:s}",
134 "EventTime",
S_OR(start_time,
""),
152 ast_log(
LOG_DEBUG,
"Successfully created job %d with %s\n", bs_id, cel_buffer);
157 bs_disconnect(bs_socket);
163 const char *cat =
NULL;
175 ast_log(
LOG_WARNING,
"Configuration file '%s' is invalid. CEL Beanstalkd Module not activated.\n",
179 ast_log(
LOG_WARNING,
"Failed to load configuration file. CEL Beanstalkd Module not activated.\n");
201 if (strcasecmp(cat,
"general")) {
206 if (!strcasecmp(v->
name,
"enabled")) {
208 }
else if (!strcasecmp(v->
name,
"host")) {
211 }
else if (!strcasecmp(v->
name,
"port")) {
213 }
else if (!strcasecmp(v->
name,
"tube")) {
216 }
else if (!strcasecmp(v->
name,
"priority")) {
220 "for CEL beanstalk backend.\n", v->
name);
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
int ast_cel_backend_unregister(const char *name)
Unregister a CEL backend.
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.
static void cel_bs_put(struct ast_event *event)
#define DEFAULT_BEANSTALK_HOST
static ast_rwlock_t config_lock
#define BEANSTALK_JOB_DELAY
static const char DATE_FORMAT[]
#define CEL_BEANSTALK_ENABLED_DEFAULT
Beanstalk CEL is off by default.
#define DEFAULT_BEANSTALK_TUBE
static int load_module(void)
static int unload_module(void)
static int load_config(int reload)
#define BEANSTALK_JOB_PRIORITY
#define DEFAULT_BEANSTALK_PORT
static const char CONF_FILE[]
#define BEANSTALK_JOB_TTR
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....
Asterisk JSON abstraction layer.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
void ast_json_free(void *p)
Asterisk's custom JSON allocator. Exposed for use by unit tests.
#define ast_json_dump_string(root)
Encode a JSON value to a compact string.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
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...
#define ast_rwlock_wrlock(a)
#define ast_rwlock_rdlock(a)
#define AST_RWLOCK_DEFINE_STATIC(rwlock)
#define ast_rwlock_unlock(a)
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Asterisk module definitions.
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
@ AST_MODULE_SUPPORT_EXTENDED
#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.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
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
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.
Abstract JSON element (object, array, string, int, ...).
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next