141 #define BACKEND_BUCKETS 13 150 #define CEL_MAX_EVENT_IDS 64 155 #define NUM_APP_BUCKETS 97 160 #define NUM_DIALSTATUS_BUCKETS 251 244 .item_offset = offsetof(
struct cel_config, general),
246 .category =
"general",
266 .types =
ACO_TYPES(&general_option, &ignore_option),
296 ast_log(
LOG_ERROR,
"Applications are listed to be tracked, but APP events are not tracked\n");
363 e->
command =
"cel show status";
365 "Usage: cel show status\n" 366 " Displays the Channel Event Logging system status.\n";
380 if (!cfg || !cfg->general || !cfg->general->enable) {
384 for (i = 0; i < (
sizeof(cfg->general->events) * 8); i++) {
387 if (!(cfg->general->events & ((int64_t) 1 << i))) {
392 if (strcasecmp(name,
"Unknown")) {
393 ast_cli(a->
fd,
"CEL Tracking Event: %s\n", name);
399 ast_cli(a->
fd,
"CEL Tracking Application: %s\n", app);
436 if (!cfg || !cfg->general) {
440 return (cfg->general->events & ((int64_t) 1 << et)) ? 1 : 0;
449 while ((cur_event =
strsep(&events,
","))) {
461 cfg->
events = (int64_t) -1;
465 cfg->
events |= ((int64_t) 1 << event_type);
478 while ((cur_app =
strsep(&apps,
","))) {
502 if (!cfg || !cfg->general) {
519 struct ast_json *extra,
const char *peer)
524 userdefevname, extra, peer);
529 const char *userdefevname,
struct ast_json *extra,
const char *peer)
571 const char *userdefevname,
struct ast_json *extra,
572 const char *peer_str)
578 if (!cfg || !cfg->general || !cfg->general->enable || !
backends) {
656 .
type =
"CEL fabricated channel",
664 const char *mixed_name;
674 if (!cfg || !cfg->general) {
699 snprintf(timebuf,
sizeof(timebuf),
"%ld.%06ld", (
long) record.
event_time.tv_sec,
704 ast_strftime(timebuf,
sizeof(timebuf), cfg->general->date_format, &tm);
735 ast_channel_accountcode_set(tchan, record.
account_code);
736 ast_channel_peeraccount_set(tchan, record.
peer_account);
737 ast_channel_userfield_set(tchan, record.
user_field);
775 datastore->
data = app_data;
808 strcpy(lid->
id, linkedid);
823 "Please ensure all modules were compiled for " 824 "this version of Asterisk.\n");
866 const struct timeval *event_time);
899 const struct timeval *event_time)
901 int is_hungup, was_hungup;
911 if (!was_hungup && is_hungup) {
918 "dialstatus", dialstatus ? dialstatus->
dialstatus :
"");
939 const struct timeval *event_time)
958 const struct timeval *event_time)
1015 char *current_chan =
NULL;
1032 if (!current_snapshot) {
1113 const char *reason =
NULL;
1126 reason =
"ParkedCallTimeOut";
1129 reason =
"ParkedCallGiveUp";
1132 reason =
"ParkedCallUnparked";
1135 reason =
"ParkedCallFailed";
1138 reason =
"ParkedCallSwap";
1144 "reason", reason ?:
"",
1161 size_t dialstatus_string_len;
1170 if (!strcasecmp(dialstatus_string,
"ANSWER") && strcasecmp(dialstatus->
dialstatus,
"ANSWER")) {
1184 dialstatus_string_len = strlen(dialstatus_string) + 1;
1195 ao2_link(dial_statuses, dialstatus);
1207 }
else if (!strcasecmp(dialstatus,
"CHANUNAVAIL")) {
1209 }
else if (!strcasecmp(dialstatus,
"CONGESTION")) {
1211 }
else if (!strcasecmp(dialstatus,
"NOANSWER")) {
1213 }
else if (!strcasecmp(dialstatus,
"BUSY")) {
1215 }
else if (!strcasecmp(dialstatus,
"ANSWER")) {
1217 }
else if (!strcasecmp(dialstatus,
"CANCEL")) {
1219 }
else if (!strcasecmp(dialstatus,
"DONTCALL")) {
1221 }
else if (!strcasecmp(dialstatus,
"TORTURE")) {
1223 }
else if (!strcasecmp(dialstatus,
"INVALIDARGS")) {
1264 switch (event_type) {
1293 "extension", transfer_msg->
exten,
1294 "context", transfer_msg->
context,
1295 "bridge_id", bridge_snapshot->
uniqueid,
1334 extra =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: s}",
1336 "channel2_name", channel2->
base->
name,
1349 extra =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: s}",
1351 "channel2_name", channel2->
base->
name,
1377 if (!channel || !target) {
1382 "pickup_channel", channel->
base->
name,
1401 if (!localone || !localtwo) {
1419 cel_state_router =
NULL;
1425 cel_aggregation_topic =
NULL;
1457 if (!cel_aggregation_topic) {
1468 cel_aggregation_topic);
1469 if (!cel_channel_forwarder) {
1475 cel_aggregation_topic);
1476 if (!cel_bridge_forwarder) {
1482 cel_aggregation_topic);
1483 if (!cel_parking_forwarder) {
1489 cel_aggregation_topic);
1490 if (!cel_cel_forwarder) {
1505 if (!cel_state_router) {
1600 cel_backend_hash_fn,
NULL, cel_backend_cmp_fn);
1653 if (!was_enabled && is_enabled) {
1657 }
else if (was_enabled && !is_enabled) {
1661 ast_verb(3,
"CEL logging %sabled.\n", is_enabled ?
"en" :
"dis");
1674 "event_type", event_type,
1694 if (!mod_cfg || !mod_cfg->general) {
1698 ao2_ref(mod_cfg->general, +1);
1699 return mod_cfg->general;
1712 cleanup_config = mod_cfg->
general;
1718 if (!was_enabled && is_enabled) {
1720 }
else if (was_enabled && !is_enabled) {
1755 strcpy(backend->
name, name);
1756 backend->
callback = backend_callback;
1769 .requires =
"extconfig",
enum ast_cel_event_type ast_cel_str_to_event_type(const char *name)
Get the event type from a string.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
cel_channel_snapshot_monitor cel_channel_monitors[]
const char * account_code
the last channel with the given linkedid is retired
struct stasis_message_type * ast_blind_transfer_type(void)
Message type for ast_blind_transfer_message.
const char * caller_id_name
#define NUM_APP_BUCKETS
Number of buckets for the appset container.
const ast_string_field data
Helper struct for getting the fields out of a CEL event.
Channel Event CID name Used by: AST_EVENT_CEL Payload type: STR.
Channel Event app name Used by: AST_EVENT_CEL Payload type: STR.
struct ao2_container * channels
Main Channel structure associated with a channel.
struct ast_party_dialed::@246 number
Dialed/Called number.
Local proxy channel special access.
#define CEL_MAX_EVENT_IDS
Maximum possible CEL event IDs.
#define AST_CLI_DEFINE(fn, txt,...)
char * str
Subscriber phone number (Malloced)
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
static void cel_config_dtor(void *obj)
Destructor for cel_config.
A container that holds all config-related information.
struct ast_channel_snapshot_base * base
union ast_attended_transfer_message::@324 dest
static struct aco_file cel_conf
The config file to be processed for the module.
Asterisk main include file. File version handling, generic pbx functions.
static struct ast_cli_entry cli_status
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
char * str
Subscriber phone number (Malloced)
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
static void cel_parking_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
struct ast_event * ast_cel_create_event_with_time(struct ast_channel_snapshot *snapshot, enum ast_cel_event_type event_type, const struct timeval *event_time, const char *userdefevname, struct ast_json *extra, const char *peer)
Allocate and populate a CEL event structure.
struct stasis_message_type * ast_channel_entered_bridge_type(void)
Message type for channel enter bridge blob messages.
static int ast_cel_track_event(enum ast_cel_event_type et)
Message representing attended transfer.
struct ast_channel_snapshot * channel
#define aco_option_register_custom(info, name, matchtype, types, default_val, handler, flags)
Register a config option.
static struct aco_type general_option
An aco_type structure to link the "general" category to the ast_cel_general_config type...
Channel Event extra data Used by: AST_EVENT_CEL Payload type: STR.
const ast_string_field name
#define AO2_STRING_FIELD_HASH_FN(stype, field)
Creates a hash function for a structure string field.
#define ast_channel_unref(c)
Decrease channel reference count.
Registered applications container.
static struct stasis_forward * cel_parking_forwarder
The arg parameter is a search key, but is not an object.
#define ast_test_flag(p, flag)
char exten[AST_MAX_EXTENSION]
static int cel_backend_send_cb(void *obj, void *arg, int flags)
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Message published during a blind transfer.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
struct ast_party_name name
Subscriber name.
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
void ast_channel_appl_set(struct ast_channel *chan, const char *value)
int stasis_message_router_add(struct stasis_message_router *router, struct stasis_message_type *message_type, stasis_subscription_cb callback, void *data)
Add a route to a message router.
static void cel_dial_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
const char * user_defined_name
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
struct ast_channel_snapshot * snapshot
struct stasis_message_type * ast_channel_left_bridge_type(void)
Message type for channel leave bridge blob messages.
static void cel_blind_transfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void cel_snapshot_update_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
int ast_cli_unregister(struct ast_cli_entry *e)
Unregisters a command or an array of commands.
descriptor for a cli entry.
struct stasis_message_type * ast_parked_call_type(void)
accessor for the parked call stasis message type
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define AST_TASKPROCESSOR_HIGH_WATER_LEVEL
static int unload_module(void)
const ast_string_field rdnis
const char * application_data
#define ao2_callback(c, flags, cb_fn, arg)
const char * application_name
static struct stasis_topic * cel_aggregation_topic
void ast_json_free(void *p)
Asterisk's custom JSON allocator. Exposed for use by unit tests.
Structure that contains a snapshot of information about a bridge.
Channel Event channel name Used by: AST_EVENT_CEL Payload type: STR.
#define aco_option_register(info, name, matchtype, types, default_val, opt_type, flags,...)
Register a config option.
static void cel_channel_linkedid_change(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *event_time)
struct ast_tm * ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone)
Timezone-independent version of localtime_r(3).
static int cel_pre_apply_config(void)
A local channel optimization occurred.
void stasis_message_router_unsubscribe_and_join(struct stasis_message_router *router)
Unsubscribe the router from the upstream topic, blocking until the final message has been processed...
Structure for variables, used for configurations and for channel variables.
static int events_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
Channel Event UniqueID Used by: AST_EVENT_CEL Payload type: STR.
static void cel_local_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
Channel Event context name Used by: AST_EVENT_CEL Payload type: STR.
Structure representing a snapshot of channel state.
Channel Event app args/data Used by: AST_EVENT_CEL Payload type: STR.
void * ast_cel_general_config_alloc(void)
Allocate a CEL configuration object.
Channel Event peeraccount Used by: AST_EVENT_CEL Payload type: STR.
Channel Event Time (micro-seconds) Used by: AST_EVENT_CEL Payload type: UINT.
Channel Event CID dnid Used by: AST_EVENT_CEL Payload type: STR.
#define ast_json_dump_string(root)
Encode a JSON value to a compact string.
#define ast_str_container_alloc(buckets)
Allocates a hash container for bare strings.
static char date_format[6]
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
CONFIG_INFO_CORE("cel", cel_cfg_info, cel_configs, cel_config_alloc,.files=ACO_FILES(&cel_conf),.pre_apply_config=cel_pre_apply_config,)
Structure for a data store type.
struct ast_channel_snapshot * target
const ast_string_field accountcode
char * str
Subscriber name (Malloced)
static const struct adsi_event events[]
const ast_string_field uniqueid
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
enum aco_process_status aco_process_config(struct aco_info *info, int reload)
Process a config info via the options registered with an aco_info.
#define ao2_global_obj_ref(holder)
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
static int reload_module(void)
#define ao2_alloc_options(data_size, destructor_fn, options)
const char * caller_id_num
struct ast_cel_general_config * ast_cel_get_config(void)
Obtain the current CEL configuration.
struct ast_event * ast_cel_create_event(struct ast_channel_snapshot *snapshot, enum ast_cel_event_type event_type, const char *userdefevname, struct ast_json *extra, const char *peer)
Allocate and populate a CEL event structure.
static void check_retire_linkedid(struct ast_channel_snapshot *snapshot, const struct timeval *event_time)
static struct cel_dialstatus * get_dialstatus(const char *uniqueid)
A parked call message payload.
#define ast_strdup(str)
A wrapper for strdup()
Structure for a data store object.
struct varshead * ast_channel_varshead(struct ast_channel *chan)
static const char *const cel_event_types[CEL_MAX_EVENT_IDS]
Map of ast_cel_event_type to strings.
static struct stasis_forward * cel_channel_forwarder
STASIS_MESSAGE_TYPE_DEFN(cel_generic_type)
The representation of a single configuration file to be processed.
void ast_cli(int fd, const char *fmt,...)
Structure representing a change of snapshot of channel state.
enum ast_parked_call_event_type event_type
void ast_free_ptr(void *ptr)
free() wrapper
#define ACO_TYPES(...)
A helper macro to ensure that aco_info types always have a sentinel.
static const struct ast_datastore_info fabricated_channel_datastore
struct ast_channel_snapshot_dialplan * dialplan
#define ast_verb(level,...)
struct ast_bridge_channel_snapshot_pair to_transferee
Channel Event Type Used by: AST_EVENT_CEL Payload type: UINT.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
struct ast_json * ast_multi_channel_blob_get_json(struct ast_multi_channel_blob *obj)
Retrieve the JSON blob from a ast_multi_channel_blob. Returned ast_json is still owned by obj...
the list of registered channel types
Blob of data associated with a channel.
char * ast_str_truncate(struct ast_str *buf, ssize_t len)
Truncates the enclosed string to the given length.
#define ast_strlen_zero(foo)
Channel Event Time (seconds) Used by: AST_EVENT_CEL Payload type: UINT.
#define ast_cli_register(e)
Registers a command or an array of commands.
Channel Event CID num Used by: AST_EVENT_CEL Payload type: STR.
static struct aco_type ignore_option
struct ast_party_id id
Caller party ID.
struct ast_bridge_channel_snapshot_pair to_transfer_target
const ast_string_field context
static void cel_attended_transfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
Configuration File Parser.
Channel Event extension name Used by: AST_EVENT_CEL Payload type: STR.
struct ast_bridge_snapshot * bridge
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
void(* cel_channel_snapshot_monitor)(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *event_time)
Typedef for callbacks that get called on channel snapshot updates.
const ast_string_field technology
int aco_info_init(struct aco_info *info)
Initialize an aco_info structure.
struct ast_party_id ani
Automatic Number Identification (ANI)
struct ast_channel_snapshot * parkee
General Asterisk PBX channel definitions.
void(* ast_cel_backend_cb)(struct ast_event *event)
CEL backend callback.
void * aco_pending_config(struct aco_info *info)
Get pending config changes.
const ast_string_field appl
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_dummy_channel_alloc()
Create a fake channel structure.
struct ast_channel * ast_cel_fabricate_channel_from_event(const struct ast_event *event)
Create a fake channel from data in a CEL event.
struct ast_channel_snapshot * transferee
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
unsigned int ast_cel_check_enabled(void)
Hashing function for cel_backend.
static struct stasis_forward * cel_bridge_forwarder
#define ao2_ref(o, delta)
char uniqueid[AST_MAX_UNIQUEID]
static void destroy_subscriptions(void)
uint32_t version
struct ABI version
const ast_string_field exten
#define ast_strdupa(s)
duplicate a string in memory from the stack
struct ast_channel_snapshot_hangup * hangup
Channel Event Userfield Used by: AST_EVENT_CEL Payload type: STR.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
A set of macros to manage forward-linked lists.
#define ast_malloc(len)
A wrapper for malloc()
struct ao2_container * container
struct ast_bridge_snapshot * bridge
static void cel_channel_state_change(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *event_time)
Handle channel state changes.
hangup terminates connection
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
Blob of data associated with a bridge.
Channel Event CID RDNIS field Used by: AST_EVENT_CEL Payload type: STR.
Channels with this particular technology are an implementation detail of Asterisk and should generall...
enum aco_category_op category_match
static void cel_pickup_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int cel_linkedid_ref(const char *linkedid)
static force_inline char * ast_str_to_lower(char *str)
Convert a string to all lower-case.
Core PBX routines and definitions.
static int is_valid_dialstatus(struct ast_multi_channel_blob *blob)
#define stasis_message_router_create(topic)
static int cel_track_app(const char *const_app)
struct stasis_topic * ast_cel_topic(void)
Get the CEL topic.
Their was an error and no changes were applied.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
void ast_cel_publish_event(struct ast_channel *chan, enum ast_cel_event_type event_type, struct ast_json *blob)
Publish a CEL event.
struct ast_channel_snapshot_caller * caller
enum ast_attended_transfer_dest_type dest_type
enum ast_cel_event_type event_type
struct stasis_message_type * ast_local_optimization_end_type(void)
Message type for when a local channel optimization completes.
Configuration option-handling.
struct stasis_message_type * ast_call_pickup_type(void)
accessor for call pickup message type
static void * cel_config_alloc(void)
struct ast_channel_snapshot * transferer
struct ast_channel_snapshot * channel_snapshot
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
struct ast_cel_general_config * general
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
const ast_string_field dnid
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
#define ao2_unlink(container, obj)
static int apps_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
void aco_info_destroy(struct aco_info *info)
Destroy an initialized aco_info struct.
#define ao2_global_obj_release(holder)
Type for default option handler for bools (ast_true/ast_false)
const char * caller_id_rdnis
void ast_cel_set_config(struct ast_cel_general_config *config)
Set the current CEL configuration.
static struct stasis_message_router * cel_state_router
static const char * ignore_categories[]
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
char context[AST_MAX_CONTEXT]
static void cel_bridge_leave_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int cel_filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
#define ao2_iterator_next(iter)
#define ao2_alloc(data_size, destructor_fn)
struct stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
const ast_string_field userfield
struct ao2_container * apps
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
static int create_routes(void)
Create the Stasis message router and routes for CEL.
struct ast_bridge_snapshot * bridge_snapshot
static struct stasis_topic * cel_topic
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
#define ast_var_assign(name, value)
Channel Event Peer – for Things involving multiple channels, like BRIDGE Used by: AST_EVENT_CEL Payl...
Channel Event CID ANI field Used by: AST_EVENT_CEL Payload type: STR.
int aco_set_defaults(struct aco_type *type, const char *category, void *obj)
Set all default options of obj.
Module could not be loaded properly.
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
#define STRFLDSET(type,...)
Convert a struct and a list of stringfield fields to an argument list of field offsets.
struct ast_channel_snapshot * new_snapshot
enum ast_channel_state state
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 ao2_find(container, arg, flags)
const ast_string_field uniqueid
const char * caller_id_ani
An API for managing task processing threads that can be shared across modules.
const ast_string_field parkinglot
Channel Event AMA flags Used by: AST_EVENT_CEL Payload type: UINT.
struct stasis_message_type * ast_channel_snapshot_type(void)
Message type for ast_channel_snapshot_update.
struct ast_channel_snapshot * old_snapshot
#define AST_CEL_EVENT_RECORD_VERSION
struct ABI version
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
Support for logging to various files, console and syslog Configuration in file logger.conf.
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",)
struct stasis_message * ast_channel_blob_create_from_cache(const char *uniqueid, struct stasis_message_type *type, struct ast_json *blob)
Create a ast_channel_blob message, pulling channel state from the cache.
struct stasis_topic * ast_bridge_topic_all(void)
A topic which publishes the events for all bridges.
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
static int is_enabled(void)
Helper function to check if module is enabled.
uint32_t ast_event_get_ie_uint(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has an integer payload.
const ast_string_field ani
const char * peer_account
static void save_dialstatus(struct ast_multi_channel_blob *blob, struct ast_channel_snapshot *snapshot)
static struct ast_str * cel_generate_peer_str(struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *chan)
int ast_cel_backend_unregister(const char *name)
Unregister a CEL backend.
ast_cel_backend_cb callback
static int cel_report_event(struct ast_channel_snapshot *snapshot, enum ast_cel_event_type event_type, const struct timeval *event_time, const char *userdefevname, struct ast_json *extra, const char *peer_str)
#define ao2_global_obj_replace_unref(holder, obj)
A structure to hold CEL global configuration options.
static void cel_channel_app_change(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *event_time)
struct stasis_topic * ast_parking_topic(void)
accessor for the parking stasis topic
#define AO2_STRING_FIELD_CMP_FN(stype, field)
Creates a compare function for a structure string field.
Channel Event LinkedID Used by: AST_EVENT_CEL Payload type: STR.
char * strsep(char **str, const char *delims)
void ast_event_destroy(struct ast_event *event)
Destroy an event.
#define NUM_DIALSTATUS_BUCKETS
Number of buckets for the dialstatus container.
struct ast_channel_snapshot * ast_channel_snapshot_get_latest(const char *uniqueid)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object...
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Standard Command Line Interface.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
struct ast_event * ast_event_new(enum ast_event_type event_type,...)
Create a new event.
Type information about a category-level configurable object.
const ast_string_field number
void ast_channel_context_set(struct ast_channel *chan, const char *value)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one...
A ringing phone is answered.
struct ast_channel_snapshot * ast_multi_channel_blob_get_channel(struct ast_multi_channel_blob *obj, const char *role)
Retrieve a channel snapshot associated with a specific role from a ast_multi_channel_blob.
A multi channel blob data structure for multi_channel_blob stasis messages.
static AO2_GLOBAL_OBJ_STATIC(cel_backends)
static void cel_bridge_enter_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static const char * get_blob_variable(struct ast_multi_channel_blob *blob, const char *varname)
struct stasis_forward * sub
const ast_string_field parker_dial_string
Abstract JSON element (object, array, string, int, ...).
Type for default option handler for stringfields.
static void destroy_routes(void)
a user-defined event, the event name field should be set
static struct stasis_forward * cel_cel_forwarder
ast_cel_event_type
CEL event types.
const char * caller_id_dnid
struct stasis_message_type * ast_channel_dial_type(void)
Message type for when a channel dials another channel.
#define ast_datastore_alloc(info, uid)
const char * channel_name
int ast_cel_fill_record(const struct ast_event *e, struct ast_cel_event_record *r)
Fill in an ast_cel_event_record from a CEL event.
unsigned char valid
TRUE if the name information is valid/present.
struct stasis_message_type * cel_generic_type(void)
struct ast_channel_snapshot * transferee
struct stasis_forward * stasis_forward_all(struct stasis_topic *from_topic, struct stasis_topic *to_topic)
Create a subscription which forwards all messages from one topic to another.
const char * ast_event_get_ie_str(const struct ast_event *event, enum ast_event_ie_type ie_type)
Get the value of an information element that has a string payload.
int stasis_message_router_set_congestion_limits(struct stasis_message_router *router, long low_water, long high_water)
Set the high and low alert water marks of the stasis message router.
struct ast_channel_snapshot_peer * peer
void ast_channel_name_set(struct ast_channel *chan, const char *name)
Set the channel name.
#define ASTERISK_GPL_KEY
The text the key() function should return.
struct ast_channel_snapshot * retriever
Asterisk module definitions.
static char * handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
int ast_cel_backend_register(const char *name, ast_cel_backend_cb backend_callback)
Register a CEL backend.
static int load_module(void)
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
static struct aco_type * general_options[]
struct timeval event_time
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
a directed pickup was performed on this channel
unsigned char valid
TRUE if the number information is valid/present.
static void cel_general_config_dtor(void *obj)
Destructor for cel_config.
enum ast_transfer_result result
this call was forwarded somewhere else
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
static int create_subscriptions(void)
Create the Stasis subscriptions for CEL.
void ast_channel_data_set(struct ast_channel *chan, const char *value)
int ast_str_container_add(struct ao2_container *str_container, const char *add)
Adds a string to a string container allocated by ast_str_container_alloc.
const char * ast_cel_get_type_name(enum ast_cel_event_type type)
Get the name of a CEL event type.
Channel Event AccountCode Used by: AST_EVENT_CEL Payload type: STR.
const ast_string_field name
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
void ast_channel_internal_set_fake_ids(struct ast_channel *chan, const char *uniqueid, const char *linkedid)
Set uniqueid and linkedid string value only (not time)
struct ast_party_number number
Subscriber phone number.
#define ao2_link(container, obj)
static void cel_generic_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)