117 #define NUM_MULTI_CHANNEL_BLOB_BUCKETS 7 135 return ao2_bump(channel_cache_by_name);
152 key =
object->base->name;
169 const char *right_key = arg;
174 right_key = object_right->
base->
name;
176 cmp = strcasecmp(object_left->
base->
name, right_key);
179 cmp = strncasecmp(object_left->
base->
name, right_key, strlen(right_key));
205 key =
object->base->uniqueid;
222 const char *right_key = arg;
229 cmp = strcasecmp(object_left->
base->
uniqueid, right_key);
232 cmp = strncasecmp(object_left->
base->
uniqueid, right_key, strlen(right_key));
298 size_t linkedid_len = strlen(linkedid) + 1;
299 size_t peeraccount_len = strlen(peeraccount) + 1;
307 strcpy(snapshot->
account, peeraccount);
362 size_t name_len = strlen(name) + 1;
363 size_t number_len = strlen(number) + 1;
371 strcpy(snapshot->
name, name);
380 const char *uniqueid =
"";
395 strcpy(snapshot->
id, uniqueid);
446 strcpy(snapshot->
source, hangupsource);
477 if (!snapshot->
base) {
488 if (!snapshot->
peer) {
604 const char *dialstatus,
const char *forward)
618 "dialstatus",
S_OR(dialstatus,
""),
619 "forward",
S_OR(forward,
""),
620 "dialstring",
S_OR(dialstring,
""));
640 if (!caller_snapshot) {
655 if (!peer_snapshot) {
668 if (!forwarded_snapshot) {
673 ao2_ref(forwarded_snapshot, -1);
690 struct ast_channel *forwarded,
const char *dialstring,
const char *dialstatus,
740 const char *dialstring,
const char *dialstatus)
824 const char *right_key = arg;
829 right_key = object_right->
role;
831 cmp = strcasecmp(object_left->
role, right_key);
834 cmp = strncasecmp(object_left->
role, right_key, strlen(right_key));
959 int role_len = strlen(role) + 1;
967 if (!role_snapshot) {
987 if (!role_snapshot) {
1009 if (!ret_container) {
1016 if (!it_role_snapshots) {
1027 return ret_container;
1177 struct ast_str *channel_event_string;
1179 const char *variable =
1196 "Uniqueid: none\r\n");
1198 if (!channel_event_string) {
1215 struct ast_str *channel_string;
1221 if (!channel_string) {
1235 struct ast_str *channel_string;
1242 if (!channel_string) {
1249 "Logintime: %ld\r\n",
1261 if (snapshot ==
NULL 1270 "{ s: s, s: s, s: s," 1271 " s: o, s: o, s: s," 1272 " s: o, s: o, s: s }",
1369 if (!json_channel) {
1402 if (strcasecmp(
"Received", direction) != 0) {
1407 if (!json_channel) {
1412 "type",
"ChannelDtmfReceived",
1416 "channel", json_channel);
1439 const char *dialstatus =
1441 const char *forward =
1443 const char *dialstring =
1455 "dialstatus", dialstatus,
1457 "dialstring", dialstring);
1471 if (forwarded_json) {
1485 struct ast_str *channel_string;
1490 if (!channel_string) {
1509 struct ast_str *channel_string;
1515 if (!channel_string) {
1546 if (!json_channel) {
1551 "type",
"ChannelHold",
1553 "musicclass",
S_OR(musicclass,
"N/A"),
1554 "channel", json_channel);
1566 if (!json_channel) {
1571 "type",
"ChannelUnhold",
1573 "channel", json_channel);
1633 channel_topic_all =
NULL;
1635 channel_cache =
NULL;
1637 channel_cache_by_name =
NULL;
1673 if (!channel_topic_all) {
1680 if (!channel_cache) {
1687 if (!channel_cache_by_name) {
1769 if (masq_data->
caller == chan) {
1773 if (cur->
peer == chan) {
1830 if (!masq_data->
caller) {
1832 }
else if (masq_data->
caller == old_chan) {
1834 ast_debug(1,
"Caller channel %s being masqueraded out to %s (is_empty:%d)\n",
1847 if (cur->
peer == old_chan) {
1848 ast_debug(1,
"Peer channel %s being masqueraded out to %s\n",
1889 if (!masq_data->
caller) {
1894 if (masq_data->
caller == new_chan) {
1899 ast_debug(1,
"Caller channel %s being masqueraded into by %s (is_empty:%d)\n",
1918 if (cur->
peer == new_chan) {
1919 ast_debug(1,
"Peer channel %s being masqueraded into by %s\n",
1933 .
type =
"stasis-chan-dial-masq",
1940 .
type =
"stasis-chan-dial-masq",
1993 masq_data->
caller = chan;
1996 datastore->
data = masq_data;
2013 masq_data = datastore->
data;
2051 if (datastore->
data == masq_data) {
2091 masq_data = datastore->
data;
2110 masq_data = datastore->
data;
struct stasis_message_type * ast_channel_hold_type(void)
Message type for when a channel is placed on hold.
struct ast_party_caller * ast_channel_caller(struct ast_channel *chan)
static char musicclass[MAX_MUSICCLASS]
struct ao2_container * ast_channel_cache_by_name(void)
Secondary channel cache, indexed by name.
struct stasis_message_type * ast_channel_talking_stop(void)
Message type for a channel stopping talking.
const ast_string_field data
void ast_channel_snapshot_set(struct ast_channel *chan, struct ast_channel_snapshot *snapshot)
Struct containing info for an AMI event to send out.
static char accountcode[AST_MAX_ACCOUNT_CODE]
static void multi_channel_blob_dtor(void *obj)
#define ast_channel_lock(chan)
static char exten[AST_MAX_EXTENSION]
Main Channel structure associated with a channel.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
static void channel_snapshot_base_dtor(void *obj)
struct ast_channel_snapshot_base * base
struct stasis_message_type * ast_channel_dtmf_end_type(void)
Message type for when DTMF ends on a channel.
Asterisk main include file. File version handling, generic pbx functions.
struct ast_flags feature_flags
const ast_string_field uniqueid
char * str
Subscriber phone number (Malloced)
struct stasis_message_type * ast_channel_unhold_type(void)
Message type for when a channel is removed from hold.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
int ast_channel_snapshot_cep_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the context, exten and priority of two snapshots.
void ast_channel_snapshot_invalidate_segment(struct ast_channel *chan, enum ast_channel_snapshot_segment_invalidation segment)
Invalidate a channel snapshot segment from being reused.
static void remove_dial_masquerade_caller(struct ast_channel *caller)
const ast_string_field name
The arg parameter is a search key, but is not an object.
static struct ast_channel_snapshot_hangup * channel_snapshot_hangup_create(struct ast_channel *chan)
#define ast_test_flag(p, flag)
int(* channel_snapshot)(const struct ast_channel_snapshot *snapshot)
Callback which determines whether a channel should be sanitized from a message based on the channel's...
static int set_dial_masquerade(struct ast_channel *caller, struct ast_channel *peer, const char *dialstring)
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Support for translation of data formats. translate.c.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
void ast_channel_publish_cached_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message using the latest snapshot from the cache.
void ast_channel_publish_dial(struct ast_channel *caller, struct ast_channel *peer, const char *dialstring, const char *dialstatus)
Publish in the ast_channel_topic or ast_channel_topic_all topics a stasis message for the channels in...
static struct dial_masquerade_datastore * dial_masquerade_datastore_add(struct ast_channel *chan, struct dial_masquerade_datastore *masq_data)
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
static void ast_channel_publish_dial_internal(struct ast_channel *caller, struct ast_channel *peer, struct ast_channel *forwarded, const char *dialstring, const char *dialstatus, const char *forward)
struct ast_channel_snapshot * snapshot
struct stasis_message_type * ast_channel_moh_start_type(void)
Message type for starting music on hold on a channel.
#define ast_set_flag(p, flag)
struct varshead * ast_channel_get_manager_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_manager_vars().
static struct ast_channel_snapshot_dialplan * channel_snapshot_dialplan_create(struct ast_channel *chan)
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
AST_JSON_INT_T ast_json_int_t
Primarily used to cast when packing to an "I" type.
const ast_string_field rdnis
struct ast_channel_snapshot * ast_channel_snapshot(const struct ast_channel *chan)
int ast_party_id_presentation(const struct ast_party_id *id)
Determine the overall presentation value for the given party.
struct dial_masquerade_datastore::@422 dialed_peers
#define ao2_callback(c, flags, cb_fn, arg)
static int channel_snapshot_uniqueid_cmp_cb(void *obj, void *arg, int flags)
static struct ast_json * varset_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
static void dial_masquerade_caller_datastore_destroy(void *data)
Structure representing a snapshot of channel state.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
static int channel_role_cmp_cb(void *obj, void *arg, int flags)
static struct ast_manager_event_blob * agent_logoff_to_ami(struct stasis_message *msg)
Assume that the ao2_container is already locked.
static void channel_snapshot_dialplan_dtor(void *obj)
static struct dial_masquerade_datastore * dial_masquerade_datastore_alloc(void)
Structure for a data store type.
ast_channel_state
ast_channel states
const ast_string_field accountcode
struct stasis_message_type * ast_channel_flash_type(void)
Message type for when a hook flash occurs on a channel.
#define AST_NUM_CHANNEL_BUCKETS
static struct ast_json * hold_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
const ast_string_field uniqueid
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
static struct ast_manager_event_blob * agent_login_to_ami(struct stasis_message *msg)
#define AST_LIST_EMPTY(head)
Checks whether the specified list contains any entries.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_link_flags(container, obj, flags)
#define ast_copy_flags(dest, src, flagz)
#define ast_strdup(str)
A wrapper for strdup()
Structure for a data store object.
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
const char * ast_state2str(enum ast_channel_state)
Gives the string form of a given channel state.
struct stasis_message_type * ast_channel_varset_type(void)
Message type for when a variable is set on a channel.
struct stasis_message_type * ast_channel_chanspy_start_type(void)
Message type for when a channel starts spying on another channel.
Structure containing connected information for a channel snapshot.
static void channel_role_snapshot_dtor(void *obj)
struct stasis_message_type * ast_channel_monitor_start_type(void)
Message type for starting monitor on a channel.
int ast_json_is_null(const struct ast_json *value)
Check if value is JSON null.
static struct ast_channel_snapshot_base * channel_snapshot_base_create(struct ast_channel *chan)
Structure representing a change of snapshot of channel state.
struct stasis_message_type * ast_channel_talking_start(void)
Message type for a channel starting talking.
#define EVENT_FLAG_DIALPLAN
#define AST_LIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
int ast_channel_priority(const struct ast_channel *chan)
struct ast_channel_snapshot_dialplan * dialplan
const char * ast_channel_linkedid(const struct ast_channel *chan)
struct ast_manager_event_blob * ast_manager_event_blob_create(int event_flags, const char *manager_event, const char *extra_fields_fmt,...)
Construct a ast_manager_event_blob.
Structure containing callbacks for Stasis message sanitization.
static const struct ast_datastore_info dial_masquerade_info
struct ast_channel_snapshot * ast_channel_snapshot_create(struct ast_channel *chan)
Generate a snapshot of the channel state. This is an ao2 object, so ao2_cleanup() to deallocate...
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...
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
Blob of data associated with a channel.
static void dial_masquerade_datastore_dtor(void *vdoomed)
#define NUM_MULTI_CHANNEL_BLOB_BUCKETS
#define ast_strlen_zero(foo)
int ast_channel_snapshot_caller_id_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the callerid info of two snapshots.
struct ast_json * ast_json_dialplan_cep_app(const char *context, const char *exten, int priority, const char *app_name, const char *app_data)
Construct a context/exten/priority/application/application_data as JSON.
struct ast_json * ast_json_null(void)
Get the JSON null value.
struct ast_json * ast_json_channel_vars(struct varshead *channelvars)
Construct a JSON object from a ast_var_t list.
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
const ast_string_field dialed_subaddr
ast_channel_snapshot_segment_invalidation
Channel snapshot invalidation flags, used to force generation of segments.
static void dial_masquerade_datastore_destroy(void *data)
static struct ast_json * talking_stop_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
const ast_string_field context
struct stasis_topic * ast_channel_topic_all(void)
A topic which publishes the events for all channels.
#define ast_debug(level,...)
Log a DEBUG message.
static struct ast_json * dial_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
struct ast_bridge * ast_channel_get_bridge(const struct ast_channel *chan)
Get the bridge associated with a channel.
struct varshead * ari_vars
The arg parameter is a partial search key similar to OBJ_SEARCH_KEY.
struct ast_channel_snapshot * ast_channel_snapshot_get_latest_by_name(const char *name)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object...
Structure containing hangup information for a channel snapshot.
struct ast_json * ast_json_name_number(const char *name, const char *number)
Common JSON rendering functions for common 'objects'.
static void dial_masquerade_breakdown(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
Asterisk JSON abstraction layer.
static int channel_snapshot_uniqueid_hash_cb(const void *obj, const int flags)
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
const char * ast_channel_accountcode(const struct ast_channel *chan)
static struct ast_json * unhold_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
const ast_string_field appl
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
static void channel_snapshot_caller_dtor(void *obj)
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
int ast_stasis_channels_init(void)
Initialize the stasis channel topic and message types.
struct ast_party_connected_line * ast_channel_connected(struct ast_channel *chan)
static struct ast_manager_event_blob * varset_to_ami(struct stasis_message *msg)
void ast_multi_channel_blob_add_channel(struct ast_multi_channel_blob *obj, const char *role, struct ast_channel_snapshot *snapshot)
Add a ast_channel_snapshot to a ast_multi_channel_blob object.
const struct timeval * stasis_message_timestamp(const struct stasis_message *msg)
Get the time when a message was created.
static int channel_snapshot_cmp_cb(void *obj, void *arg, int flags)
#define AST_LIST_REMOVE_CURRENT(field)
Removes the current entry from a list during a traversal.
#define ast_channel_cleanup(c)
Cleanup a channel reference.
#define ao2_ref(o, delta)
#define S_COR(a, b, c)
returns the equivalent of logic or for strings, with an additional boolean check: second one if not e...
Structure containing dialplan information for a channel snapshot.
struct stasis_message_type * ast_channel_monitor_stop_type(void)
Message type for stopping monitor on a channel.
const ast_string_field subaddr
static struct stasis_topic * channel_topic_all
const ast_string_field exten
struct timeval creationtime
#define ast_strdupa(s)
duplicate a string in memory from the stack
struct varshead * ast_channel_get_ari_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_ari_vars().
struct ast_channel_snapshot_hangup * hangup
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
static struct stasis_message * create_channel_blob_message(struct ast_channel_snapshot *snapshot, struct stasis_message_type *type, struct ast_json *blob)
A set of macros to manage forward-linked lists.
static char language[MAX_LANGUAGE]
struct stasis_message_type * ast_channel_agent_login_type(void)
Message type for agent login on a channel.
static struct ast_channel_snapshot_bridge * channel_snapshot_bridge_create(struct ast_channel *chan)
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
AST_LIST_HEAD_NOLOCK(contactliststruct, contact)
struct stasis_message_type * ast_channel_agent_logoff_type(void)
Message type for agent logoff on a channel.
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
static struct ao2_container * channel_cache_by_name
const char * ast_channel_exten(const struct ast_channel *chan)
struct ao2_container * ast_channel_cache_all(void)
Core PBX routines and definitions.
struct ast_json * ast_json_timeval(const struct timeval tv, const char *zone)
Construct a timeval as JSON.
static int channel_snapshot_hash_cb(const void *obj, const int flags)
struct ao2_container * ast_multi_channel_blob_get_channels(struct ast_multi_channel_blob *obj, const char *role)
Retrieve all channel snapshots associated with a specific role from a ast_multi_channel_blob.
const char * ast_channel_uniqueid(const struct ast_channel *chan)
struct ast_channel_snapshot_caller * caller
static void dial_masquerade_datastore_cleanup(struct dial_masquerade_datastore *masq_data)
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
static void dial_masquerade_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
struct ast_flags softhangup_flags
struct stasis_message_type * ast_channel_mixmonitor_start_type(void)
Message type for starting mixmonitor on a channel.
Structure that contains information about a bridge.
const char * ast_channel_userfield(const struct ast_channel *chan)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
static void dial_masquerade_datastore_remove_chan(struct dial_masquerade_datastore *masq_data, struct ast_channel *chan)
struct varshead * manager_vars
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
struct stasis_message_type * ast_channel_mixmonitor_stop_type(void)
Message type for stopping mixmonitor on a channel.
const ast_string_field dnid
#define ao2_unlink(container, obj)
Structure containing peer information for a channel snapshot.
struct ast_channel_snapshot * snapshot
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
void ast_channel_publish_varset(struct ast_channel *chan, const char *name, const char *value)
Publish a ast_channel_varset for a channel.
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
static struct ast_channel_snapshot_peer * channel_snapshot_peer_create(struct ast_channel *chan)
void ast_channel_publish_final_snapshot(struct ast_channel *chan)
Send the final channel snapshot for a channel, thus removing it from cache.
Structure containing caller information for a channel snapshot.
struct ast_party_dialed * ast_channel_dialed(struct ast_channel *chan)
static struct ast_datastore * dial_masquerade_datastore_find(struct ast_channel *chan)
static struct ast_json * dtmf_end_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
#define ao2_iterator_next(iter)
Structure containing base information for a channel snapshot.
#define ao2_alloc(data_size, destructor_fn)
struct timeval ast_channel_creationtime(struct ast_channel *chan)
static void channel_snapshot_update_dtor(void *obj)
struct stasis_message * ast_channel_blob_create(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Creates a ast_channel_blob message.
const char * ast_channel_appl(const struct ast_channel *chan)
static int channel_role_hash_cb(const void *obj, const int flags)
void ast_channel_publish_dial_forward(struct ast_channel *caller, struct ast_channel *peer, struct ast_channel *forwarded, const char *dialstring, const char *dialstatus, const char *forward)
Publish in the ast_channel_topic or ast_channel_topic_all topics a stasis message for the channels in...
const ast_string_field userfield
const char * ast_channel_peeraccount(const struct ast_channel *chan)
static void remove_dial_masquerade(struct ast_channel *peer)
#define AST_LIST_TRAVERSE(head, var, field)
Loops over (traverses) the entries in a list.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
STASIS_MESSAGE_TYPE_DEFN(ast_channel_snapshot_type)
Define channel message types.
#define ast_channel_unlock(chan)
struct stasis_message_type * ast_channel_hangup_handler_type(void)
Message type for hangup handler related actions.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
static struct ast_channel_snapshot_update * channel_snapshot_update_create(struct ast_channel *chan)
static struct ast_manager_event_blob * talking_start_to_ami(struct stasis_message *msg)
#define ast_calloc(num, len)
A wrapper for calloc()
char * ast_escape_c_alloc(const char *s)
Escape standard 'C' sequences in the given string.
static void to_ami(struct ast_sip_subscription *sub, struct ast_str **buf)
struct ast_channel_snapshot * new_snapshot
enum ast_channel_state state
const char * ast_channel_hangupsource(const struct ast_channel *chan)
#define ao2_find(container, arg, flags)
struct stasis_message_type * ast_channel_snapshot_type(void)
Message type for ast_channel_snapshot_update.
struct ast_channel_snapshot * old_snapshot
struct stasis_message_type * ast_channel_dtmf_begin_type(void)
Message type for when DTMF begins on a channel.
static const struct ast_datastore_info dial_masquerade_caller_info
#define ast_clear_flag(p, flag)
struct ast_party_redirecting * ast_channel_redirecting(struct ast_channel *chan)
struct stasis_message * ast_channel_blob_create_from_cache(const char *channel_id, struct stasis_message_type *type, struct ast_json *blob)
Create a ast_channel_blob message, pulling channel state from the cache.
const char * ast_channel_data(const struct ast_channel *chan)
const ast_string_field ani
static void publish_message_for_channel_topics(struct stasis_message *message, struct ast_channel *chan)
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
const ast_string_field language
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
The arg parameter is an object of the same type.
#define AST_LIST_HEAD_INIT_NOLOCK(head)
Initializes a list head structure.
struct ao2_container * channel_snapshots
static void channel_blob_dtor(void *obj)
static struct ao2_container * channel_cache
#define ast_channel_ref(c)
Increase channel reference count.
static struct ast_channel_snapshot_connected * channel_snapshot_connected_create(struct ast_channel *chan)
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...
static struct ast_json * talking_start_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
static struct ast_json * channel_blob_to_json(struct stasis_message *message, const char *type, const struct stasis_message_sanitizer *sanitize)
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
int ast_channel_hangupcause(const struct ast_channel *chan)
const ast_string_field number
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...
struct dial_target::@421 list
const char * ast_channel_name(const struct ast_channel *chan)
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.
static void dial_target_free(struct dial_target *doomed)
struct ast_channel_snapshot_bridge * bridge
A multi channel blob data structure for multi_channel_blob stasis messages.
#define ao2_unlink_flags(container, obj, flags)
const char * ast_channel_language(const struct ast_channel *chan)
Abstract JSON element (object, array, string, int, ...).
struct ast_flags * ast_channel_snapshot_segment_flags(struct ast_channel *chan)
static void channel_snapshot_dtor(void *obj)
int ast_channel_has_manager_vars(void)
Return whether or not any manager variables have been set.
const char * ast_channel_context(const struct ast_channel *chan)
struct stasis_message_type * ast_channel_dial_type(void)
Message type for when a channel dials another channel.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for a channel.
#define ast_datastore_alloc(info, uid)
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field)
Loops safely over (traverses) the entries in a list.
#define ast_channel_trylock(chan)
int ast_channel_snapshot_connected_line_equal(const struct ast_channel_snapshot *old_snapshot, const struct ast_channel_snapshot *new_snapshot)
Compares the connected line info of two snapshots.
Search option field mask.
void ast_channel_publish_blob(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Publish a channel blob message.
static char context[AST_MAX_CONTEXT]
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
struct ast_channel * caller
struct stasis_message_type * ast_channel_moh_stop_type(void)
Message type for stopping music on hold on a channel.
static void stasis_channels_cleanup(void)
struct ast_json * ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_channel_snapshot.
struct ast_channel * peer
struct ast_channel_snapshot_peer * peer
struct stasis_message_type * ast_channel_hangup_request_type(void)
Message type for when a hangup is requested on a channel.
static struct ast_manager_event_blob * talking_stop_to_ami(struct stasis_message *msg)
intmax_t ast_json_integer_get(const struct ast_json *integer)
Get the value from a JSON integer.
struct stasis_message_type * ast_channel_masquerade_type(void)
Message type for when a channel is being masqueraded.
struct stasis_message_type * ast_channel_fax_type(void)
Message type for a fax operation.
static struct ast_channel_snapshot_caller * channel_snapshot_caller_create(struct ast_channel *chan)
enum ama_flags ast_channel_amaflags(const struct ast_channel *chan)
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define ast_string_field_free_memory(x)
free all memory - to be called before destroying the object
Structure containing bridge information for a channel snapshot.
struct ast_json * ast_json_copy(const struct ast_json *value)
Copy a JSON value, but not its children.
A channel snapshot wrapper object used in ast_multi_channel_blob objects.
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
struct ast_channel_snapshot_connected * connected
struct ast_multi_channel_blob * ast_multi_channel_blob_create(struct ast_json *blob)
Create a ast_multi_channel_blob suitable for a stasis_message.
struct stasis_message_type * ast_channel_chanspy_stop_type(void)
Message type for when a channel stops spying on another channel.
static force_inline int attribute_pure ast_str_case_hash(const char *str)
Compute a hash value on a case-insensitive string.
const ast_string_field name
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
static struct ast_json * hangup_request_to_json(struct stasis_message *message, const struct stasis_message_sanitizer *sanitize)
struct stasis_message_type * ast_channel_mixmonitor_mute_type(void)
Message type for muting or unmuting mixmonitor on a channel.
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
#define ao2_link(container, obj)