| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
#include "asterisk/refer.h"#include "asterisk/stringfields.h"#include "asterisk/stasis.h"#include "asterisk/channel.h"
Go to the source code of this file.
| Data Structures | |
| struct | ast_ari_transfer_message | 
| Message published during an "ARI" transfer.  More... | |
| struct | ast_channel_blob | 
| Blob of data associated with a channel.  More... | |
| struct | ast_channel_snapshot | 
| Structure representing a snapshot of channel state.  More... | |
| struct | ast_channel_snapshot_base | 
| Structure containing base information for a channel snapshot.  More... | |
| struct | ast_channel_snapshot_bridge | 
| Structure containing bridge information for a channel snapshot.  More... | |
| struct | ast_channel_snapshot_caller | 
| Structure containing caller information for a channel snapshot.  More... | |
| struct | ast_channel_snapshot_connected | 
| Structure containing connected information for a channel snapshot.  More... | |
| struct | ast_channel_snapshot_dialplan | 
| Structure containing dialplan information for a channel snapshot.  More... | |
| struct | ast_channel_snapshot_hangup | 
| Structure containing hangup information for a channel snapshot.  More... | |
| struct | ast_channel_snapshot_peer | 
| Structure containing peer information for a channel snapshot.  More... | |
| struct | ast_channel_snapshot_update | 
| Structure representing a change of snapshot of channel state.  More... | |
| Enumerations | |
| enum | ast_channel_snapshot_segment_invalidation { AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE = (1 << 1) , AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN = (1 << 2) , AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED = (1 << 3) , AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER = (1 << 4) , AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP = (1 << 5) , AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER = (1 << 6) , AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE = (1 << 7) } | 
| Channel snapshot invalidation flags, used to force generation of segments.  More... | |
| Functions | |
| struct ast_ari_transfer_message * | ast_ari_transfer_message_create (struct ast_channel *originating_chan, const char *referred_by, const char *exten, const char *protocol_id, struct ast_channel *dest, struct ast_refer_params *params, enum ast_control_transfer) | 
| struct stasis_message_type * | ast_channel_agent_login_type (void) | 
| Message type for agent login on a channel. | |
| struct stasis_message_type * | ast_channel_agent_logoff_type (void) | 
| Message type for agent logoff on a channel. | |
| 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. | |
| 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 ao2_container * | ast_channel_cache_all (void) | 
| struct ao2_container * | ast_channel_cache_by_name (void) | 
| Secondary channel cache, indexed by name. | |
| struct stasis_message_type * | ast_channel_chanspy_start_type (void) | 
| Message type for when a channel starts spying on another channel. | |
| struct stasis_message_type * | ast_channel_chanspy_stop_type (void) | 
| Message type for when a channel stops spying on another channel. | |
| struct stasis_message_type * | ast_channel_dial_type (void) | 
| Message type for when a channel dials another channel. | |
| struct stasis_message_type * | ast_channel_dtmf_begin_type (void) | 
| Message type for when DTMF begins on a channel. | |
| struct stasis_message_type * | ast_channel_dtmf_end_type (void) | 
| Message type for when DTMF ends on a channel. | |
| struct stasis_message_type * | ast_channel_fax_type (void) | 
| Message type for a fax operation. | |
| struct stasis_message_type * | ast_channel_flash_type (void) | 
| Message type for when a hook flash occurs on a channel. | |
| struct stasis_message_type * | ast_channel_hangup_handler_type (void) | 
| Message type for hangup handler related actions. | |
| struct stasis_message_type * | ast_channel_hangup_request_type (void) | 
| Message type for when a hangup is requested on a channel. | |
| struct stasis_message_type * | ast_channel_hold_type (void) | 
| Message type for when a channel is placed on hold. | |
| struct stasis_message_type * | ast_channel_masquerade_type (void) | 
| Message type for when a channel is being masqueraded. | |
| struct stasis_message_type * | ast_channel_mixmonitor_mute_type (void) | 
| Message type for muting or unmuting mixmonitor on a channel. | |
| struct stasis_message_type * | ast_channel_mixmonitor_start_type (void) | 
| Message type for starting mixmonitor on a channel. | |
| struct stasis_message_type * | ast_channel_mixmonitor_stop_type (void) | 
| Message type for stopping mixmonitor on a channel. | |
| struct stasis_message_type * | ast_channel_moh_start_type (void) | 
| Message type for starting music on hold on a channel. | |
| struct stasis_message_type * | ast_channel_moh_stop_type (void) | 
| Message type for stopping music on hold on a channel. | |
| void | ast_channel_publish_blob (struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob) | 
| Publish a channel blob message. | |
| 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 involved in a dial operation. | |
| 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 involved in a dial operation that is forwarded. | |
| void | ast_channel_publish_final_snapshot (struct ast_channel *chan) | 
| Send the final channel snapshot for a channel, thus removing it from cache. | |
| void | ast_channel_publish_snapshot (struct ast_channel *chan) | 
| Publish a ast_channel_snapshot for a channel. | |
| void | ast_channel_publish_varset (struct ast_channel *chan, const char *variable, const char *value) | 
| Publish a ast_channel_publish_varset for a channel. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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, so use ao2_cleanup() to deallocate. | |
| 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, so use ao2_cleanup() to deallocate. | |
| 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. | |
| 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 stasis_message_type * | ast_channel_snapshot_type (void) | 
| Message type for ast_channel_snapshot_update. | |
| void | ast_channel_stage_snapshot (struct ast_channel *chan) | 
| Set flag to indicate channel snapshot is being staged. | |
| void | ast_channel_stage_snapshot_done (struct ast_channel *chan) | 
| Clear flag to indicate channel snapshot is being staged, and publish snapshot. | |
| struct stasis_message_type * | ast_channel_talking_start (void) | 
| Message type for a channel starting talking. | |
| struct stasis_message_type * | ast_channel_talking_stop (void) | 
| Message type for a channel stopping talking. | |
| struct stasis_message_type * | ast_channel_tone_detect (void) | 
| Message type for a channel tone detection. | |
| struct stasis_topic * | ast_channel_topic_all (void) | 
| A topic which publishes the events for all channels. | |
| struct stasis_message_type * | ast_channel_transfer_request_type (void) | 
| struct stasis_message_type * | ast_channel_unhold_type (void) | 
| Message type for when a channel is removed from hold. | |
| 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_wink_type (void) | 
| Message type for when a wink occurs on a channel. | |
| 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. | |
| 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 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 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. | |
| 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_stasis_channels_init (void) | 
| Initialize the stasis channel topic and message types. | |
| struct ast_ari_transfer_message * ast_ari_transfer_message_create | ( | struct ast_channel * | originating_chan, | 
| const char * | referred_by, | ||
| const char * | exten, | ||
| const char * | protocol_id, | ||
| struct ast_channel * | dest, | ||
| struct ast_refer_params * | params, | ||
| enum | ast_control_transfer | ||
| ) | 
Definition at line 1772 of file stasis_channels.c.
References ao2_alloc, ao2_bump, ao2_cleanup, ao2_ref, ari_transfer_dtor(), ast_channel_lock, ast_channel_unlock, ast_copy_string(), ast_strdup, ast_ari_transfer_message::dest, ast_ari_transfer_message::destination, NULL, ast_ari_transfer_message::protocol_id, ast_ari_transfer_message::refer_params, ast_ari_transfer_message::referred_by, ast_ari_transfer_message::source, and ast_ari_transfer_message::state.
Referenced by ast_refer_notify_transfer_request().
| 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.
| old_snapshot | Old snapshot | 
| new_snapshot | New snapshot | 
| True | (non-zero) if callerid are identical. | 
| False | (zero) if callerid changed. | 
Definition at line 1383 of file stasis_channels.c.
References ast_assert, ast_channel_snapshot::caller, ast_channel_snapshot_caller::name, NULL, and ast_channel_snapshot_caller::number.
Referenced by channel_callerid(), and channel_new_callerid().
| 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.
| old_snapshot | Old snapshot | 
| new_snapshot | New snapshot | 
| True | (non-zero) if context, exten or priority are identical. | 
| False | (zero) if context, exten and priority changed. | 
Definition at line 1362 of file stasis_channels.c.
References ast_channel_snapshot_dialplan::appl, ast_assert, ast_strlen_zero(), ast_channel_snapshot_dialplan::context, ast_channel_snapshot::dialplan, ast_channel_snapshot_dialplan::exten, NULL, and ast_channel_snapshot_dialplan::priority.
Referenced by channel_dialplan(), and channel_newexten().
| 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.
| old_snapshot | Old snapshot | 
| new_snapshot | New snapshot | 
| True | (non-zero) if callerid are identical. | 
| False | (zero) if callerid changed. | 
Definition at line 1393 of file stasis_channels.c.
References ast_assert, ast_channel_snapshot::connected, ast_channel_snapshot_connected::name, NULL, and ast_channel_snapshot_connected::number.
Referenced by channel_connected_line(), and channel_new_connected_line().
| 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.
| snapshot | The snapshot to convert to JSON | 
| sanitize | The message sanitizer to use on the snapshot | 
| NULL | on error | 
Definition at line 1311 of file stasis_channels.c.
References ast_channel_snapshot_base::accountcode, ast_channel_snapshot_dialplan::appl, ast_channel_snapshot::ari_vars, ast_json_channel_vars(), ast_json_dialplan_cep_app(), ast_json_name_number(), ast_json_object_set(), ast_json_pack(), ast_json_string_create(), ast_json_timeval(), AST_LIST_EMPTY, ast_state2str(), ast_strlen_zero(), ast_channel_snapshot::base, ast_channel_snapshot::caller, stasis_message_sanitizer::channel_snapshot, ast_channel_snapshot::connected, ast_channel_snapshot_dialplan::context, ast_channel_snapshot_base::creationtime, ast_channel_snapshot_dialplan::data, ast_channel_snapshot::dialplan, ast_channel_snapshot_dialplan::exten, ast_channel_snapshot_base::language, ast_channel_snapshot_caller::name, ast_channel_snapshot_connected::name, ast_channel_snapshot_base::name, NULL, ast_channel_snapshot_caller::number, ast_channel_snapshot_connected::number, ast_channel_snapshot_dialplan::priority, ast_channel_snapshot_caller::rdnis, ast_channel_snapshot::state, ast_channel_snapshot_base::tenantid, and ast_channel_snapshot_base::uniqueid.
Referenced by ari_channels_handle_originate_with_id(), ari_channels_handle_snoop_channel(), ari_transfer_to_json(), ast_ari_channels_create(), ast_ari_channels_get(), ast_ari_channels_list(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), attended_transfer_to_json(), blind_transfer_to_json(), channel_blob_to_json(), channel_callerid(), channel_connected_line(), channel_destroyed_event(), channel_dialplan(), channel_to_json(), dial_to_json(), dtmf_end_to_json(), hold_to_json(), multi_user_event_to_json(), rtcp_report_to_json(), simple_bridge_channel_event(), simple_channel_event(), stasis_app_exec(), stasis_end_to_json(), stasis_start_to_json(), and unhold_to_json().
| int ast_stasis_channels_init | ( | void | ) | 
Initialize the stasis channel topic and message types.
| 0 | on success | 
| Non-zero | on error | 
Definition at line 1922 of file stasis_channels.c.
References AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_container_alloc_hash, ast_channel_agent_login_type(), ast_channel_agent_logoff_type(), ast_channel_chanspy_start_type(), ast_channel_chanspy_stop_type(), ast_channel_dial_type(), ast_channel_dtmf_begin_type(), ast_channel_dtmf_end_type(), ast_channel_fax_type(), ast_channel_flash_type(), ast_channel_hangup_handler_type(), ast_channel_hangup_request_type(), ast_channel_hold_type(), ast_channel_masquerade_type(), ast_channel_mixmonitor_mute_type(), ast_channel_mixmonitor_start_type(), ast_channel_mixmonitor_stop_type(), ast_channel_moh_start_type(), ast_channel_moh_stop_type(), ast_channel_snapshot_type(), ast_channel_talking_start(), ast_channel_talking_stop(), ast_channel_tone_detect(), ast_channel_transfer_request_type(), ast_channel_unhold_type(), ast_channel_varset_type(), ast_channel_wink_type(), AST_NUM_CHANNEL_BUCKETS, ast_register_cleanup(), channel_cache, channel_cache_by_name, channel_snapshot_cmp_cb(), channel_snapshot_hash_cb(), channel_snapshot_uniqueid_cmp_cb(), channel_snapshot_uniqueid_hash_cb(), channel_topic_all, NULL, stasis_channels_cleanup(), STASIS_MESSAGE_TYPE_INIT, and stasis_topic_create().
Referenced by ast_channels_init().