142#define BACKEND_BUCKETS 13
151#define CEL_MAX_EVENT_IDS 64
156#define NUM_APP_BUCKETS 97
161#define NUM_DIALSTATUS_BUCKETS 251
245 .item_offset = offsetof(
struct cel_config, general),
247 .category =
"general",
297 ast_log(
LOG_ERROR,
"Applications are listed to be tracked, but APP events are not tracked\n");
365 e->
command =
"cel show status";
367 "Usage: cel show status\n"
368 " Displays the Channel Event Logging system status.\n";
382 if (!cfg || !cfg->general || !cfg->general->enable) {
386 for (i = 0; i < (
sizeof(cfg->general->events) * 8); i++) {
389 if (!(cfg->general->events & ((int64_t) 1 << i))) {
394 if (strcasecmp(
name,
"Unknown")) {
401 ast_cli(
a->fd,
"CEL Tracking Application: %s\n",
app);
410 ast_cli(
a->fd,
"CEL Event Subscriber: %s\n", backend->
name);
438 if (!cfg || !cfg->general) {
442 return (cfg->general->events & ((int64_t) 1 << et)) ? 1 : 0;
463 cfg->
events = (int64_t) -1;
467 cfg->
events |= ((int64_t) 1 << event_type);
504 if (!cfg || !cfg->general) {
521 struct ast_json *extra,
const char *peer)
526 userdefevname, extra, peer);
531 const char *userdefevname,
struct ast_json *extra,
const char *peer)
574 const char *userdefevname,
struct ast_json *extra,
575 const char *peer_str)
581 if (!cfg || !cfg->general || !cfg->general->enable || !
backends) {
659 .
type =
"CEL fabricated channel",
667 const char *mixed_name;
677 if (!cfg || !cfg->general) {
702 snprintf(timebuf,
sizeof(timebuf),
"%ld.%06ld", (
long) record.
event_time.tv_sec,
707 ast_strftime(timebuf,
sizeof(timebuf), cfg->general->date_format, &tm);
738 ast_channel_accountcode_set(tchan, record.
account_code);
739 ast_channel_peeraccount_set(tchan, record.
peer_account);
740 ast_channel_userfield_set(tchan, record.
user_field);
811 strcpy(lid->
id, linkedid);
826 "Please ensure all modules were compiled for "
827 "this version of Asterisk.\n");
870 const struct timeval *event_time);
903 const struct timeval *event_time)
905 int is_hungup, was_hungup;
915 if (!was_hungup && is_hungup) {
943 const struct timeval *event_time)
962 const struct timeval *event_time)
1019 char *current_chan =
NULL;
1036 if (!current_snapshot) {
1117 const char *reason =
NULL;
1130 reason =
"ParkedCallTimeOut";
1133 reason =
"ParkedCallGiveUp";
1136 reason =
"ParkedCallUnparked";
1139 reason =
"ParkedCallFailed";
1142 reason =
"ParkedCallSwap";
1148 "reason", reason ?:
"",
1165 size_t dialstatus_string_len;
1174 if (!strcasecmp(dialstatus_string,
"ANSWER") && strcasecmp(
dialstatus->dialstatus,
"ANSWER")) {
1188 dialstatus_string_len = strlen(dialstatus_string) + 1;
1211 }
else if (!strcasecmp(
dialstatus,
"CHANUNAVAIL")) {
1213 }
else if (!strcasecmp(
dialstatus,
"CONGESTION")) {
1215 }
else if (!strcasecmp(
dialstatus,
"NOANSWER")) {
1217 }
else if (!strcasecmp(
dialstatus,
"BUSY")) {
1219 }
else if (!strcasecmp(
dialstatus,
"ANSWER")) {
1221 }
else if (!strcasecmp(
dialstatus,
"CANCEL")) {
1223 }
else if (!strcasecmp(
dialstatus,
"DONTCALL")) {
1225 }
else if (!strcasecmp(
dialstatus,
"TORTURE")) {
1227 }
else if (!strcasecmp(
dialstatus,
"INVALIDARGS")) {
1268 switch (event_type) {
1297 "extension", transfer_msg->
exten,
1298 "context", transfer_msg->
context,
1299 "bridge_id", bridge_snapshot->
uniqueid,
1338 extra =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: s}",
1340 "channel2_name", channel2->
base->
name,
1353 extra =
ast_json_pack(
"{s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: s}",
1355 "channel2_name", channel2->
base->
name,
1381 if (!channel || !target) {
1386 "pickup_channel", channel->
base->
name,
1407 if (!localone || !localtwo) {
1628 cel_backend_hash_fn,
NULL, cel_backend_cmp_fn);
1702 "extra",
"extra",
S_OR(extra,
""));
1717 "event_type", event_type,
1737 if (!mod_cfg || !mod_cfg->general) {
1741 ao2_ref(mod_cfg->general, +1);
1742 return mod_cfg->general;
1755 cleanup_config = mod_cfg->
general;
1799 backend->
callback = backend_callback;
1812 .
requires =
"extconfig",
static const struct adsi_event events[]
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
void ast_free_ptr(void *ptr)
free() wrapper
#define ast_malloc(len)
A wrapper for malloc()
#define ao2_iterator_next(iter)
#define ao2_link(container, obj)
Add an object to a container.
@ AO2_ALLOC_OPT_LOCK_NOLOCK
@ AO2_ALLOC_OPT_LOCK_MUTEX
#define ao2_global_obj_replace_unref(holder, obj)
Replace an ao2 object in the global holder, throwing away any old object.
#define ao2_callback(c, flags, cb_fn, arg)
ao2_callback() is a generic function that applies cb_fn() to all objects in a container,...
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define AO2_STRING_FIELD_CMP_FN(stype, field)
Creates a compare function for a structure string field.
#define ao2_unlink(container, obj)
Remove an object from a container.
#define ao2_global_obj_ref(holder)
Get a reference to the object stored in the global holder.
#define ao2_find(container, arg, flags)
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_global_obj_release(holder)
Release the ao2 object held in the global holder.
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
#define AO2_STRING_FIELD_HASH_FN(stype, field)
Creates a hash function for a structure string field.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
#define ao2_alloc(data_size, destructor_fn)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Allocate and initialize a hash container with the desired number of buckets.
@ AST_BRIDGE_TRANSFER_SUCCESS
static void destroy_routes(void)
void ast_cel_publish_user_event(struct ast_channel *chan, const char *event, const char *extra)
Publish a CEL user event.
static struct aco_type ignore_option
void ast_cel_set_config(struct ast_cel_general_config *config)
Set the current CEL configuration.
static int cel_linkedid_ref(const char *linkedid)
static void cel_general_config_dtor(void *obj)
Destructor for cel_config.
static const char * ignore_categories[]
static struct ast_cli_entry cli_status
static struct stasis_forward * cel_cel_forwarder
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)
static int ast_cel_track_event(enum ast_cel_event_type et)
#define CEL_MAX_EVENT_IDS
Maximum possible CEL event IDs.
static int create_subscriptions(void)
Create the Stasis subscriptions for CEL.
static void cel_local_optimization_end_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
int ast_cel_backend_unregister(const char *name)
Unregister a CEL backend.
static const char *const cel_event_types[CEL_MAX_EVENT_IDS]
Map of ast_cel_event_type to strings.
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.
STASIS_MESSAGE_TYPE_DEFN(cel_generic_type)
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 int create_routes(void)
Create the Stasis message router and routes for CEL.
static int is_valid_dialstatus(struct ast_multi_channel_blob *blob)
static struct aco_type general_option
An aco_type structure to link the "general" category to the ast_cel_general_config type.
enum ast_cel_event_type ast_cel_str_to_event_type(const char *name)
Get the event type from a string.
void ast_cel_publish_event(struct ast_channel *chan, enum ast_cel_event_type event_type, struct ast_json *blob)
Publish a CEL event.
static void cel_channel_linkedid_change(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *event_time)
static void cel_bridge_leave_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void cel_dial_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)
static AO2_GLOBAL_OBJ_STATIC(cel_backends)
static int events_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
void * ast_cel_general_config_alloc(void)
Allocate a CEL configuration object.
unsigned int ast_cel_check_enabled(void)
Hashing function for cel_backend.
#define NUM_DIALSTATUS_BUCKETS
Number of buckets for the dialstatus container.
static struct aco_file cel_conf
The config file to be processed for the module.
static int reload_module(void)
static void check_retire_linkedid(struct ast_channel_snapshot *snapshot, const struct timeval *event_time)
static int cel_filter_channel_snapshot(struct ast_channel_snapshot *snapshot)
static void cel_pickup_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void cel_blind_transfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void save_dialstatus(struct ast_multi_channel_blob *blob, struct ast_channel_snapshot *snapshot)
struct stasis_topic * ast_cel_topic(void)
Get the CEL topic.
static struct aco_type * general_options[]
static void cel_config_dtor(void *obj)
Destructor for cel_config.
static void cel_attended_transfer_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static int cel_track_app(const char *const_app)
struct ast_channel * ast_cel_fabricate_channel_from_event(const struct ast_event *event)
Create a fake channel from data in a CEL event.
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.
static const char * get_blob_variable(struct ast_multi_channel_blob *blob, const char *varname)
static int cel_pre_apply_config(void)
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.
static struct stasis_forward * cel_channel_forwarder
cel_channel_snapshot_monitor cel_channel_monitors[]
Handlers for channel snapshot changes.
struct stasis_message_type * cel_generic_type(void)
static char * handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
static int load_module(void)
CONFIG_INFO_CORE("cel", cel_cfg_info, cel_configs, cel_config_alloc,.files=ACO_FILES(&cel_conf),.pre_apply_config=cel_pre_apply_config,)
static int cel_backend_send_cb(void *obj, void *arg, int flags)
static void cel_channel_app_change(struct ast_channel_snapshot *old_snapshot, struct ast_channel_snapshot *new_snapshot, const struct timeval *event_time)
static int apps_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
static struct ast_str * cel_generate_peer_str(struct ast_bridge_snapshot *bridge, struct ast_channel_snapshot *chan)
#define NUM_APP_BUCKETS
Number of buckets for the appset container.
static const struct ast_datastore_info fabricated_channel_datastore
static void cel_generic_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static struct stasis_forward * cel_bridge_forwarder
static void cel_parking_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static struct stasis_message_router * cel_state_router
static struct stasis_topic * cel_topic
static int unload_module(void)
static struct cel_dialstatus * get_dialstatus(const char *uniqueid)
struct ast_cel_general_config * ast_cel_get_config(void)
Obtain the current CEL configuration.
static void * cel_config_alloc(void)
int ast_cel_backend_register(const char *name, ast_cel_backend_cb backend_callback)
Register a CEL backend.
const char * ast_cel_get_type_name(enum ast_cel_event_type type)
Get the name of a CEL event type.
static void destroy_subscriptions(void)
static struct stasis_forward * cel_parking_forwarder
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.
static void cel_local_optimization_begin_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static void cel_bridge_enter_cb(void *data, struct stasis_subscription *sub, struct stasis_message *message)
static struct stasis_topic * cel_aggregation_topic
static void cel_local_optimization_cb_helper(void *data, struct stasis_subscription *sub, struct stasis_message *message, enum ast_cel_event_type event_type)
ast_cel_event_type
CEL event types.
@ AST_CEL_CHANNEL_END
channel end
@ AST_CEL_APP_END
an app ends
@ AST_CEL_ANSWER
A ringing phone is answered.
@ AST_CEL_PARK_START
a channel is parked
@ AST_CEL_LINKEDID_END
the last channel with the given linkedid is retired
@ AST_CEL_BRIDGE_EXIT
channel exits a bridge
@ AST_CEL_FORWARD
this call was forwarded somewhere else
@ AST_CEL_HANGUP
hangup terminates connection
@ AST_CEL_USER_DEFINED
a user-defined event, the event name field should be set
@ AST_CEL_PICKUP
a directed pickup was performed on this channel
@ AST_CEL_APP_START
an app starts
@ AST_CEL_LOCAL_OPTIMIZE_BEGIN
A local channel optimization has begun.
@ AST_CEL_PARK_END
channel out of the park
@ AST_CEL_CHANNEL_START
channel birth
@ AST_CEL_ATTENDEDTRANSFER
a transfer occurs
@ AST_CEL_BRIDGE_ENTER
channel enters a bridge
@ AST_CEL_BLINDTRANSFER
a transfer occurs
@ AST_CEL_LOCAL_OPTIMIZE
A local channel optimization occurred, this marks the end.
void(* ast_cel_backend_cb)(struct ast_event *event)
CEL backend callback.
#define AST_CEL_EVENT_RECORD_VERSION
struct ABI version
static const char config[]
General Asterisk PBX channel definitions.
void ast_channel_exten_set(struct ast_channel *chan, const char *value)
void ast_channel_appl_set(struct ast_channel *chan, const char *value)
@ AST_CHAN_TP_INTERNAL
Channels with this particular technology are an implementation detail of Asterisk and should generall...
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)
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
struct varshead * ast_channel_varshead(struct ast_channel *chan)
void ast_channel_data_set(struct ast_channel *chan, const char *value)
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
const char * ast_channel_uniqueid(const struct ast_channel *chan)
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
#define ast_channel_unref(c)
Decrease channel reference count.
void ast_channel_amaflags_set(struct ast_channel *chan, enum ama_flags value)
void ast_channel_context_set(struct ast_channel *chan, const char *value)
#define ast_dummy_channel_alloc()
Create a fake channel structure.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
#define ast_var_assign(name, value)
Standard Command Line Interface.
int ast_cli_unregister(struct ast_cli_entry *e)
Unregisters a command or an array of commands.
#define ast_cli_register(e)
Registers a command or an array of commands.
#define AST_CLI_DEFINE(fn, txt,...)
void ast_cli(int fd, const char *fmt,...)
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Configuration option-handling.
int aco_set_defaults(struct aco_type *type, const char *category, void *obj)
Set all default options of obj.
void aco_info_destroy(struct aco_info *info)
Destroy an initialized aco_info struct.
@ ACO_PROCESS_ERROR
Their was an error and no changes were applied.
#define STRFLDSET(type,...)
Convert a struct and a list of stringfield fields to an argument list of field offsets.
int aco_info_init(struct aco_info *info)
Initialize an aco_info structure.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
#define aco_option_register(info, name, matchtype, types, default_val, opt_type, flags,...)
Register a config option.
@ OPT_BOOL_T
Type for default option handler for bools (ast_true/ast_false)
@ OPT_STRINGFIELD_T
Type for default option handler for stringfields.
#define aco_option_register_custom(info, name, matchtype, types, default_val, handler, flags)
Register a config option.
void * aco_pending_config(struct aco_info *info)
Get pending config changes.
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 ACO_TYPES(...)
A helper macro to ensure that aco_info types always have a sentinel.
Local proxy channel special access.
struct stasis_message_type * ast_local_optimization_end_type(void)
Message type for when a local channel optimization completes.
struct stasis_message_type * ast_local_optimization_begin_type(void)
Message type for when a local channel optimization begins.
#define ast_datastore_alloc(info, uid)
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
struct ast_event * ast_event_new(enum ast_event_type event_type,...)
Create a new event.
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.
void ast_event_destroy(struct ast_event *event)
Destroy an event.
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.
@ AST_EVENT_IE_CEL_ACCTCODE
Channel Event AccountCode Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_EXTRA
Channel Event extra data Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_CONTEXT
Channel Event context name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_PEERACCT
Channel Event peeraccount Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_CIDRDNIS
Channel Event CID RDNIS field Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_EVENT_TIME
Channel Event Time (seconds) Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_CEL_CHANNAME
Channel Event channel name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_CIDANI
Channel Event CID ANI field Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_CIDDNID
Channel Event CID dnid Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_EXTEN
Channel Event extension name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_CIDNAME
Channel Event CID name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_AMAFLAGS
Channel Event AMA flags Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_CEL_USEREVENT_NAME
Channel Event User Event Name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_TENANTID
Channel Event TenantID Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_LINKEDID
Channel Event LinkedID Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_EVENT_TIME_USEC
Channel Event Time (micro-seconds) Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_CEL_EVENT_TYPE
Channel Event Type Used by: AST_EVENT_CEL Payload type: UINT.
@ AST_EVENT_IE_CEL_UNIQUEID
Channel Event UniqueID Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_APPNAME
Channel Event app name Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_APPDATA
Channel Event app args/data Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_PEER
Channel Event Peer – for Things involving multiple channels, like BRIDGE Used by: AST_EVENT_CEL Paylo...
@ AST_EVENT_IE_CEL_CIDNUM
Channel Event CID num Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_CEL_USERFIELD
Channel Event Userfield Used by: AST_EVENT_CEL Payload type: STR.
@ AST_EVENT_IE_PLTYPE_UINT
@ AST_EVENT_IE_PLTYPE_STR
struct stasis_topic * ast_parking_topic(void)
accessor for the parking stasis topic
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
struct stasis_message_type * ast_parked_call_type(void)
accessor for the parked call stasis message type
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.
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,...
struct stasis_message_type * ast_channel_dial_type(void)
Message type for when a channel dials another channel.
struct stasis_message_type * ast_channel_snapshot_type(void)
Message type for ast_channel_snapshot_update.
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 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.
char * strsep(char **str, const char *delims)
Configuration File Parser.
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_verb(level,...)
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_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
A set of macros to manage forward-linked lists.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
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...
Asterisk module definitions.
@ AST_MODFLAG_GLOBAL_SYMBOLS
#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_FAILURE
Module could not be loaded properly.
@ AST_MODULE_LOAD_SUCCESS
Core PBX routines and definitions.
struct stasis_message_type * ast_call_pickup_type(void)
accessor for call pickup message type
static int is_enabled(void)
Helper function to check if module is enabled.
struct stasis_forward * sub
struct ao2_container * container
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
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.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
struct stasis_message_type * ast_channel_entered_bridge_type(void)
Message type for ast_channel enter bridge blob messages.
struct stasis_message_type * ast_blind_transfer_type(void)
Message type for ast_blind_transfer_message.
struct stasis_message_type * ast_attended_transfer_type(void)
Message type for ast_attended_transfer_message.
struct stasis_topic * ast_bridge_topic_all(void)
A topic which publishes the events for all bridges.
@ AST_ATTENDED_TRANSFER_DEST_FAIL
@ AST_ATTENDED_TRANSFER_DEST_BRIDGE_MERGE
@ AST_ATTENDED_TRANSFER_DEST_LOCAL_APP
@ AST_ATTENDED_TRANSFER_DEST_LINK
@ AST_ATTENDED_TRANSFER_DEST_APP
@ AST_ATTENDED_TRANSFER_DEST_THREEWAY
struct stasis_message_type * ast_channel_left_bridge_type(void)
Message type for ast_channel leave bridge blob messages.
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.
#define stasis_message_router_create(topic)
Create a new message router object.
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.
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.
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
char * ast_str_truncate(struct ast_str *buf, ssize_t len)
Truncates the enclosed string to the given length.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static force_inline char * ast_str_to_lower(char *str)
Convert a string to all lower-case.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_container_alloc(buckets)
Allocates a hash container for bare strings.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
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.
The representation of a single configuration file to be processed.
Type information about a category-level configurable object.
enum aco_category_op category_match
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Registered applications container.
Message representing attended transfer.
union ast_attended_transfer_message::@284 dest
enum ast_attended_transfer_dest_type dest_type
struct ast_bridge_channel_snapshot_pair to_transfer_target
struct ast_channel_snapshot * transferee
struct ast_bridge_channel_snapshot_pair to_transferee
struct ast_channel_snapshot * target
Message published during a blind transfer.
char exten[AST_MAX_EXTENSION]
struct ast_bridge_snapshot * bridge
struct ast_channel_snapshot * transferer
struct ast_channel_snapshot * transferee
enum ast_transfer_result result
char context[AST_MAX_CONTEXT]
Blob of data associated with a bridge.
struct ast_bridge_snapshot * bridge
struct ast_channel_snapshot * channel
struct ast_bridge_snapshot * bridge_snapshot
struct ast_channel_snapshot * channel_snapshot
Structure that contains a snapshot of information about a bridge.
const ast_string_field uniqueid
const ast_string_field technology
struct ao2_container * channels
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
A structure to hold CEL global configuration options.
struct ao2_container * apps
Blob of data associated with a channel.
struct ast_channel_snapshot * snapshot
const ast_string_field tenantid
const ast_string_field accountcode
const ast_string_field userfield
const ast_string_field uniqueid
const ast_string_field name
const ast_string_field number
const ast_string_field rdnis
const ast_string_field ani
const ast_string_field name
const ast_string_field dnid
const ast_string_field data
const ast_string_field context
const ast_string_field exten
const ast_string_field appl
Structure representing a change of snapshot of channel state.
Structure representing a snapshot of channel state.
struct ast_channel_snapshot_dialplan * dialplan
struct ast_channel_snapshot_peer * peer
struct ast_channel_snapshot_base * base
enum ast_channel_state state
struct ast_channel_snapshot_caller * caller
struct ast_channel_snapshot_hangup * hangup
Main Channel structure associated with a channel.
descriptor for a cli entry.
Structure for a data store type.
Structure for a data store object.
Abstract JSON element (object, array, string, int, ...).
A multi channel blob data structure for multi_channel_blob stasis messages.
A parked call message payload.
const ast_string_field parkinglot
struct ast_channel_snapshot * retriever
struct ast_channel_snapshot * parkee
enum ast_parked_call_event_type event_type
const ast_string_field parker_dial_string
struct ast_party_id id
Caller party ID.
struct ast_party_id ani
Automatic Number Identification (ANI)
struct ast_party_dialed::@208 number
Dialed/Called number.
char * str
Subscriber phone number (Malloced)
struct ast_party_name name
Subscriber name.
struct ast_party_number number
Subscriber phone number.
unsigned char valid
TRUE if the name information is valid/present.
char * str
Subscriber name (Malloced)
unsigned char valid
TRUE if the number information is valid/present.
char * str
Subscriber phone number (Malloced)
struct ast_party_id from
Who is redirecting the call (Sent to the party the call is redirected toward)
Support for dynamic strings.
Structure for variables, used for configurations and for channel variables.
the list of registered channel types
ast_cel_backend_cb callback
A container that holds all config-related information.
struct ast_cel_general_config * general
char uniqueid[AST_MAX_UNIQUEID]
An API for managing task processing threads that can be shared across modules.
#define AST_TASKPROCESSOR_HIGH_WATER_LEVEL
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ast_test_flag(p, flag)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.