Stasis topics, and their messages.


Data Structures

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_endpoint_blob
 Blob of data associated with an endpoint. More...
struct  ast_endpoint_snapshot
 A snapshot of an endpoint's state. More...
struct  ast_mwi_blob
 Object that represents an MWI update with some additional application defined data. More...
struct  ast_mwi_state
 The structure that contains MWI state. More...
struct  stasis_cache_update
 Cache update message. More...
struct  stasis_subscription_change
 Holds details about changes to subscriptions for the specified topic. More...
enum  stasis_user_multi_object_snapshot_type { STASIS_UMOS_CHANNEL = 0, STASIS_UMOS_BRIDGE, STASIS_UMOS_ENDPOINT }
 Object type code for multi user object snapshots. More...
typedef struct stasis_message *(* cache_aggregate_calc_fn )(struct stasis_cache_entry *entry, struct stasis_message *new_snapshot)
 Callback to calculate the aggregate cache entry.
typedef void(* cache_aggregate_publish_fn )(struct stasis_topic *topic, struct stasis_message *aggregate)
 Callback to publish the aggregate cache entry message.
typedef const char *(* snapshot_get_id )(struct stasis_message *message)
 Callback extract a unique identity from a snapshot message.
void ast_multi_object_blob_add (struct ast_multi_object_blob *multi, enum stasis_user_multi_object_snapshot_type type, void *object)
 Add an object to a multi object blob previously created.
struct ast_multi_object_blobast_multi_object_blob_create (struct ast_json *blob)
 Create a stasis multi object blob.
void ast_multi_object_blob_single_channel_publish (struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
 Create and publish a stasis message blob on a channel with it's snapshot.
struct stasis_message_typeast_multi_user_event_type (void)
 Message type for custom user defined events with multi object blobs.
struct stasis_messagestasis_cache_clear_create (struct stasis_message *message)
 A message which instructs the caching topic to remove an entry from its cache.
struct stasis_cachestasis_cache_create (snapshot_get_id id_fn)
 Create a cache.
struct stasis_cachestasis_cache_create_full (snapshot_get_id id_fn, cache_aggregate_calc_fn aggregate_calc_fn, cache_aggregate_publish_fn aggregate_publish_fn)
 Create a cache.
struct ao2_containerstasis_cache_dump (struct stasis_cache *cache, struct stasis_message_type *type)
 Dump cached items to a subscription for the ast_eid_default entity.
struct ao2_containerstasis_cache_dump_all (struct stasis_cache *cache, struct stasis_message_type *type)
 Dump all entity items from the cache to a subscription.
struct ao2_containerstasis_cache_dump_by_eid (struct stasis_cache *cache, struct stasis_message_type *type, const struct ast_eid *eid)
 Dump cached items to a subscription for a specific entity.
struct stasis_messagestasis_cache_entry_get_aggregate (struct stasis_cache_entry *entry)
 Get the aggregate cache entry snapshot.
struct stasis_messagestasis_cache_entry_get_local (struct stasis_cache_entry *entry)
 Get the local entity's cache entry snapshot.
struct stasis_messagestasis_cache_entry_get_remote (struct stasis_cache_entry *entry, int idx)
 Get a remote entity's cache entry snapshot by index.
struct stasis_messagestasis_cache_get (struct stasis_cache *cache, struct stasis_message_type *type, const char *id)
 Retrieve an item from the cache for the ast_eid_default entity.
struct ao2_containerstasis_cache_get_all (struct stasis_cache *cache, struct stasis_message_type *type, const char *id)
 Retrieve all matching entity items from the cache.
struct stasis_messagestasis_cache_get_by_eid (struct stasis_cache *cache, struct stasis_message_type *type, const char *id, const struct ast_eid *eid)
 Retrieve an item from the cache for a specific entity.
struct stasis_topicstasis_caching_get_topic (struct stasis_caching_topic *caching_topic)
 Returns the topic of cached events from a caching topics.
struct stasis_caching_topicstasis_caching_topic_create (struct stasis_topic *original_topic, struct stasis_cache *cache)
 Create a topic which monitors and caches messages from another topic.
struct stasis_caching_topicstasis_caching_unsubscribe (struct stasis_caching_topic *caching_topic)
 Unsubscribes a caching topic from its upstream topic.
struct stasis_caching_topicstasis_caching_unsubscribe_and_join (struct stasis_caching_topic *caching_topic)
 Unsubscribes a caching topic from its upstream topic, blocking until all messages have been forwarded.
#define STASIS_UMOS_MAX   (STASIS_UMOS_ENDPOINT + 1)
 Number of snapshot types.
int stasis_cache_init (void)
int stasis_config_init (void)
int stasis_init (void)
 Initialize the Stasis subsystem.
void stasis_log_bad_type_access (const char *name)
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
 Boiler-plate messaging macro for cleaning up message types.
#define STASIS_MESSAGE_TYPE_DEFN(name,...)
 Boiler-plate messaging macro for defining public message types.
#define STASIS_MESSAGE_TYPE_DEFN_LOCAL(name,...)
 Boiler-plate messaging macro for defining local message types.
#define STASIS_MESSAGE_TYPE_INIT(name)
 Boiler-plate messaging macro for initializing message types.
struct stasis_message_typestasis_subscription_change_type (void)
 Gets the message type for subscription change notices.
struct stasis_topic_poolstasis_topic_pool_create (struct stasis_topic *pooled_topic)
 Create a topic pool that routes messages from dynamically generated topics to the given topic.
struct stasis_topicstasis_topic_pool_get_topic (struct stasis_topic_pool *pool, const char *topic_name)
 Find or create a topic in the pool.

Functions

struct stasis_message_typeast_channel_agent_login_type (void)
 Message type for agent login on a channel.
struct stasis_message_typeast_channel_agent_logoff_type (void)
 Message type for agent logoff on a channel.
struct stasis_messageast_channel_blob_create (struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
 Creates a ast_channel_blob message.
struct stasis_messageast_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_cacheast_channel_cache (void)
 Primary channel cache, indexed by Uniqueid.
struct stasis_cp_allast_channel_cache_all (void)
struct stasis_cacheast_channel_cache_by_name (void)
 Secondary channel cache, indexed by name.
struct stasis_message_typeast_channel_chanspy_start_type (void)
 Message type for when a channel starts spying on another channel.
struct stasis_message_typeast_channel_chanspy_stop_type (void)
 Message type for when a channel stops spying on another channel.
struct stasis_message_typeast_channel_dial_type (void)
 Message type for when a channel dials another channel.
struct stasis_message_typeast_channel_dtmf_begin_type (void)
 Message type for when DTMF begins on a channel.
struct stasis_message_typeast_channel_dtmf_end_type (void)
 Message type for when DTMF ends on a channel.
struct stasis_message_typeast_channel_fax_type (void)
 Message type for a fax operation.
struct stasis_message_typeast_channel_hangup_handler_type (void)
 Message type for hangup handler related actions.
struct stasis_message_typeast_channel_hangup_request_type (void)
 Message type for when a hangup is requested on a channel.
struct stasis_message_typeast_channel_hold_type (void)
 Message type for when a channel is placed on hold.
struct stasis_message_typeast_channel_moh_start_type (void)
 Message type for starting music on hold on a channel.
struct stasis_message_typeast_channel_moh_stop_type (void)
 Message type for stopping music on hold on a channel.
struct stasis_message_typeast_channel_monitor_start_type (void)
 Message type for starting monitor on a channel.
struct stasis_message_typeast_channel_monitor_stop_type (void)
 Message type for stopping monitor 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_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_varset for a channel.
struct ast_channel_snapshotast_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_snapshotast_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_snapshotast_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.
struct stasis_message_typeast_channel_snapshot_type (void)
 Message type for ast_channel_snapshot.
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_typeast_channel_talking_start (void)
 Message type for a channel starting talking.
struct stasis_message_typeast_channel_talking_stop (void)
 Message type for a channel stopping talking.
struct stasis_topicast_channel_topic_all (void)
 A topic which publishes the events for all channels.
struct stasis_topicast_channel_topic_all_cached (void)
 A caching topic which caches ast_channel_snapshot messages from ast_channel_events_all(void).
struct stasis_message_typeast_channel_unhold_type (void)
 Message type for when a channel is removed from hold.
struct stasis_message_typeast_channel_varset_type (void)
 Message type for when a variable is set on a channel.
struct stasis_messageast_endpoint_blob_create (struct ast_endpoint *endpoint, struct stasis_message_type *type, struct ast_json *blob)
 Creates a ast_endpoint_blob message.
void ast_endpoint_blob_publish (struct ast_endpoint *endpoint, struct stasis_message_type *type, struct ast_json *blob)
 Creates and publishes a ast_endpoint_blob message.
struct stasis_cacheast_endpoint_cache (void)
 Backend cache for ast_endpoint_topic_all_cached().
struct stasis_cp_allast_endpoint_cache_all (void)
struct ast_endpoint_snapshotast_endpoint_latest_snapshot (const char *tech, const char *resource)
 Retrieve the most recent snapshot for the endpoint with the given name.
struct ast_endpoint_snapshotast_endpoint_snapshot_create (struct ast_endpoint *endpoint)
 Create a snapshot of an endpoint.
struct stasis_message_typeast_endpoint_snapshot_type (void)
 Message type for ast_endpoint_snapshot.
struct stasis_message_typeast_endpoint_state_type (void)
 Message type for endpoint state changes.
struct stasis_topicast_endpoint_topic (struct ast_endpoint *endpoint)
 Returns the topic for a specific endpoint.
struct stasis_topicast_endpoint_topic_all (void)
 Topic for all endpoint releated messages.
struct stasis_topicast_endpoint_topic_all_cached (void)
 Cached topic for all endpoint related messages.
struct stasis_topicast_endpoint_topic_cached (struct ast_endpoint *endpoint)
 Returns the topic for a specific endpoint.
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_blobast_multi_channel_blob_create (struct ast_json *blob)
 Create a ast_multi_channel_blob suitable for a stasis_message.
struct ast_channel_snapshotast_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_containerast_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_jsonast_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.
struct stasis_messageast_mwi_blob_create (struct ast_mwi_state *mwi_state, struct stasis_message_type *message_type, struct ast_json *blob)
 Creates a ast_mwi_blob message.
struct ast_mwi_stateast_mwi_create (const char *mailbox, const char *context)
 Create a ast_mwi_state object.
struct stasis_cacheast_mwi_state_cache (void)
 Backend cache for ast_mwi_topic_cached().
struct stasis_message_typeast_mwi_state_type (void)
 Get the Stasis Message Bus API message type for MWI messages.
struct stasis_topicast_mwi_topic (const char *uniqueid)
 Get the Stasis Message Bus API topic for MWI messages on a unique ID.
struct stasis_topicast_mwi_topic_all (void)
 Get the Stasis Message Bus API topic for MWI messages.
struct stasis_topicast_mwi_topic_cached (void)
 Get the Stasis Message Bus API caching topic for MWI messages.
struct stasis_message_typeast_mwi_vm_app_type (void)
 Get the Stasis Message Bus API message type for voicemail application specific messages.
struct stasis_message_typeast_parked_call_type (void)
 accessor for the parked call stasis message type
struct stasis_topicast_parking_topic (void)
 accessor for the parking stasis topic
void ast_publish_channel_state (struct ast_channel *chan)
 Publish in the ast_channel_topic a ast_channel_snapshot message indicating a change in channel state.
struct stasis_topicast_queue_topic (const char *queuename)
 Get the Stasis Message Bus API topic for queue messages for a particular queue name.
struct stasis_topicast_queue_topic_all (void)
 Get the Stasis Message Bus API topic for queue messages.
struct stasis_message_typeast_rtp_rtcp_received_type (void)
 Message type for an RTCP message received from some external source.
struct stasis_message_typeast_rtp_rtcp_sent_type (void)
 Message type for an RTCP message sent from this Asterisk instance.
struct stasis_topicast_rtp_topic (void)
 Stasis Message Bus API topic for RTP and RTCP related messages
struct stasis_message_typestasis_cache_clear_type (void)
 Message type for clearing a message from a stasis cache.
struct stasis_message_typestasis_cache_update_type (void)
 Message type for cache update messages.
struct stasis_messagestasis_test_message_create (void)
 Creates a test message.
struct stasis_message_typestasis_test_message_type (void)
 Gets the type of messages created by stasis_test_message_create().

Variables

struct ast_string_field_mgr __field_mgr
int(* activate )(struct ast_rtp_instance *instance)
int(* active )(struct ast_rtp_instance *instance)
void(* add_remote_candidate )(struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate)
struct ast_sockaddr address
int(* allow_rtp_remote )(struct ast_channel *chan1, struct ast_rtp_instance *instance)
 Used to prevent two channels from remotely bridging audio rtp if the channel tech has a reason for prohibiting it based on qualities that need to be compared from both channels.
int(* allow_vrtp_remote )(struct ast_channel *chan1, struct ast_rtp_instance *instance)
 Used to prevent two channels from remotely bridging video rtp if the channel tech has a reason for prohibiting it based on qualities that need to be compared from both channels.
void(* available_formats )(struct ast_rtp_instance *instance, struct ast_format_cap *to_endpoint, struct ast_format_cap *to_asterisk, struct ast_format_cap *result)
char * cafile
char * capath
char * certfile
void(* change_source )(struct ast_rtp_instance *instance)
int(* channel )(const struct ast_channel *chan)
 Callback which determines whether a channel should be sanitized from a message based on the channel.
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 snapshot.
char channel_uniqueid [MAX_CHANNEL_ID]
char * cipher
ast_rwlock_t codecs_lock
enum ast_rtp_dtls_setup default_setup
const ast_string_field description
int(* destroy )(struct ast_rtp_instance *instance)
unsigned int dlsr
struct ast_rtp_engine_dtlsdtls
int(* dtmf_begin )(struct ast_rtp_instance *instance, char digit)
int(* dtmf_compatible )(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1)
int(* dtmf_end )(struct ast_rtp_instance *instance, char digit)
int(* dtmf_end_with_duration )(struct ast_rtp_instance *instance, char digit, unsigned int duration)
enum ast_rtp_dtmf_mode(* dtmf_mode_get )(struct ast_rtp_instance *instance)
int(* dtmf_mode_set )(struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode)
struct {
   struct ast_rtp_glue *   next
entry
struct {
   struct ast_rtp_engine *   next
entry
void *(* extended_prop_get )(struct ast_rtp_instance *instance, int property)
int(* extended_prop_set )(struct ast_rtp_instance *instance, int property, void *value)
int(* fd )(struct ast_rtp_instance *instance, int rtcp)
struct ast_formatformat
unsigned int framing
void(* get_codec )(struct ast_channel *chan, struct ast_format_cap *result_cap)
enum ast_rtp_dtls_connection(* get_connection )(struct ast_rtp_instance *instance)
const char *(* get_fingerprint )(struct ast_rtp_instance *instance)
enum ast_rtp_dtls_hash(* get_fingerprint_hash )(struct ast_rtp_instance *instance)
struct ao2_container *(* get_local_candidates )(struct ast_rtp_instance *instance)
const char *(* get_password )(struct ast_rtp_instance *instance)
enum ast_rtp_glue_result(* get_rtp_info )(struct ast_channel *chan, struct ast_rtp_instance **instance)
 Callback for retrieving the RTP instance carrying audio.
enum ast_rtp_dtls_setup(* get_setup )(struct ast_rtp_instance *instance)
int(* get_stat )(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat)
enum ast_rtp_glue_result(* get_trtp_info )(struct ast_channel *chan, struct ast_rtp_instance **instance)
 Callback for retrieving the RTP instance carrying text.
const char *(* get_ufrag )(struct ast_rtp_instance *instance)
enum ast_rtp_glue_result(* get_vrtp_info )(struct ast_channel *chan, struct ast_rtp_instance **instance)
 Callback for retrieving the RTP instance carrying video.
enum ast_rtp_dtls_hash hash
unsigned int highest_seq_no
unsigned int ia_jitter
struct ast_rtp_engine_iceice
void(* ice_lite )(struct ast_rtp_instance *instance)
enum ast_rtp_ice_component_type id
int(* local_bridge )(struct ast_rtp_instance *instance0, struct ast_rtp_instance *instance1)
double local_maxjitter
double local_maxrxploss
double local_minjitter
double local_minrxploss
double local_normdevjitter
double local_normdevrxploss
unsigned int local_ssrc
double local_stdevjitter
double local_stdevrxploss
struct {
   unsigned short   fraction
   unsigned int   packets
lost_count
unsigned int lsr
int(* make_compatible )(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1)
double maxrtt
double minrtt
struct ast_modulemod
struct ast_modulemod
int(* new )(struct ast_rtp_instance *instance, struct ast_sched_context *sched, struct ast_sockaddr *sa, void *data)
struct stasis_messagenew_snapshot
 New value.
double normdevrtt
unsigned int   octet_count
struct stasis_messageold_snapshot
 Old value from the cache.
unsigned int   packet_count
unsigned int   packets
int payload
void(* payload_set )(struct ast_rtp_instance *instance, int payload, int asterisk_format, struct ast_format *format, int code)
int priority
void(* prop_set )(struct ast_rtp_instance *instance, enum ast_rtp_property property, int value)
char * pvtfile
int(* qos )(struct ast_rtp_instance *instance, int tos, int cos, const char *desc)
struct ast_frame *(* read )(struct ast_rtp_instance *instance, int rtcp)
int(* red_buffer )(struct ast_rtp_instance *instance, struct ast_frame *frame)
int(* red_init )(struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations)
unsigned int rekey
struct ast_sockaddr relay_address
void(* remote_address_set )(struct ast_rtp_instance *instance, struct ast_sockaddr *sa)
double remote_maxjitter
double remote_maxrxploss
double remote_minjitter
double remote_minrxploss
double remote_normdevjitter
double remote_normdevrxploss
unsigned int remote_ssrc
double remote_stdevjitter
double remote_stdevrxploss
struct ast_rtp_rtcp_report_blockreport_block [0]
void(* reset )(struct ast_rtp_instance *instance)
int rtp_code
unsigned int   rtp_timestamp
double rtt
unsigned int rxcount
double rxjitter
unsigned int rxploss
int(* sendcng )(struct ast_rtp_instance *instance, int level)
struct {
   struct timeval   ntp_timestamp
   unsigned int   octet_count
   unsigned int   packet_count
   unsigned int   rtp_timestamp
sender_information
void(* set_fingerprint )(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint)
int(* set_read_format )(struct ast_rtp_instance *instance, struct ast_format *format)
void(* set_role )(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role)
void(* set_setup )(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup)
int(* set_write_format )(struct ast_rtp_instance *instance, struct ast_format *format)
unsigned int ssrc
void(* start )(struct ast_rtp_instance *instance)
double stdevrtt
void(* stop )(struct ast_rtp_instance *instance)
void(* stop )(struct ast_rtp_instance *instance)
void(* stop )(struct ast_rtp_instance *instance)
void(* stun_request )(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username)
enum ast_srtp_suite suite
struct ast_manager_event_blob *(* to_ami )(struct stasis_message *message)
 Build the AMI representation of the message.
struct ast_event *(* to_event )(struct stasis_message *message)
 Build the ast_event representation of the message.
struct stasis_topictopic
char * transport
void(* turn_request )(struct ast_rtp_instance *instance, enum ast_rtp_ice_component_type component, enum ast_transport transport, const char *server, unsigned int port, const char *username, const char *password)
double txjitter
unsigned int txploss
enum ast_rtp_ice_candidate_type type
unsigned int type
const ast_string_field uniqueid
int(* update_peer )(struct ast_channel *chan, struct ast_rtp_instance *instance, struct ast_rtp_instance *vinstance, struct ast_rtp_instance *tinstance, const struct ast_format_cap *cap, int nat_active)
void(* update_source )(struct ast_rtp_instance *instance)
enum ast_rtp_dtls_verify verify
int(* write )(struct ast_rtp_instance *instance, struct ast_frame *frame)

Detailed Description

This group contains the topics, messages and corresponding message types found within Asterisk.

Define Documentation

#define STASIS_MESSAGE_TYPE_CLEANUP ( name   ) 

Value:

({             \
      ao2_cleanup(_priv_ ## name);  \
      _priv_ ## name = NULL;     \
   })
Boiler-plate messaging macro for cleaning up message types.

Note that if your type is defined in core instead of a loadable module, you should call message type cleanup from an ast_register_cleanup() handler instead of an ast_register_atexit() handler.

The reason is that during an immediate shutdown, loadable modules (which may refer to core message types) are not unloaded. While the atexit handlers are run, there's a window of time where a module subscription might reference a core message type after it's been cleaned up. Which is bad.

Parameters:
name Name of message type.
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 1264 of file stasis.h.

Referenced by __unload_module(), aoc_shutdown(), app_cleanup(), cdr_engine_shutdown(), cel_engine_cleanup(), cleanup_module(), devstate_cleanup(), endpoints_stasis_cleanup(), file_shutdown(), local_shutdown(), manager_confbridge_shutdown(), manager_shutdown(), meetme_stasis_cleanup(), named_acl_cleanup(), parking_stasis_cleanup(), pickup_shutdown(), presence_state_engine_cleanup(), rtp_engine_shutdown(), security_stasis_cleanup(), stasis_bridging_cleanup(), stasis_cache_cleanup(), stasis_channels_cleanup(), stasis_cleanup(), stasis_system_cleanup(), and unload_module().

#define STASIS_MESSAGE_TYPE_DEFN ( name,
...   ) 

Boiler-plate messaging macro for defining public message types.

   STASIS_MESSAGE_TYPE_DEFN(ast_foo_type,
      .to_ami = foo_to_ami,
      .to_json = foo_to_json,
      .to_event = foo_to_event,
      );

Parameters:
name Name of message type.
... Virtual table methods for messages of this type.
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 1189 of file stasis.h.

#define STASIS_MESSAGE_TYPE_DEFN_LOCAL ( name,
...   ) 

Boiler-plate messaging macro for defining local message types.

   STASIS_MESSAGE_TYPE_DEFN_LOCAL(ast_foo_type,
      .to_ami = foo_to_ami,
      .to_json = foo_to_json,
      .to_event = foo_to_event,
      );

Parameters:
name Name of message type.
... Virtual table methods for messages of this type.
Since:
12

Definition at line 1216 of file stasis.h.

#define STASIS_MESSAGE_TYPE_INIT ( name   ) 

#define STASIS_UMOS_MAX   (STASIS_UMOS_ENDPOINT + 1)

Number of snapshot types.

Definition at line 1103 of file stasis.h.

Referenced by ast_multi_object_blob_create(), multi_object_blob_to_ami(), and multi_user_event_to_json().


Typedef Documentation

typedef struct stasis_message*(* cache_aggregate_calc_fn)(struct stasis_cache_entry *entry, struct stasis_message *new_snapshot)

Callback to calculate the aggregate cache entry.

Since:
12.2.0
Parameters:
entry Cache entry to calculate a new aggregate snapshot.
new_snapshot The shapshot that is being updated.
Note:
Return a ref bumped pointer from stasis_cache_entry_get_aggregate() if a new aggregate could not be calculated because of error.

An aggregate message is a combined representation of the local and remote entities publishing the message data. e.g., An aggregate device state represents the combined device state from the local and any remote entities publishing state for a device. e.g., An aggregate MWI message is the old/new MWI counts accumulated from the local and any remote entities publishing to a mailbox.

Returns:
New aggregate-snapshot calculated on success. Caller has a reference on return.

Definition at line 811 of file stasis.h.

typedef void(* cache_aggregate_publish_fn)(struct stasis_topic *topic, struct stasis_message *aggregate)

Callback to publish the aggregate cache entry message.

Since:
12.2.0
Once an aggregate message is calculated. This callback publishes the message so subscribers will know the new value of an aggregated state.

Parameters:
topic The aggregate message may be published to this topic. It is the topic to which the cache itself is subscribed.
aggregate The aggregate shapshot message to publish.
Note:
It is up to the function to determine if there is a better topic the aggregate message should be published over.

An aggregate message is a combined representation of the local and remote entities publishing the message data. e.g., An aggregate device state represents the combined device state from the local and any remote entities publishing state for a device. e.g., An aggregate MWI message is the old/new MWI counts accumulated from the local and any remote entities publishing to a mailbox.

Returns:
Nothing

Definition at line 837 of file stasis.h.

typedef const char*(* snapshot_get_id)(struct stasis_message *message)

Callback extract a unique identity from a snapshot message.

This identity is unique to the underlying object of the snapshot, such as the UniqueId field of a channel.

Parameters:
message Message to extract id from.
Returns:
String representing the snapshot's id.

NULL if the message_type of the message isn't a handled snapshot.

Since:
12

Definition at line 789 of file stasis.h.


Enumeration Type Documentation

Object type code for multi user object snapshots.

Enumerator:
STASIS_UMOS_CHANNEL  Channel Snapshots
STASIS_UMOS_BRIDGE  Bridge Snapshots
STASIS_UMOS_ENDPOINT  Endpoint Snapshots

Definition at line 1096 of file stasis.h.

01096                                             {
01097    STASIS_UMOS_CHANNEL = 0,     /*!< Channel Snapshots */
01098    STASIS_UMOS_BRIDGE,          /*!< Bridge Snapshots */
01099    STASIS_UMOS_ENDPOINT,        /*!< Endpoint Snapshots */
01100 };


Function Documentation

struct stasis_message_type* ast_channel_agent_login_type ( void   )  [read]

Message type for agent login on a channel.

Since:
12.0.0
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), load_module(), queue_agent_cb(), send_agent_login(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_agent_logoff_type ( void   )  [read]

Message type for agent logoff on a channel.

Since:
12.0.0
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), load_module(), queue_agent_cb(), send_agent_logoff(), and stasis_channels_cleanup().

struct stasis_message* ast_channel_blob_create ( struct ast_channel chan,
struct stasis_message_type type,
struct ast_json blob 
) [read]

Creates a ast_channel_blob message.

Since:
12 The given blob should be treated as immutable and not modified after it is put into the message.
Precondition:
chan is locked
Parameters:
chan Channel blob is associated with, or NULL for global/all channels.
type Message type for this blob.
blob JSON object representing the data, or NULL for no data. If NULL, ast_json_null() is put into the object.
Returns:
ast_channel_blob message.

NULL on error

Definition at line 463 of file stasis_channels.c.

References ao2_cleanup, ast_channel_snapshot_create(), create_channel_blob_message(), NULL, and RAII_VAR.

Referenced by app_send_end_msg(), ast_channel_publish_blob(), AST_TEST_DEFINE(), and meetme_stasis_generate_msg().

00465 {
00466    RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
00467 
00468    if (!type) {
00469       return NULL;
00470    }
00471 
00472    if (chan) {
00473       snapshot = ast_channel_snapshot_create(chan);
00474    }
00475 
00476    return create_channel_blob_message(snapshot, type, blob);
00477 }

struct stasis_message* ast_channel_blob_create_from_cache ( const char *  uniqueid,
struct stasis_message_type type,
struct ast_json blob 
) [read]

Create a ast_channel_blob message, pulling channel state from the cache.

Since:
12
Parameters:
uniqueid Uniqueid of the channel.
type Message type for this blob.
blob JSON object representing the data, or NULL for no data. If NULL, ast_json_null() is put into the object.
Returns:
ast_channel_blob message.

NULL on error

Definition at line 446 of file stasis_channels.c.

References ao2_cleanup, ast_channel_snapshot_get_latest(), create_channel_blob_message(), NULL, and RAII_VAR.

Referenced by ast_cel_publish_event(), ast_channel_publish_cached_blob(), ast_monitor_start(), ast_monitor_stop(), moh_post_start(), moh_post_stop(), phase_e_handler(), playback_publish(), recording_publish(), report_fax_status(), report_receive_fax_status(), report_send_fax_status(), and talk_detect_audiohook_cb().

00449 {
00450    RAII_VAR(struct ast_channel_snapshot *, snapshot,
00451          NULL,
00452          ao2_cleanup);
00453 
00454    if (!type) {
00455       return NULL;
00456    }
00457 
00458    snapshot = ast_channel_snapshot_get_latest(channel_id);
00459 
00460    return create_channel_blob_message(snapshot, type, blob);
00461 }

struct stasis_cache* ast_channel_cache ( void   )  [read]

struct stasis_cp_all* ast_channel_cache_all ( void   )  [read]

Definition at line 126 of file stasis_channels.c.

Referenced by ast_channel_internal_setup_topics().

00127 {
00128    return channel_cache_all;
00129 }

struct stasis_cache* ast_channel_cache_by_name ( void   )  [read]

Secondary channel cache, indexed by name.

Since:
12
Return values:
Cache of ast_channel_snapshot.

Definition at line 146 of file stasis_channels.c.

Referenced by action_coreshowchannels(), ast_channel_snapshot_get_latest_by_name(), handle_chanlist(), and handle_channelstatus().

00147 {
00148    return channel_cache_by_name;
00149 }

struct stasis_message_type* ast_channel_chanspy_start_type ( void   )  [read]

Message type for when a channel starts spying on another channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), publish_chanspy_message(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_chanspy_stop_type ( void   )  [read]

Message type for when a channel stops spying on another channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), publish_chanspy_message(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_dial_type ( void   )  [read]

struct stasis_message_type* ast_channel_dtmf_begin_type ( void   )  [read]

Message type for when DTMF begins on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), send_dtmf_begin_event(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_dtmf_end_type ( void   )  [read]

Message type for when DTMF ends on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), send_dtmf_end_event(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_fax_type ( void   )  [read]

struct stasis_message_type* ast_channel_hangup_handler_type ( void   )  [read]

Message type for hangup handler related actions.

Since:
12
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), publish_hangup_handler_message(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_hangup_request_type ( void   )  [read]

Message type for when a hangup is requested on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_queue_hangup(), ast_queue_hangup_with_cause(), ast_softhangup(), ast_stasis_channels_init(), manager_channels_init(), setup_stasis_subs(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_hold_type ( void   )  [read]

Message type for when a channel is placed on hold.

Since:
12
Return values:
A stasis message type

Referenced by ast_bridge_channel_write_hold(), ast_queue_hold(), ast_stasis_channels_init(), manager_channels_init(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_moh_start_type ( void   )  [read]

Message type for starting music on hold on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), moh_post_start(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_moh_stop_type ( void   )  [read]

Message type for stopping music on hold on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), moh_post_stop(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_monitor_start_type ( void   )  [read]

Message type for starting monitor on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_monitor_start(), ast_stasis_channels_init(), manager_channels_init(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_monitor_stop_type ( void   )  [read]

Message type for stopping monitor on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_monitor_stop(), ast_stasis_channels_init(), manager_channels_init(), and stasis_channels_cleanup().

void ast_channel_publish_blob ( struct ast_channel chan,
struct stasis_message_type type,
struct ast_json blob 
)

Publish a channel blob message.

Since:
12.0.0
Precondition:
chan is locked
Parameters:
chan Channel publishing the blob.
type Type of stasis message.
blob The blob being published. (NULL if no blob)
Returns:
Nothing

Definition at line 738 of file stasis_channels.c.

References ao2_cleanup, ast_channel_blob_create(), ast_channel_topic(), ast_json_null(), and stasis_publish().

Referenced by ast_channel_publish_varset(), ast_queue_hangup(), ast_queue_hangup_with_cause(), ast_softhangup(), publish_dahdichannel(), publish_hangup_handler_message(), and send_session_timeout().

00739 {
00740    struct stasis_message *message;
00741 
00742    if (!blob) {
00743       blob = ast_json_null();
00744    }
00745 
00746    message = ast_channel_blob_create(chan, type, blob);
00747    if (message) {
00748       stasis_publish(ast_channel_topic(chan), message);
00749    }
00750    ao2_cleanup(message);
00751 }

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.

Since:
12.4.0
Parameters:
chan Channel publishing the blob.
type Type of stasis message.
blob The blob being published. (NULL if no blob)
Note:
As this only accesses the uniqueid and topic of the channel - neither of which should ever be changed on a channel anyhow - a channel does not have to be locked when calling this function.
Returns:
Nothing

Definition at line 723 of file stasis_channels.c.

References ao2_cleanup, ast_channel_blob_create_from_cache(), ast_channel_topic(), ast_channel_uniqueid(), ast_json_null(), and stasis_publish().

Referenced by agi_handle_command(), ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), ast_channel_publish_varset(), ast_queue_hold(), ast_queue_unhold(), join_queue(), launch_asyncagi(), leave_queue(), publish_async_exec_end(), record_abandoned(), send_agent_login(), send_agent_logoff(), send_dtmf_begin_event(), and send_dtmf_end_event().

00724 {
00725    struct stasis_message *message;
00726 
00727    if (!blob) {
00728       blob = ast_json_null();
00729    }
00730 
00731    message = ast_channel_blob_create_from_cache(ast_channel_uniqueid(chan), type, blob);
00732    if (message) {
00733       stasis_publish(ast_channel_topic(chan), message);
00734    }
00735    ao2_cleanup(message);
00736 }

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.

Since:
12
Parameters:
caller The channel performing the dial operation
peer The channel being dialed
dialstring When beginning a dial, the information passed to the dialing application
dialstatus The current status of the dial operation (NULL if no status is known)

Definition at line 414 of file stasis_channels.c.

References ast_channel_publish_dial_forward(), and NULL.

Referenced by AST_TEST_DEFINE(), begin_dial_channel(), dial_exec_full(), do_forward(), findmeexec(), handle_frame(), handle_frame_ownerless(), hangupcalls(), monitor_dial(), publish_dial_end_event(), ring_entry(), try_calling(), wait_for_answer(), and wait_for_winner().

00416 {
00417    ast_channel_publish_dial_forward(caller, peer, NULL, dialstring, dialstatus, NULL);
00418 }

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.

Since:
12
Parameters:
caller The channel performing the dial operation
peer The channel being dialed
forwarded The channel created as a result of the call forwarding
dialstring The information passed to the dialing application when beginning a dial
dialstatus The current status of the dial operation
forward The call forward string provided by the dialed channel

Definition at line 370 of file stasis_channels.c.

References ast_assert, ast_channel_lock, ast_channel_publish_dial_internal(), ast_channel_trylock, ast_channel_unlock, ast_strlen_zero, NULL, remove_dial_masquerade(), and set_dial_masquerade().

Referenced by ast_channel_publish_dial(), do_forward(), handle_call_forward(), and wait_for_answer().

00373 {
00374    ast_assert(peer != NULL);
00375 
00376    if (caller) {
00377       /*
00378        * Lock two or three channels.
00379        *
00380        * We need to hold the locks to hold off a potential masquerade
00381        * messing up the stasis dial event ordering.
00382        */
00383       for (;; ast_channel_unlock(caller), sched_yield()) {
00384          ast_channel_lock(caller);
00385          if (ast_channel_trylock(peer)) {
00386             continue;
00387          }
00388          if (forwarded && ast_channel_trylock(forwarded)) {
00389             ast_channel_unlock(peer);
00390             continue;
00391          }
00392          break;
00393       }
00394 
00395       if (ast_strlen_zero(dialstatus)) {
00396          set_dial_masquerade(caller, peer, dialstring);
00397       } else {
00398          remove_dial_masquerade(peer);
00399       }
00400    }
00401 
00402    ast_channel_publish_dial_internal(caller, peer, forwarded, dialstring, dialstatus,
00403       forward);
00404 
00405    if (caller) {
00406       if (forwarded) {
00407          ast_channel_unlock(forwarded);
00408       }
00409       ast_channel_unlock(peer);
00410       ast_channel_unlock(caller);
00411    }
00412 }

void ast_channel_publish_snapshot ( struct ast_channel chan  ) 

void ast_channel_publish_varset ( struct ast_channel chan,
const char *  variable,
const char *  value 
)

Publish a ast_channel_varset for a channel.

Since:
12
Precondition:
chan is locked
Parameters:
chan Channel to publish the event for, or NULL for 'none'.
variable Name of the variable being set
value Value.

If there are manager variables, force a cache update

Definition at line 753 of file stasis_channels.c.

References ast_assert, ast_channel_has_manager_vars(), ast_channel_publish_blob(), ast_channel_publish_cached_blob(), ast_channel_publish_snapshot(), ast_channel_varset_type(), ast_json_pack(), ast_json_unref(), ast_log, LOG_ERROR, and NULL.

Referenced by ast_channel_inherit_variables(), ast_unreal_call_setup(), frame_set_var(), pbx_builtin_setvar_helper(), and shared_write().

00754 {
00755    struct ast_json *blob;
00756 
00757    ast_assert(name != NULL);
00758    ast_assert(value != NULL);
00759 
00760    blob = ast_json_pack("{s: s, s: s}",
00761               "variable", name,
00762               "value", value);
00763    if (!blob) {
00764       ast_log(LOG_ERROR, "Error creating message\n");
00765       return;
00766    }
00767 
00768    /*! If there are manager variables, force a cache update */
00769    if (chan && ast_channel_has_manager_vars()) {
00770       ast_channel_publish_snapshot(chan);
00771    }
00772 
00773    if (chan) {
00774       ast_channel_publish_cached_blob(chan, ast_channel_varset_type(), blob);
00775    } else {
00776       /* This function is NULL safe for global variables */
00777       ast_channel_publish_blob(NULL, ast_channel_varset_type(), blob);
00778    }
00779 
00780    ast_json_unref(blob);
00781 }

struct ast_channel_snapshot* ast_channel_snapshot_create ( struct ast_channel chan  )  [read]

Generate a snapshot of the channel state. This is an ao2 object, so ao2_cleanup() to deallocate.

Since:
12
Precondition:
chan is locked
Parameters:
chan The channel from which to generate a snapshot
Return values:
pointer on success (must be unreffed)
NULL on error

Definition at line 202 of file stasis_channels.c.

References accountcode, ast_channel_snapshot::amaflags, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ast_channel_accountcode(), ast_channel_amaflags(), ast_channel_appl(), ast_channel_caller(), ast_channel_connected(), ast_channel_context(), ast_channel_creationtime(), ast_channel_data(), ast_channel_dialed(), ast_channel_exten(), ast_channel_flags(), ast_channel_get_bridge(), ast_channel_get_manager_vars(), ast_channel_hangupcause(), ast_channel_hangupsource(), ast_channel_language(), ast_channel_linkedid(), ast_channel_name(), ast_channel_peeraccount(), ast_channel_priority(), ast_channel_redirecting(), ast_channel_softhangup_internal_flag(), ast_channel_tech(), ast_channel_uniqueid(), ast_channel_userfield(), ast_copy_flags, ast_party_id_presentation(), ast_set_flag, ast_string_field_init, ast_string_field_set, ast_channel_snapshot::caller_pres, channel_snapshot_dtor(), context, ast_channel_snapshot::creationtime, exten, ast_channel_snapshot::flags, ast_channel_snapshot::hangupcause, language, ast_channel_snapshot::manager_vars, name, NULL, ast_channel_snapshot::priority, ast_channel_tech::properties, S_COR, S_OR, ast_channel_snapshot::softhangup_flags, ast_channel_snapshot::state, ast_party_dialed::str, ast_channel_snapshot::tech_properties, type, and ast_bridge::uniqueid.

Referenced by action_agents(), append_expected_event(), ast_channel_blob_create(), ast_channel_publish_dial_internal(), ast_channel_publish_snapshot(), ast_do_pickup(), ast_multi_object_blob_single_channel_publish(), ast_publish_channel_state(), AST_TEST_DEFINE(), create_channel_snapshot_message(), parked_call_app_exec(), parked_call_payload_from_failure(), parked_call_payload_from_parked_user(), queue_publish_multi_channel_blob(), realtime_exec(), and send_start_msg().

00203 {
00204    struct ast_channel_snapshot *snapshot;
00205    struct ast_bridge *bridge;
00206 
00207    /* no snapshots for dummy channels */
00208    if (!ast_channel_tech(chan)) {
00209       return NULL;
00210    }
00211 
00212    snapshot = ao2_alloc_options(sizeof(*snapshot), channel_snapshot_dtor,
00213       AO2_ALLOC_OPT_LOCK_NOLOCK);
00214    if (!snapshot || ast_string_field_init(snapshot, 1024)) {
00215       ao2_cleanup(snapshot);
00216       return NULL;
00217    }
00218 
00219    ast_string_field_set(snapshot, name, ast_channel_name(chan));
00220    ast_string_field_set(snapshot, type, ast_channel_tech(chan)->type);
00221    ast_string_field_set(snapshot, accountcode, ast_channel_accountcode(chan));
00222    ast_string_field_set(snapshot, peeraccount, ast_channel_peeraccount(chan));
00223    ast_string_field_set(snapshot, userfield, ast_channel_userfield(chan));
00224    ast_string_field_set(snapshot, uniqueid, ast_channel_uniqueid(chan));
00225    ast_string_field_set(snapshot, linkedid, ast_channel_linkedid(chan));
00226    ast_string_field_set(snapshot, hangupsource, ast_channel_hangupsource(chan));
00227    if (ast_channel_appl(chan)) {
00228       ast_string_field_set(snapshot, appl, ast_channel_appl(chan));
00229    }
00230    if (ast_channel_data(chan)) {
00231       ast_string_field_set(snapshot, data, ast_channel_data(chan));
00232    }
00233    ast_string_field_set(snapshot, context, ast_channel_context(chan));
00234    ast_string_field_set(snapshot, exten, ast_channel_exten(chan));
00235 
00236    ast_string_field_set(snapshot, caller_name,
00237       S_COR(ast_channel_caller(chan)->id.name.valid, ast_channel_caller(chan)->id.name.str, ""));
00238    ast_string_field_set(snapshot, caller_number,
00239       S_COR(ast_channel_caller(chan)->id.number.valid, ast_channel_caller(chan)->id.number.str, ""));
00240    ast_string_field_set(snapshot, caller_dnid, S_OR(ast_channel_dialed(chan)->number.str, ""));
00241    ast_string_field_set(snapshot, caller_subaddr,
00242       S_COR(ast_channel_caller(chan)->id.subaddress.valid, ast_channel_caller(chan)->id.subaddress.str, ""));
00243    ast_string_field_set(snapshot, dialed_subaddr,
00244       S_COR(ast_channel_dialed(chan)->subaddress.valid, ast_channel_dialed(chan)->subaddress.str, ""));
00245    ast_string_field_set(snapshot, caller_ani,
00246       S_COR(ast_channel_caller(chan)->ani.number.valid, ast_channel_caller(chan)->ani.number.str, ""));
00247    ast_string_field_set(snapshot, caller_rdnis,
00248       S_COR(ast_channel_redirecting(chan)->from.number.valid, ast_channel_redirecting(chan)->from.number.str, ""));
00249    ast_string_field_set(snapshot, caller_dnid,
00250       S_OR(ast_channel_dialed(chan)->number.str, ""));
00251 
00252    ast_string_field_set(snapshot, connected_name,
00253       S_COR(ast_channel_connected(chan)->id.name.valid, ast_channel_connected(chan)->id.name.str, ""));
00254    ast_string_field_set(snapshot, connected_number,
00255       S_COR(ast_channel_connected(chan)->id.number.valid, ast_channel_connected(chan)->id.number.str, ""));
00256    ast_string_field_set(snapshot, language, ast_channel_language(chan));
00257 
00258    if ((bridge = ast_channel_get_bridge(chan))) {
00259       ast_string_field_set(snapshot, bridgeid, bridge->uniqueid);
00260       ao2_cleanup(bridge);
00261    }
00262 
00263    snapshot->creationtime = ast_channel_creationtime(chan);
00264    snapshot->state = ast_channel_state(chan);
00265    snapshot->priority = ast_channel_priority(chan);
00266    snapshot->amaflags = ast_channel_amaflags(chan);
00267    snapshot->hangupcause = ast_channel_hangupcause(chan);
00268    ast_copy_flags(&snapshot->flags, ast_channel_flags(chan), 0xFFFFFFFF);
00269    snapshot->caller_pres = ast_party_id_presentation(&ast_channel_caller(chan)->id);
00270    ast_set_flag(&snapshot->softhangup_flags, ast_channel_softhangup_internal_flag(chan));
00271 
00272    snapshot->manager_vars = ast_channel_get_manager_vars(chan);
00273    snapshot->tech_properties = ast_channel_tech(chan)->properties;
00274 
00275    return snapshot;
00276 }

struct ast_channel_snapshot* ast_channel_snapshot_get_latest ( const char *  uniqueid  )  [read]

Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object, so use ao2_cleanup() to deallocate.

Since:
12
Parameters:
unique_id The channel's unique ID
Return values:
A ast_channel_snapshot on success
NULL on error

Definition at line 562 of file stasis_channels.c.

References ao2_cleanup, ao2_ref, ast_assert, ast_channel_cache(), ast_channel_snapshot_type(), ast_strlen_zero, NULL, RAII_VAR, stasis_cache_get(), and stasis_message_data().

Referenced by __test_cel_generate_peer_str(), aoc_publish_blob(), ari_channels_handle_originate_with_id(), ari_channels_handle_snoop_channel(), ast_ari_channels_redirect(), ast_attended_transfer_message_add_app(), ast_attended_transfer_message_add_link(), ast_attended_transfer_message_create(), ast_blind_transfer_message_create(), ast_bridge_blob_create(), ast_bridge_transfer_blind(), ast_channel_blob_create_from_cache(), ast_channel_publish_dial_internal(), ast_do_pickup(), ast_rtp_publish_rtcp_message(), ast_sip_for_each_channel_snapshot(), blind_transfer_bridge(), bridge_channel_snapshot_pair_init(), bridge_stasis_push_peek(), cel_generate_peer_str(), channel_id_sanitizer(), channel_replaced_cb(), find_channel_control(), generate_status(), handle_attended_transfer(), handle_blind_transfer(), handle_hangup(), local_channel_optimization_blob(), local_optimization_started_cb(), notify_new_message(), pack_channel_into_message(), publish_chanspy_message(), publish_local_bridge_message(), stasis_app_user_event(), and test_cel_generate_peer_str().

00563 {
00564    RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
00565    struct ast_channel_snapshot *snapshot;
00566 
00567    ast_assert(!ast_strlen_zero(uniqueid));
00568 
00569    message = stasis_cache_get(ast_channel_cache(),
00570          ast_channel_snapshot_type(),
00571          uniqueid);
00572    if (!message) {
00573       return NULL;
00574    }
00575 
00576    snapshot = stasis_message_data(message);
00577    if (!snapshot) {
00578       return NULL;
00579    }
00580    ao2_ref(snapshot, +1);
00581    return snapshot;
00582 }

struct ast_channel_snapshot* ast_channel_snapshot_get_latest_by_name ( const char *  name  )  [read]

Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object, so use ao2_cleanup() to deallocate.

Since:
12
Parameters:
name The channel's name
Return values:
A ast_channel_snapshot on success
NULL on error

Definition at line 584 of file stasis_channels.c.

References ao2_cleanup, ao2_ref, ast_assert, ast_channel_cache_by_name(), ast_channel_snapshot_type(), ast_strlen_zero, NULL, RAII_VAR, stasis_cache_get(), and stasis_message_data().

00585 {
00586    RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
00587    struct ast_channel_snapshot *snapshot;
00588 
00589    ast_assert(!ast_strlen_zero(name));
00590 
00591    message = stasis_cache_get(ast_channel_cache_by_name(),
00592          ast_channel_snapshot_type(),
00593          name);
00594    if (!message) {
00595       return NULL;
00596    }
00597 
00598    snapshot = stasis_message_data(message);
00599    if (!snapshot) {
00600       return NULL;
00601    }
00602    ao2_ref(snapshot, +1);
00603    return snapshot;
00604 }

struct stasis_message_type* ast_channel_snapshot_type ( void   )  [read]

void ast_channel_stage_snapshot ( struct ast_channel chan  ) 

void ast_channel_stage_snapshot_done ( struct ast_channel chan  ) 

struct stasis_message_type* ast_channel_talking_start ( void   )  [read]

Message type for a channel starting talking.

Since:
12.4.0
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), stasis_channels_cleanup(), and talk_detect_audiohook_cb().

struct stasis_message_type* ast_channel_talking_stop ( void   )  [read]

Message type for a channel stopping talking.

Since:
12.4.0
Return values:
A stasis message type

Referenced by ast_stasis_channels_init(), stasis_channels_cleanup(), and talk_detect_audiohook_cb().

struct stasis_topic* ast_channel_topic_all ( void   )  [read]

A topic which publishes the events for all channels.

Since:
12
Return values:
Topic for all channel events.

Definition at line 136 of file stasis_channels.c.

References stasis_cp_all_topic().

Referenced by ast_channel_topic(), load_module(), publish_message_for_channel_topics(), and setup_stasis_subs().

00137 {
00138    return stasis_cp_all_topic(channel_cache_all);
00139 }

struct stasis_topic* ast_channel_topic_all_cached ( void   )  [read]

A caching topic which caches ast_channel_snapshot messages from ast_channel_events_all(void).

Since:
12
Return values:
Topic for all channel events.

Definition at line 141 of file stasis_channels.c.

References stasis_cp_all_topic_cached().

Referenced by ast_channel_topic_cached(), create_subscriptions(), load_module(), manager_channels_init(), manager_confbridge_init(), and meetme_stasis_init().

00142 {
00143    return stasis_cp_all_topic_cached(channel_cache_all);
00144 }

struct stasis_message_type* ast_channel_unhold_type ( void   )  [read]

Message type for when a channel is removed from hold.

Since:
12
Return values:
A stasis message type

Referenced by ast_bridge_channel_write_unhold(), ast_queue_unhold(), ast_stasis_channels_init(), manager_channels_init(), and stasis_channels_cleanup().

struct stasis_message_type* ast_channel_varset_type ( void   )  [read]

Message type for when a variable is set on a channel.

Since:
12
Return values:
A stasis message type

Referenced by ast_channel_publish_varset(), ast_stasis_channels_init(), and stasis_channels_cleanup().

struct stasis_message* ast_endpoint_blob_create ( struct ast_endpoint endpoint,
struct stasis_message_type type,
struct ast_json blob 
) [read]

Creates a ast_endpoint_blob message.

Since:
12 The given blob should be treated as immutable and not modified after it is put into the message.
Parameters:
endpoint Endpoint blob is associated with.
type Message type for this blob.
blob JSON object representing the data, or NULL for no data. If NULL, ast_json_null() is put into the object.
Returns:
ast_endpoint_blob message.

NULL on error

Definition at line 147 of file stasis_endpoints.c.

References ao2_alloc, ao2_cleanup, ao2_ref, ast_endpoint_snapshot_create(), ast_json_null(), ast_json_ref(), endpoint_blob_dtor(), NULL, RAII_VAR, and stasis_message_create().

Referenced by ast_endpoint_blob_publish().

00149 {
00150    RAII_VAR(struct ast_endpoint_blob *, obj, NULL, ao2_cleanup);
00151    RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
00152 
00153    if (!type) {
00154       return NULL;
00155    }
00156    if (!blob) {
00157       blob = ast_json_null();
00158    }
00159 
00160    if (!(obj = ao2_alloc(sizeof(*obj), endpoint_blob_dtor))) {
00161       return NULL;
00162    }
00163 
00164    if (endpoint) {
00165       if (!(obj->snapshot = ast_endpoint_snapshot_create(endpoint))) {
00166          return NULL;
00167       }
00168    }
00169 
00170    obj->blob = ast_json_ref(blob);
00171 
00172    if (!(msg = stasis_message_create(type, obj))) {
00173       return NULL;
00174    }
00175 
00176    ao2_ref(msg, +1);
00177    return msg;
00178 }

void ast_endpoint_blob_publish ( struct ast_endpoint endpoint,
struct stasis_message_type type,
struct ast_json blob 
)

Creates and publishes a ast_endpoint_blob message.

Since:
12 The given blob should be treated as immutable and not modified after it is put into the message.
Parameters:
endpoint Endpoint blob is associated with.
type Message type for this blob.
blob JSON object representing the data, or NULL for no data. If NULL, ast_json_null() is put into the object.

Definition at line 180 of file stasis_endpoints.c.

References ao2_cleanup, ast_endpoint_blob_create(), ast_endpoint_topic(), NULL, RAII_VAR, and stasis_publish().

Referenced by __expire_registry(), __iax2_poke_noanswer(), expire_register(), handle_response_peerpoke(), parse_register_contact(), persistent_endpoint_update_state(), register_verify(), sip_poke_noanswer(), skinny_register(), skinny_session_cleanup(), socket_process_helper(), unload_module(), and update_registry().

00182 {
00183    RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
00184    if (blob) {
00185       message = ast_endpoint_blob_create(endpoint, type, blob);
00186    }
00187    if (message) {
00188       stasis_publish(ast_endpoint_topic(endpoint), message);
00189    }
00190 }

struct stasis_cache* ast_endpoint_cache ( void   )  [read]

Backend cache for ast_endpoint_topic_all_cached().

Returns:
Cache of ast_endpoint_snapshot.
Since:
12

Definition at line 83 of file stasis_endpoints.c.

References stasis_cp_all_cache().

Referenced by ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), and ast_endpoint_latest_snapshot().

00084 {
00085    return stasis_cp_all_cache(endpoint_cache_all);
00086 }

struct stasis_cp_all* ast_endpoint_cache_all ( void   )  [read]

Definition at line 78 of file stasis_endpoints.c.

Referenced by endpoint_internal_create().

00079 {
00080    return endpoint_cache_all;
00081 }

struct ast_endpoint_snapshot* ast_endpoint_latest_snapshot ( const char *  tech,
const char *  resource 
) [read]

Retrieve the most recent snapshot for the endpoint with the given name.

Parameters:
tech Name of the endpoint's technology.
resource Resource name of the endpoint.
Returns:
Snapshot of the endpoint with the given name.

NULL if endpoint is not found, or on error.

Since:
12

Definition at line 192 of file stasis_endpoints.c.

References ao2_cleanup, ao2_ref, ast_asprintf, ast_assert, ast_endpoint_cache(), ast_endpoint_snapshot_type(), ast_free, ast_strlen_zero, ast_tech_to_upper(), NULL, RAII_VAR, stasis_cache_get(), and stasis_message_data().

Referenced by ast_ari_endpoints_get(), ast_ari_endpoints_send_message_to_endpoint(), ast_sip_get_endpoint_snapshot(), chan_pjsip_devicestate(), message_received_handler(), and stasis_app_user_event().

00194 {
00195    RAII_VAR(char *, id, NULL, ast_free);
00196    RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
00197    struct ast_endpoint_snapshot *snapshot;
00198 
00199    if (ast_strlen_zero(name)) {
00200       ast_asprintf(&id, "%s", tech);
00201    } else {
00202       ast_asprintf(&id, "%s/%s", tech, name);
00203    }
00204    if (!id) {
00205       return NULL;
00206    }
00207    ast_tech_to_upper(id);
00208 
00209    msg = stasis_cache_get(ast_endpoint_cache(),
00210       ast_endpoint_snapshot_type(), id);
00211    if (!msg) {
00212       return NULL;
00213    }
00214 
00215    snapshot = stasis_message_data(msg);
00216    ast_assert(snapshot != NULL);
00217 
00218    ao2_ref(snapshot, +1);
00219    return snapshot;
00220 }

struct ast_endpoint_snapshot* ast_endpoint_snapshot_create ( struct ast_endpoint endpoint  )  [read]

Create a snapshot of an endpoint.

Parameters:
endpoint Endpoint to snap a shot of.
Returns:
Snapshot of the endpoint.

NULL on error.

Since:
12

Definition at line 456 of file endpoints.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_assert, ast_string_field_build, ast_string_field_init, ast_string_field_set, ast_strlen_zero, ast_endpoint::channel_ids, endpoint_snapshot_dtor(), lock, ast_endpoint::max_channels, NULL, RAII_VAR, ast_endpoint::resource, SCOPED_AO2LOCK, ast_endpoint::state, and ast_endpoint::tech.

Referenced by ast_endpoint_blob_create(), AST_TEST_DEFINE(), create_endpoint_snapshot_message(), and endpoint_publish_snapshot().

00458 {
00459    RAII_VAR(struct ast_endpoint_snapshot *, snapshot, NULL, ao2_cleanup);
00460    int channel_count;
00461    struct ao2_iterator i;
00462    void *obj;
00463    SCOPED_AO2LOCK(lock, endpoint);
00464 
00465    ast_assert(endpoint != NULL);
00466    ast_assert(!ast_strlen_zero(endpoint->resource));
00467 
00468    channel_count = ao2_container_count(endpoint->channel_ids);
00469 
00470    snapshot = ao2_alloc_options(
00471       sizeof(*snapshot) + channel_count * sizeof(char *),
00472       endpoint_snapshot_dtor,
00473       AO2_ALLOC_OPT_LOCK_NOLOCK);
00474 
00475    if (!snapshot || ast_string_field_init(snapshot, 80) != 0) {
00476       ao2_cleanup(snapshot);
00477       return NULL;
00478    }
00479 
00480    ast_string_field_build(snapshot, id, "%s/%s", endpoint->tech,
00481       endpoint->resource);
00482    ast_string_field_set(snapshot, tech, endpoint->tech);
00483    ast_string_field_set(snapshot, resource, endpoint->resource);
00484 
00485    snapshot->state = endpoint->state;
00486    snapshot->max_channels = endpoint->max_channels;
00487 
00488    i = ao2_iterator_init(endpoint->channel_ids, 0);
00489    while ((obj = ao2_iterator_next(&i))) {
00490       /* The reference is kept so the channel id does not go away until the snapshot is gone */
00491       snapshot->channel_ids[snapshot->num_channels++] = obj;
00492    }
00493    ao2_iterator_destroy(&i);
00494 
00495    ao2_ref(snapshot, +1);
00496    return snapshot;
00497 }

struct stasis_message_type* ast_endpoint_snapshot_type ( void   )  [read]

struct stasis_message_type* ast_endpoint_state_type ( void   )  [read]

struct stasis_topic* ast_endpoint_topic ( struct ast_endpoint endpoint  )  [read]

Returns the topic for a specific endpoint.

Parameters:
endpoint The endpoint.
Returns:
The topic for the given endpoint.

ast_endpoint_topic_all() if endpoint is NULL.

Since:
12

Definition at line 140 of file endpoints.c.

References ast_endpoint_topic_all(), stasis_cp_single_topic(), and ast_endpoint::topics.

Referenced by ast_channel_forward_endpoint(), ast_endpoint_blob_publish(), ast_endpoint_shutdown(), AST_TEST_DEFINE(), endpoint_internal_create(), endpoint_publish_snapshot(), and forwards_create_endpoint().

00141 {
00142    if (!endpoint) {
00143       return ast_endpoint_topic_all();
00144    }
00145    return stasis_cp_single_topic(endpoint->topics);
00146 }

struct stasis_topic* ast_endpoint_topic_all ( void   )  [read]

Topic for all endpoint releated messages.

Since:
12

Definition at line 88 of file stasis_endpoints.c.

References stasis_cp_all_topic().

Referenced by ast_endpoint_topic().

00089 {
00090    return stasis_cp_all_topic(endpoint_cache_all);
00091 }

struct stasis_topic* ast_endpoint_topic_all_cached ( void   )  [read]

Cached topic for all endpoint related messages.

Since:
12

Definition at line 93 of file stasis_endpoints.c.

References stasis_cp_all_topic_cached().

Referenced by ast_endpoint_topic_cached(), AST_TEST_DEFINE(), and manager_endpoints_init().

00094 {
00095    return stasis_cp_all_topic_cached(endpoint_cache_all);
00096 }

struct stasis_topic* ast_endpoint_topic_cached ( struct ast_endpoint endpoint  )  [read]

Returns the topic for a specific endpoint.

ast_endpoint_snapshot messages are replaced with stasis_cache_update

Parameters:
endpoint The endpoint.
Returns:
The topic for the given endpoint.

ast_endpoint_topic_all() if endpoint is NULL.

Since:
12

Definition at line 148 of file endpoints.c.

References ast_endpoint_topic_all_cached(), stasis_cp_single_topic_cached(), and ast_endpoint::topics.

Referenced by forwards_create_endpoint().

00149 {
00150    if (!endpoint) {
00151       return ast_endpoint_topic_all_cached();
00152    }
00153    return stasis_cp_single_topic_cached(endpoint->topics);
00154 }

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.

Since:
12
Note:
This will increase the reference count by 1 for the channel snapshot. It is assumed that the ast_multi_channel_blob will own a reference to the object.
Parameters:
obj The ast_multi_channel_blob object that will reference the snapshot
role A role that the snapshot has in the multi channel relationship
snapshot The ast_channel_snapshot being added to the ast_multi_channel_blob object

Definition at line 612 of file stasis_channels.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_link, ao2_ref, ast_copy_string(), ast_strlen_zero, channel_role_snapshot_dtor(), ast_multi_channel_blob::channel_snapshots, NULL, and RAII_VAR.

Referenced by ast_channel_publish_dial_internal(), AST_TEST_DEFINE(), local_channel_optimization_blob(), local_optimization_started_cb(), pack_channel_into_message(), publish_chanspy_message(), publish_local_bridge_message(), queue_publish_multi_channel_snapshot_blob(), and send_call_pickup_stasis_message().

00613 {
00614    RAII_VAR(struct channel_role_snapshot *, role_snapshot, NULL, ao2_cleanup);
00615    int role_len = strlen(role) + 1;
00616 
00617    if (!obj || ast_strlen_zero(role) || !snapshot) {
00618       return;
00619    }
00620 
00621    role_snapshot = ao2_alloc_options(sizeof(*role_snapshot) + role_len, channel_role_snapshot_dtor,
00622       AO2_ALLOC_OPT_LOCK_NOLOCK);
00623    if (!role_snapshot) {
00624       return;
00625    }
00626    ast_copy_string(role_snapshot->role, role, role_len);
00627    role_snapshot->snapshot = snapshot;
00628    ao2_ref(role_snapshot->snapshot, +1);
00629    ao2_link(obj->channel_snapshots, role_snapshot);
00630 }

struct ast_multi_channel_blob* ast_multi_channel_blob_create ( struct ast_json blob  )  [read]

Create a ast_multi_channel_blob suitable for a stasis_message.

Since:
12 The given blob should be treated as immutable and not modified after it is put into the message.
Parameters:
blob The JSON blob that defines the data of this ast_multi_channel_blob
Returns:
ast_multi_channel_blob object

NULL on error

Definition at line 538 of file stasis_channels.c.

References ao2_alloc, ao2_cleanup, ao2_container_alloc, ao2_ref, ast_assert, ast_json_ref(), channel_role_hash_cb(), channel_role_single_cmp_cb(), multi_channel_blob_dtor(), NULL, NUM_MULTI_CHANNEL_BLOB_BUCKETS, and RAII_VAR.

Referenced by ast_channel_publish_dial_internal(), AST_TEST_DEFINE(), local_channel_optimization_blob(), publish_chanspy_message(), publish_local_bridge_message(), queue_publish_multi_channel_snapshot_blob(), and send_call_pickup_stasis_message().

00539 {
00540    RAII_VAR(struct ast_multi_channel_blob *, obj,
00541          ao2_alloc(sizeof(*obj), multi_channel_blob_dtor),
00542          ao2_cleanup);
00543 
00544    ast_assert(blob != NULL);
00545 
00546    if (!obj) {
00547       return NULL;
00548    }
00549 
00550    obj->channel_snapshots = ao2_container_alloc(NUM_MULTI_CHANNEL_BLOB_BUCKETS,
00551          channel_role_hash_cb, channel_role_single_cmp_cb);
00552    if (!obj->channel_snapshots) {
00553       return NULL;
00554    }
00555 
00556    obj->blob = ast_json_ref(blob);
00557 
00558    ao2_ref(obj, +1);
00559    return obj;
00560 }

struct ast_channel_snapshot* ast_multi_channel_blob_get_channel ( struct ast_multi_channel_blob obj,
const char *  role 
) [read]

Retrieve a channel snapshot associated with a specific role from a ast_multi_channel_blob.

Since:
12
Note:
The reference count of the ast_channel_snapshot returned from this function is not changed. The caller of this function does not own the reference to the snapshot.
Parameters:
obj The ast_multi_channel_blob containing the channel snapshot to retrieve
role The role associated with the channel snapshot
Return values:
\ref ast_channel_snapshot matching the role on success
NULL on error or not found for the role specified

Definition at line 632 of file stasis_channels.c.

References ao2_find, ao2_ref, ast_strlen_zero, ast_multi_channel_blob::channel_snapshots, NULL, OBJ_KEY, and channel_role_snapshot::snapshot.

Referenced by AST_TEST_DEFINE(), call_forwarded_handler(), call_pickup_to_ami(), cel_dial_cb(), cel_local_cb(), cel_pickup_cb(), channel_chanspy_start_cb(), channel_chanspy_stop_cb(), channel_dial_cb(), dial_to_json(), get_caller_uniqueid(), handle_dial_message(), handle_local_optimization_begin(), handle_local_optimization_end(), local_message_to_ami(), and queue_multi_channel_to_ami().

00633 {
00634    struct channel_role_snapshot *role_snapshot;
00635 
00636    if (!obj || ast_strlen_zero(role)) {
00637       return NULL;
00638    }
00639    role_snapshot = ao2_find(obj->channel_snapshots, role, OBJ_KEY);
00640    /* Note that this function does not increase the ref count on snapshot */
00641    if (!role_snapshot) {
00642       return NULL;
00643    }
00644    ao2_ref(role_snapshot, -1);
00645    return role_snapshot->snapshot;
00646 }

struct ao2_container* ast_multi_channel_blob_get_channels ( struct ast_multi_channel_blob obj,
const char *  role 
) [read]

Retrieve all channel snapshots associated with a specific role from a ast_multi_channel_blob.

Since:
12
Note:
Because this function returns an ao2_container (hashed by channel name) of all channel snapshots that matched the passed in role, the reference of the snapshots is increased by this function. The caller of this function must release the reference to the snapshots by disposing of the container appropriately.
Parameters:
obj The ast_multi_channel_blob containing the channel snapshots to retrieve
role The role associated with the channel snapshots
Return values:
A container containing all ast_channel_snapshot objects matching the role on success.
NULL on error or not found for the role specified

Definition at line 648 of file stasis_channels.c.

References ao2_callback, ao2_cleanup, ao2_container_alloc, ao2_iterator_destroy(), ao2_iterator_next, ao2_link, ao2_ref, ast_strdupa, ast_strlen_zero, channel_role_multi_cmp_cb(), channel_snapshot_cmp_cb(), channel_snapshot_hash_cb(), ast_multi_channel_blob::channel_snapshots, NULL, NUM_MULTI_CHANNEL_BLOB_BUCKETS, OBJ_KEY, OBJ_MULTIPLE, RAII_VAR, and channel_role_snapshot::snapshot.

Referenced by AST_TEST_DEFINE().

00649 {
00650    RAII_VAR(struct ao2_container *, ret_container,
00651       ao2_container_alloc(NUM_MULTI_CHANNEL_BLOB_BUCKETS, channel_snapshot_hash_cb, channel_snapshot_cmp_cb),
00652       ao2_cleanup);
00653    struct ao2_iterator *it_role_snapshots;
00654    struct channel_role_snapshot *role_snapshot;
00655    char *arg;
00656 
00657    if (!obj || ast_strlen_zero(role) || !ret_container) {
00658       return NULL;
00659    }
00660    arg = ast_strdupa(role);
00661 
00662    it_role_snapshots = ao2_callback(obj->channel_snapshots, OBJ_MULTIPLE | OBJ_KEY, channel_role_multi_cmp_cb, arg);
00663    if (!it_role_snapshots) {
00664       return NULL;
00665    }
00666 
00667    while ((role_snapshot = ao2_iterator_next(it_role_snapshots))) {
00668       ao2_link(ret_container, role_snapshot->snapshot);
00669       ao2_ref(role_snapshot, -1);
00670    }
00671    ao2_iterator_destroy(it_role_snapshots);
00672 
00673    ao2_ref(ret_container, +1);
00674    return ret_container;
00675 }

struct ast_json* ast_multi_channel_blob_get_json ( struct ast_multi_channel_blob obj  )  [read]

Retrieve the JSON blob from a ast_multi_channel_blob. Returned ast_json is still owned by obj.

Since:
12
Parameters:
obj Channel blob object.
Returns:
Type field value from the blob.

NULL on error.

Definition at line 677 of file stasis_channels.c.

References ast_multi_channel_blob::blob, and NULL.

Referenced by AST_TEST_DEFINE(), channel_dial_cb(), dial_to_json(), get_blob_variable(), handle_dial_message(), handle_local_optimization_begin(), handle_local_optimization_end(), local_message_to_ami(), and queue_multi_channel_to_ami().

00678 {
00679    if (!obj) {
00680       return NULL;
00681    }
00682    return obj->blob;
00683 }

void ast_multi_object_blob_add ( struct ast_multi_object_blob multi,
enum stasis_user_multi_object_snapshot_type  type,
void *  object 
)

Add an object to a multi object blob previously created.

Since:
12.3.0
Parameters:
multi The multi object blob previously created
type Type code for the object such as channel, bridge, etc.
object Snapshot object of the type supplied to typename
Returns:
Nothing

Definition at line 1217 of file stasis.c.

References AST_VECTOR_APPEND.

Referenced by ast_multi_object_blob_single_channel_publish(), and stasis_app_user_event().

01219 {
01220    if (!multi || !object) {
01221       return;
01222    }
01223    AST_VECTOR_APPEND(&multi->snapshots[type],object);
01224 }

struct ast_multi_object_blob* ast_multi_object_blob_create ( struct ast_json blob  )  [read]

Create a stasis multi object blob.

Since:
12.3.0
Multi object blob can store a combination of arbitrary json values (the blob) and also snapshots of various other system objects (such as channels, bridges, etc) for delivery through a stasis message. The multi object blob is first created, then optionally objects are added to it, before being attached to a message and delivered to stasis topic.

Parameters:
blob Json blob
Note:
When used for an ast_multi_user_event_type message, the json blob should contain at minimum {eventname: name}.
Return values:
ast_multi_object_blob* if succeeded
NULL if creation failed

Definition at line 1191 of file stasis.c.

References ao2_alloc, ao2_cleanup, ao2_ref, ast_assert, ast_json_ref(), AST_VECTOR_INIT, multi_object_blob_dtor(), NULL, RAII_VAR, STASIS_UMOS_MAX, and type.

Referenced by ast_multi_object_blob_single_channel_publish(), and stasis_app_user_event().

01192 {
01193    int type;
01194    RAII_VAR(struct ast_multi_object_blob *, multi,
01195          ao2_alloc(sizeof(*multi), multi_object_blob_dtor),
01196          ao2_cleanup);
01197 
01198    ast_assert(blob != NULL);
01199 
01200    if (!multi) {
01201       return NULL;
01202    }
01203 
01204    for (type = 0; type < STASIS_UMOS_MAX; ++type) {
01205       if (AST_VECTOR_INIT(&multi->snapshots[type], 0)) {
01206          return NULL;
01207       }
01208    }
01209 
01210    multi->blob = ast_json_ref(blob);
01211 
01212    ao2_ref(multi, +1);
01213    return multi;
01214 }

void ast_multi_object_blob_single_channel_publish ( struct ast_channel chan,
struct stasis_message_type type,
struct ast_json blob 
)

Create and publish a stasis message blob on a channel with it's snapshot.

Since:
12.3.0
For compatibility with app_userevent, this creates a multi object blob message, attaches the channel snapshot to it, and publishes it to the channel's topic.

Parameters:
chan The channel to snapshot and publish event to
type The message type
blob A json blob to publish with the snapshot
Returns:
Nothing

Definition at line 1227 of file stasis.c.

References ao2_cleanup, ao2_ref, ast_channel_snapshot_create(), ast_channel_topic(), ast_multi_object_blob_add(), ast_multi_object_blob_create(), NULL, RAII_VAR, stasis_message_create(), stasis_publish(), and STASIS_UMOS_CHANNEL.

Referenced by userevent_exec().

01229 {
01230    RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
01231    RAII_VAR(struct ast_channel_snapshot *, channel_snapshot, NULL, ao2_cleanup);
01232    RAII_VAR(struct ast_multi_object_blob *, multi, NULL, ao2_cleanup);
01233 
01234    if (!type) {
01235       return;
01236    }
01237 
01238    multi = ast_multi_object_blob_create(blob);
01239    if (!multi) {
01240       return;
01241    }
01242 
01243    channel_snapshot = ast_channel_snapshot_create(chan);
01244    ao2_ref(channel_snapshot, +1);
01245    ast_multi_object_blob_add(multi, STASIS_UMOS_CHANNEL, channel_snapshot);
01246 
01247    message = stasis_message_create(type, multi);
01248    if (message) {
01249       /* app_userevent still publishes to channel */
01250       stasis_publish(ast_channel_topic(chan), message);
01251    }
01252 }

struct stasis_message_type* ast_multi_user_event_type ( void   )  [read]

Message type for custom user defined events with multi object blobs.

Returns:
The stasis_message_type for user event
Since:
12.3.0

Referenced by stasis_app_user_event(), stasis_cleanup(), stasis_init(), and userevent_exec().

struct stasis_message* ast_mwi_blob_create ( struct ast_mwi_state mwi_state,
struct stasis_message_type message_type,
struct ast_json blob 
) [read]

Creates a ast_mwi_blob message.

Since:
12 The blob JSON object requires a "type" field describing the blob. It should also be treated as immutable and not modified after it is put into the message.
Parameters:
mwi_state MWI state associated with the update
message_type The type of message to create
blob JSON object representing the data.
Returns:
ast_mwi_blob message.

NULL on error

Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 3306 of file main/app.c.

References ao2_alloc, ao2_cleanup, ao2_ref, ast_assert, ast_json_ref(), mwi_blob_dtor(), NULL, RAII_VAR, and stasis_message_create().

Referenced by notify_new_message().

03309 {
03310    RAII_VAR(struct ast_mwi_blob *, obj, NULL, ao2_cleanup);
03311    RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
03312 
03313    ast_assert(blob != NULL);
03314 
03315    if (!message_type) {
03316       return NULL;
03317    }
03318 
03319    obj = ao2_alloc(sizeof(*obj), mwi_blob_dtor);
03320    if (!obj) {
03321       return NULL;
03322    }
03323 
03324    obj->mwi_state = mwi_state;
03325    ao2_ref(obj->mwi_state, +1);
03326    obj->blob = ast_json_ref(blob);
03327 
03328    /* This is not a normal MWI event.  Only used by the MinivmNotify app. */
03329    msg = stasis_message_create(message_type, obj);
03330    if (!msg) {
03331       return NULL;
03332    }
03333 
03334    ao2_ref(msg, +1);
03335    return msg;
03336 }

struct ast_mwi_state* ast_mwi_create ( const char *  mailbox,
const char *  context 
) [read]

Create a ast_mwi_state object.

Since:
12
Parameters:
[in] mailbox The mailbox identifier string.
[in] context The context this mailbox resides in (NULL or "" if only using mailbox)
Return values:
\ref ast_mwi_state object on success
NULL on error
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 3117 of file main/app.c.

References ao2_alloc, ao2_cleanup, ao2_ref, ast_assert, ast_string_field_build, ast_string_field_init, ast_string_field_set, ast_strlen_zero, mwi_state_dtor(), NULL, RAII_VAR, and ast_mwi_state::uniqueid.

Referenced by mwi_state_create_message(), and notify_new_message().

03118 {
03119    RAII_VAR(struct ast_mwi_state *, mwi_state, NULL, ao2_cleanup);
03120 
03121    ast_assert(!ast_strlen_zero(mailbox));
03122 
03123    mwi_state = ao2_alloc(sizeof(*mwi_state), mwi_state_dtor);
03124    if (!mwi_state) {
03125       return NULL;
03126    }
03127 
03128    if (ast_string_field_init(mwi_state, 256)) {
03129       return NULL;
03130    }
03131    if (!ast_strlen_zero(context)) {
03132       ast_string_field_build(mwi_state, uniqueid, "%s@%s", mailbox, context);
03133    } else {
03134       ast_string_field_set(mwi_state, uniqueid, mailbox);
03135    }
03136 
03137    ao2_ref(mwi_state, +1);
03138    return mwi_state;
03139 }

struct stasis_cache* ast_mwi_state_cache ( void   )  [read]

struct stasis_message_type* ast_mwi_state_type ( void   )  [read]

struct stasis_topic* ast_mwi_topic ( const char *  uniqueid  )  [read]

Get the Stasis Message Bus API topic for MWI messages on a unique ID.

Parameters:
uniqueid The unique id for which to get the topic
Return values:
The topic structure for MWI messages for a given uniqueid
NULL if it failed to be found or allocated
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 3112 of file main/app.c.

References mwi_topic_pool, and stasis_topic_pool_get_topic().

Referenced by add_peer_mwi_subs(), ast_delete_mwi_state_full(), ast_publish_mwi_state_full(), build_gateway(), build_peer(), config_line(), mkintf(), mwi_stasis_subscription_alloc(), and notify_new_message().

03113 {
03114    return stasis_topic_pool_get_topic(mwi_topic_pool, uniqueid);
03115 }

struct stasis_topic* ast_mwi_topic_all ( void   )  [read]

Get the Stasis Message Bus API topic for MWI messages.

Return values:
The topic structure for MWI messages
NULL if it has not been allocated
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 3097 of file main/app.c.

References mwi_topic_all.

Referenced by asterisk_start_mwi_publishing(), manager_mwi_init(), mwi_event_cb(), start_poll_thread(), and xmpp_init_event_distribution().

03098 {
03099    return mwi_topic_all;
03100 }

struct stasis_topic* ast_mwi_topic_cached ( void   )  [read]

Get the Stasis Message Bus API caching topic for MWI messages.

Return values:
The caching topic structure for MWI messages
NULL if it has not been allocated
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 3107 of file main/app.c.

References mwi_topic_cached, and stasis_caching_get_topic().

03108 {
03109    return stasis_caching_get_topic(mwi_topic_cached);
03110 }

struct stasis_message_type* ast_mwi_vm_app_type ( void   )  [read]

Get the Stasis Message Bus API message type for voicemail application specific messages.

This message type exists for those messages a voicemail application may wish to send that have no logical relationship with other voicemail applications. Voicemail apps that use this message type must pass a ast_mwi_blob. Any extraneous information in the JSON blob must be packed as key/value pair tuples of strings.

At least one key/value tuple must have a key value of "Event".

Return values:
The stasis_message_type for voicemail application specific messages
NULL on error
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Referenced by app_cleanup(), app_init(), manager_mwi_init(), and notify_new_message().

struct stasis_message_type* ast_parked_call_type ( void   )  [read]

accessor for the parked call stasis message type

Since:
12
Return values:
NULL if the parking topic hasn't been created or has been canceled
a pointer to the parked call message type

Referenced by ast_cdr_engine_init(), ast_parking_stasis_init(), create_routes(), parker_update_cb(), parking_event_cb(), parking_stasis_cleanup(), publish_parked_call(), and publish_parked_call_failure().

struct stasis_topic* ast_parking_topic ( void   )  [read]

accessor for the parking stasis topic

Since:
12
Return values:
NULL if the parking topic hasn't been created or has been disabled
a pointer to the parking topic

Definition at line 69 of file parking.c.

Referenced by create_parked_subscription_full(), create_subscriptions(), park_and_announce_app_exec(), parking_manager_enable_stasis(), publish_parked_call(), and publish_parked_call_failure().

00070 {
00071    return parking_topic;
00072 }

void ast_publish_channel_state ( struct ast_channel chan  ) 

Publish in the ast_channel_topic a ast_channel_snapshot message indicating a change in channel state.

Since:
12
Precondition:
chan is locked
Parameters:
chan The channel whose state has changed

Definition at line 849 of file stasis_channels.c.

References ao2_cleanup, ast_assert, ast_channel_snapshot_create(), ast_channel_snapshot_type(), ast_channel_topic(), NULL, RAII_VAR, ast_channel_blob::snapshot, stasis_message_create(), and stasis_publish().

Referenced by ast_setstate(), onCallEstablished(), and ooh323_new().

00850 {
00851    RAII_VAR(struct ast_channel_snapshot *, snapshot, NULL, ao2_cleanup);
00852    RAII_VAR(struct stasis_message *, message, NULL, ao2_cleanup);
00853 
00854    if (!ast_channel_snapshot_type()) {
00855       return;
00856    }
00857 
00858    ast_assert(chan != NULL);
00859    if (!chan) {
00860       return;
00861    }
00862 
00863    snapshot = ast_channel_snapshot_create(chan);
00864    if (!snapshot) {
00865       return;
00866    }
00867 
00868    message = stasis_message_create(ast_channel_snapshot_type(), snapshot);
00869    if (!message) {
00870       return;
00871    }
00872 
00873    ast_assert(ast_channel_topic(chan) != NULL);
00874    stasis_publish(ast_channel_topic(chan), message);
00875 }

struct stasis_topic* ast_queue_topic ( const char *  queuename  )  [read]

Get the Stasis Message Bus API topic for queue messages for a particular queue name.

Parameters:
queuename The name for which to get the topic
Return values:
The topic structure for queue messages for a given name
NULL if it failed to be found or allocated
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 3343 of file main/app.c.

References queue_topic_pool, and stasis_topic_pool_get_topic().

Referenced by send_agent_complete().

03344 {
03345    return stasis_topic_pool_get_topic(queue_topic_pool, queuename);
03346 }

struct stasis_topic* ast_queue_topic_all ( void   )  [read]

Get the Stasis Message Bus API topic for queue messages.

Return values:
The topic structure for queue messages
NULL if it has not been allocated
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 3338 of file main/app.c.

References queue_topic_all.

Referenced by load_module().

03339 {
03340    return queue_topic_all;
03341 }

struct stasis_message_type* ast_rtp_rtcp_received_type ( void   )  [read]

Message type for an RTCP message received from some external source.

Since:
12
Return values:
A stasis message type

Referenced by ast_rtcp_read(), ast_rtp_engine_init(), rtcp_report_to_ami(), rtp_engine_shutdown(), and rtp_topic_handler().

struct stasis_message_type* ast_rtp_rtcp_sent_type ( void   )  [read]

Message type for an RTCP message sent from this Asterisk instance.

Since:
12
Return values:
A stasis message type

Referenced by ast_rtcp_write_report(), ast_rtp_engine_init(), rtp_engine_shutdown(), and rtp_topic_handler().

struct stasis_topic* ast_rtp_topic ( void   )  [read]

Stasis Message Bus API topic for RTP and RTCP related messages

Since:
12
Return values:
A Stasis Message Bus API topic

Definition at line 2053 of file rtp_engine.c.

Referenced by ast_rtp_publish_rtcp_message(), load_module(), and manager_subscriptions_init().

02054 {
02055    return rtp_topic;
02056 }

struct stasis_message* stasis_cache_clear_create ( struct stasis_message message  )  [read]

A message which instructs the caching topic to remove an entry from its cache.

Parameters:
message Message representative of the cache entry that should be cleared. This will become the data held in the stasis_cache_clear message.
Returns:
Message which, when sent to a stasis_caching_topic, will clear the item from the cache.

NULL on error.

Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 740 of file stasis_cache.c.

References stasis_cache_clear_type(), and stasis_message_create().

Referenced by ast_delete_mwi_state_full(), ast_device_state_clear_cache(), ast_endpoint_shutdown(), AST_TEST_DEFINE(), destroy_bridge(), publish_cache_clear(), and remove_device_states_cb().

00741 {
00742    return stasis_message_create(stasis_cache_clear_type(), id_message);
00743 }

struct stasis_message_type* stasis_cache_clear_type ( void   )  [read]

struct stasis_cache* stasis_cache_create ( snapshot_get_id  id_fn  )  [read]

Create a cache.

This is the backend store for a stasis_caching_topic. The cache is thread safe, allowing concurrent reads and writes.

The returned object is AO2 managed, so ao2_cleanup() when you're done.

Parameters:
id_fn Callback to extract the id from a snapshot message.
Return values:
New cache indexed by id_fn.
\c NULL on error
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 322 of file stasis_cache.c.

References NULL, and stasis_cache_create_full().

Referenced by app_init(), ast_presence_state_engine_init(), ast_stasis_channels_init(), AST_TEST_DEFINE(), and stasis_cp_all_create().

00323 {
00324    return stasis_cache_create_full(id_fn, NULL, NULL);
00325 }

struct stasis_cache* stasis_cache_create_full ( snapshot_get_id  id_fn,
cache_aggregate_calc_fn  aggregate_calc_fn,
cache_aggregate_publish_fn  aggregate_publish_fn 
) [read]

Create a cache.

This is the backend store for a stasis_caching_topic. The cache is thread safe, allowing concurrent reads and writes.

The returned object is AO2 managed, so ao2_cleanup() when you're done.

Parameters:
id_fn Callback to extract the id from a snapshot message.
aggregate_calc_fn Callback to calculate the aggregate cache entry.
aggregate_publish_fn Callback to publish the aggregate cache entry.
Note:
An aggregate message is a combined representation of the local and remote entities publishing the message data. e.g., An aggregate device state represents the combined device state from the local and any remote entities publishing state for a device. e.g., An aggregate MWI message is the old/new MWI counts accumulated from the local and any remote entities publishing to a mailbox.
Return values:
New cache indexed by id_fn.
\c NULL on error
Since:
12.2.0

Definition at line 296 of file stasis_cache.c.

References stasis_cache::aggregate_calc_fn, stasis_cache::aggregate_publish_fn, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_alloc_options, ao2_cleanup, ao2_container_alloc_hash, cache, cache_dtor(), cache_entry_cmp(), cache_entry_hash(), stasis_cache::entries, stasis_cache::id_fn, NULL, and NUM_CACHE_BUCKETS.

Referenced by AST_TEST_DEFINE(), devstate_init(), and stasis_cache_create().

00299 {
00300    struct stasis_cache *cache;
00301 
00302    cache = ao2_alloc_options(sizeof(*cache), cache_dtor,
00303       AO2_ALLOC_OPT_LOCK_NOLOCK);
00304    if (!cache) {
00305       return NULL;
00306    }
00307 
00308    cache->entries = ao2_container_alloc_hash(AO2_ALLOC_OPT_LOCK_RWLOCK, 0,
00309       NUM_CACHE_BUCKETS, cache_entry_hash, NULL, cache_entry_cmp);
00310    if (!cache->entries) {
00311       ao2_cleanup(cache);
00312       return NULL;
00313    }
00314 
00315    cache->id_fn = id_fn;
00316    cache->aggregate_calc_fn = aggregate_calc_fn;
00317    cache->aggregate_publish_fn = aggregate_publish_fn;
00318 
00319    return cache;
00320 }

struct ao2_container* stasis_cache_dump ( struct stasis_cache cache,
struct stasis_message_type type 
) [read]

Dump cached items to a subscription for the ast_eid_default entity.

Parameters:
cache The cache to query.
type Type of message to dump (any type if NULL).
Return values:
ao2_container containing all matches (must be unreffed by caller)
\c NULL on allocation error
Since:
12

Definition at line 698 of file stasis_cache.c.

References ast_eid_default, and stasis_cache_dump_by_eid().

Referenced by action_coreshowchannels(), action_presencestatelist(), ast_ari_bridges_list(), ast_ari_channels_list(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_complete_channels(), AST_TEST_DEFINE(), asterisk_publication_devicestate_refresh(), asterisk_publication_mwi_refresh(), asterisk_start_devicestate_publishing(), asterisk_start_mwi_publishing(), complete_bridge_stasis(), handle_bridge_show_all(), handle_chanlist(), manager_bridges_list(), start_poll_thread(), and xmpp_init_event_distribution().

00699 {
00700    return stasis_cache_dump_by_eid(cache, type, &ast_eid_default);
00701 }

struct ao2_container* stasis_cache_dump_all ( struct stasis_cache cache,
struct stasis_message_type type 
) [read]

Dump all entity items from the cache to a subscription.

Since:
12.2.0
Parameters:
cache The cache to query.
type Type of message to dump (any type if NULL).
Return values:
ao2_container containing all matches (must be unreffed by caller)
\c NULL on allocation error

Definition at line 719 of file stasis_cache.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_callback, ao2_container_alloc_list, ast_assert, cache_dump_all_cb(), cache_dump_data::container, cache_dump_data::eid, stasis_cache::entries, NULL, OBJ_MULTIPLE, OBJ_NODATA, and cache_dump_data::type.

Referenced by AST_TEST_DEFINE(), and cache_cleanup().

00720 {
00721    struct cache_dump_data cache_dump;
00722 
00723    ast_assert(cache != NULL);
00724    ast_assert(cache->entries != NULL);
00725 
00726    cache_dump.eid = NULL;
00727    cache_dump.type = type;
00728    cache_dump.container = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0, NULL, NULL);
00729    if (!cache_dump.container) {
00730       return NULL;
00731    }
00732 
00733    ao2_callback(cache->entries, OBJ_MULTIPLE | OBJ_NODATA, cache_dump_all_cb, &cache_dump);
00734    return cache_dump.container;
00735 }

struct ao2_container* stasis_cache_dump_by_eid ( struct stasis_cache cache,
struct stasis_message_type type,
const struct ast_eid eid 
) [read]

Dump cached items to a subscription for a specific entity.

Since:
12.2.0
Parameters:
cache The cache to query.
type Type of message to dump (any type if NULL).
eid Specific entity id to retrieve. NULL for aggregate.
Return values:
ao2_container containing all matches (must be unreffed by caller)
\c NULL on allocation error

Definition at line 680 of file stasis_cache.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_callback, ao2_container_alloc_list, ast_assert, cache_dump_by_eid_cb(), cache_dump_data::container, cache_dump_data::eid, stasis_cache::entries, NULL, OBJ_MULTIPLE, OBJ_NODATA, and cache_dump_data::type.

Referenced by action_devicestatelist(), AST_TEST_DEFINE(), cpg_confchg_cb(), and stasis_cache_dump().

00681 {
00682    struct cache_dump_data cache_dump;
00683 
00684    ast_assert(cache != NULL);
00685    ast_assert(cache->entries != NULL);
00686 
00687    cache_dump.eid = eid;
00688    cache_dump.type = type;
00689    cache_dump.container = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0, NULL, NULL);
00690    if (!cache_dump.container) {
00691       return NULL;
00692    }
00693 
00694    ao2_callback(cache->entries, OBJ_MULTIPLE | OBJ_NODATA, cache_dump_by_eid_cb, &cache_dump);
00695    return cache_dump.container;
00696 }

struct stasis_message* stasis_cache_entry_get_aggregate ( struct stasis_cache_entry entry  )  [read]

Get the aggregate cache entry snapshot.

Since:
12.2.0
Parameters:
entry Cache entry to get the aggregate snapshot.
Note:
A reference is not given to the returned pointer so don't unref it.

An aggregate message is a combined representation of the local and remote entities publishing the message data. e.g., An aggregate device state represents the combined device state from the local and any remote entities publishing state for a device. e.g., An aggregate MWI message is the old/new MWI counts accumulated from the local and any remote entities publishing to a mailbox.

Return values:
Aggregate-snapshot in cache.
NULL if not present.

Definition at line 327 of file stasis_cache.c.

References stasis_cache_entry::aggregate.

Referenced by cache_test_aggregate_calc_fn(), and device_state_aggregate_calc().

00328 {
00329    return entry->aggregate;
00330 }

struct stasis_message* stasis_cache_entry_get_local ( struct stasis_cache_entry entry  )  [read]

Get the local entity's cache entry snapshot.

Since:
12.2.0
Parameters:
entry Cache entry to get the local entity's snapshot.
Note:
A reference is not given to the returned pointer so don't unref it.
Return values:
Internal-snapshot in cache.
NULL if not present.

Definition at line 332 of file stasis_cache.c.

References stasis_cache_entry::local.

Referenced by cache_test_aggregate_calc_fn(), and device_state_aggregate_calc().

00333 {
00334    return entry->local;
00335 }

struct stasis_message* stasis_cache_entry_get_remote ( struct stasis_cache_entry entry,
int  idx 
) [read]

Get a remote entity's cache entry snapshot by index.

Since:
12.2.0
Parameters:
entry Cache entry to get a remote entity's snapshot.
idx Which remote entity's snapshot to get.
Note:
A reference is not given to the returned pointer so don't unref it.
Return values:
Remote-entity-snapshot in cache.
NULL if not present.

Definition at line 337 of file stasis_cache.c.

References AST_VECTOR_GET, AST_VECTOR_SIZE, and NULL.

Referenced by cache_test_aggregate_calc_fn(), and device_state_aggregate_calc().

00338 {
00339    if (idx < AST_VECTOR_SIZE(&entry->remote)) {
00340       return AST_VECTOR_GET(&entry->remote, idx);
00341    }
00342    return NULL;
00343 }

struct stasis_message* stasis_cache_get ( struct stasis_cache cache,
struct stasis_message_type type,
const char *  id 
) [read]

Retrieve an item from the cache for the ast_eid_default entity.

The returned item is AO2 managed, so ao2_cleanup() when you're done with it.

Parameters:
cache The cache to query.
type Type of message to retrieve.
id Identity of the snapshot to retrieve.
Return values:
Message from the cache.
\c NULL if message is not found.
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 648 of file stasis_cache.c.

References ast_eid_default, and stasis_cache_get_by_eid().

Referenced by ast_ari_channels_get(), ast_bridge_snapshot_get_latest(), ast_channel_snapshot_get_latest(), ast_channel_snapshot_get_latest_by_name(), ast_endpoint_latest_snapshot(), AST_TEST_DEFINE(), bridge_show_specific_print_channel(), chan_pjsip_devicestate(), get_cached_mwi(), get_message_count(), handle_bridge_show_specific(), handle_channelstatus(), has_voicemail(), manager_bridge_info(), mwi_state_create_message(), presence_state_cached(), send_bridge_info_item_cb(), stasis_app_control_get_snapshot(), unistim_send_mwi_to_peer(), and update_registry().

00649 {
00650    return stasis_cache_get_by_eid(cache, type, id, &ast_eid_default);
00651 }

struct ao2_container* stasis_cache_get_all ( struct stasis_cache cache,
struct stasis_message_type type,
const char *  id 
) [read]

Retrieve all matching entity items from the cache.

Since:
12.2.0
Parameters:
cache The cache to query.
type Type of message to retrieve.
id Identity of the snapshot to retrieve.
Return values:
Container of matching items found.
\c NULL if error.

Definition at line 549 of file stasis_cache.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, ao2_container_alloc_list, ao2_rdlock, ao2_unlock, ast_assert, cache_entry_dump(), cache_find(), stasis_cache::entries, and NULL.

Referenced by AST_TEST_DEFINE().

00550 {
00551    struct stasis_cache_entry *cached_entry;
00552    struct ao2_container *found;
00553 
00554    ast_assert(cache != NULL);
00555    ast_assert(cache->entries != NULL);
00556    ast_assert(id != NULL);
00557 
00558    if (!type) {
00559       return NULL;
00560    }
00561 
00562    found = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0, NULL, NULL);
00563    if (!found) {
00564       return NULL;
00565    }
00566 
00567    ao2_rdlock(cache->entries);
00568 
00569    cached_entry = cache_find(cache->entries, type, id);
00570    if (cached_entry && cache_entry_dump(found, cached_entry)) {
00571       ao2_cleanup(found);
00572       found = NULL;
00573    }
00574 
00575    ao2_unlock(cache->entries);
00576 
00577    ao2_cleanup(cached_entry);
00578    return found;
00579 }

struct stasis_message* stasis_cache_get_by_eid ( struct stasis_cache cache,
struct stasis_message_type type,
const char *  id,
const struct ast_eid eid 
) [read]

Retrieve an item from the cache for a specific entity.

The returned item is AO2 managed, so ao2_cleanup() when you're done with it.

Parameters:
cache The cache to query.
type Type of message to retrieve.
id Identity of the snapshot to retrieve.
eid Specific entity id to retrieve. NULL for aggregate.
Note:
An aggregate message is a combined representation of the local and remote entities publishing the message data. e.g., An aggregate device state represents the combined device state from the local and any remote entities publishing state for a device. e.g., An aggregate MWI message is the old/new MWI counts accumulated from the local and any remote entities publishing to a mailbox.
Return values:
Message from the cache.
\c NULL if message is not found.
Since:
12.2.0
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 621 of file stasis_cache.c.

References ao2_bump, ao2_cleanup, ao2_rdlock, ao2_unlock, ast_assert, cache_entry_by_eid(), cache_find(), stasis_cache::entries, and NULL.

Referenced by ast_delete_mwi_state_full(), ast_device_state_clear_cache(), AST_TEST_DEFINE(), check_cache_aggregate(), devstate_cached(), and stasis_cache_get().

00622 {
00623    struct stasis_cache_entry *cached_entry;
00624    struct stasis_message *snapshot = NULL;
00625 
00626    ast_assert(cache != NULL);
00627    ast_assert(cache->entries != NULL);
00628    ast_assert(id != NULL);
00629 
00630    if (!type) {
00631       return NULL;
00632    }
00633 
00634    ao2_rdlock(cache->entries);
00635 
00636    cached_entry = cache_find(cache->entries, type, id);
00637    if (cached_entry) {
00638       snapshot = cache_entry_by_eid(cached_entry, eid);
00639       ao2_bump(snapshot);
00640    }
00641 
00642    ao2_unlock(cache->entries);
00643 
00644    ao2_cleanup(cached_entry);
00645    return snapshot;
00646 }

int stasis_cache_init ( void   ) 

Definition at line 919 of file stasis_cache.c.

References ast_register_cleanup(), stasis_cache_cleanup(), stasis_cache_clear_type(), stasis_cache_update_type(), and STASIS_MESSAGE_TYPE_INIT.

Referenced by stasis_init().

00920 {
00921    ast_register_cleanup(stasis_cache_cleanup);
00922 
00923    if (STASIS_MESSAGE_TYPE_INIT(stasis_cache_clear_type) != 0) {
00924       return -1;
00925    }
00926 
00927    if (STASIS_MESSAGE_TYPE_INIT(stasis_cache_update_type) != 0) {
00928       return -1;
00929    }
00930 
00931    return 0;
00932 }

struct stasis_message_type* stasis_cache_update_type ( void   )  [read]

struct stasis_topic* stasis_caching_get_topic ( struct stasis_caching_topic caching_topic  )  [read]

Returns the topic of cached events from a caching topics.

Parameters:
caching_topic The caching topic.
Returns:
The topic that publishes cache update events, along with passthrough events from the underlying topic.

NULL if caching_topic is NULL.

Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 84 of file stasis_cache.c.

References stasis_caching_topic::topic.

Referenced by ast_device_state_topic_cached(), ast_mwi_topic_cached(), ast_presence_state_topic_cached(), AST_TEST_DEFINE(), stasis_cp_single_create(), and stasis_cp_single_topic_cached().

00085 {
00086    return caching_topic->topic;
00087 }

struct stasis_caching_topic* stasis_caching_topic_create ( struct stasis_topic original_topic,
struct stasis_cache cache 
) [read]

Create a topic which monitors and caches messages from another topic.

The idea is that some topics publish 'snapshots' of some other object's state that should be cached. When these snapshot messages are received, the cache is updated, and a stasis_cache_update() message is forwarded, which has both the original snapshot message and the new message.

The returned object is AO2 managed, so ao2_cleanup() when done with it.

Parameters:
original_topic Topic publishing snapshot messages.
cache Backend cache in which to keep snapshots.
Returns:
New topic which changes snapshot messages to stasis_cache_update() messages, and forwards all other messages from the original topic.

NULL on error

Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 871 of file stasis_cache.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_ref, ast_asprintf, ast_free, caching_topic_exec(), internal_stasis_subscribe(), NULL, RAII_VAR, stasis_caching_topic_dtor(), stasis_topic_create(), stasis_topic_name(), and sub.

Referenced by app_init(), ast_presence_state_engine_init(), ast_stasis_channels_init(), AST_TEST_DEFINE(), devstate_init(), and stasis_cp_single_create().

00872 {
00873    RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
00874    struct stasis_subscription *sub;
00875    RAII_VAR(char *, new_name, NULL, ast_free);
00876    int ret;
00877 
00878    ret = ast_asprintf(&new_name, "%s-cached", stasis_topic_name(original_topic));
00879    if (ret < 0) {
00880       return NULL;
00881    }
00882 
00883    caching_topic = ao2_alloc_options(sizeof(*caching_topic),
00884       stasis_caching_topic_dtor, AO2_ALLOC_OPT_LOCK_NOLOCK);
00885    if (caching_topic == NULL) {
00886       return NULL;
00887    }
00888 
00889    caching_topic->topic = stasis_topic_create(new_name);
00890    if (caching_topic->topic == NULL) {
00891       return NULL;
00892    }
00893 
00894    ao2_ref(cache, +1);
00895    caching_topic->cache = cache;
00896 
00897    sub = internal_stasis_subscribe(original_topic, caching_topic_exec, caching_topic, 0, 0);
00898    if (sub == NULL) {
00899       return NULL;
00900    }
00901 
00902    ao2_ref(original_topic, +1);
00903    caching_topic->original_topic = original_topic;
00904 
00905    /* This is for the reference contained in the subscription above */
00906    ao2_ref(caching_topic, +1);
00907    caching_topic->sub = sub;
00908 
00909    /* The subscription holds the reference, so no additional ref bump. */
00910    return caching_topic;
00911 }

struct stasis_caching_topic* stasis_caching_unsubscribe ( struct stasis_caching_topic caching_topic  )  [read]

Unsubscribes a caching topic from its upstream topic.

This function returns immediately, so be sure to cleanup when stasis_subscription_final_message() is received.

Parameters:
caching_topic Caching topic to unsubscribe
Returns:
NULL for convenience
Since:
12

Definition at line 89 of file stasis_cache.c.

References ao2_cleanup, ao2_ref, ast_log, LOG_ERROR, NULL, stasis_subscription_is_subscribed(), stasis_unsubscribe(), and stasis_caching_topic::sub.

Referenced by AST_TEST_DEFINE(), stasis_caching_unsubscribe_and_join(), and stasis_cp_single_unsubscribe().

00090 {
00091    if (!caching_topic) {
00092       return NULL;
00093    }
00094 
00095    /*
00096     * The subscription may hold the last reference to this caching
00097     * topic, but we want to make sure the unsubscribe finishes
00098     * before kicking of the caching topic's dtor.
00099     */
00100    ao2_ref(caching_topic, +1);
00101 
00102    if (stasis_subscription_is_subscribed(caching_topic->sub)) {
00103       /*
00104        * Increment the reference to hold on to it past the
00105        * unsubscribe. Will be cleaned up in dtor.
00106        */
00107       ao2_ref(caching_topic->sub, +1);
00108       stasis_unsubscribe(caching_topic->sub);
00109    } else {
00110       ast_log(LOG_ERROR, "stasis_caching_topic unsubscribed multiple times\n");
00111    }
00112    ao2_cleanup(caching_topic);
00113    return NULL;
00114 }

struct stasis_caching_topic* stasis_caching_unsubscribe_and_join ( struct stasis_caching_topic caching_topic  )  [read]

Unsubscribes a caching topic from its upstream topic, blocking until all messages have been forwarded.

See stasis_unsubscriben_and_join() for more info on when to use this as opposed to stasis_caching_unsubscribe().

Parameters:
caching_topic Caching topic to unsubscribe
Returns:
NULL for convenience
Since:
12
Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 116 of file stasis_cache.c.

References ao2_cleanup, ao2_ref, NULL, stasis_caching_unsubscribe(), stasis_subscription_join(), and stasis_caching_topic::sub.

Referenced by app_cleanup(), AST_TEST_DEFINE(), devstate_cleanup(), presence_state_engine_cleanup(), and stasis_channels_cleanup().

00117 {
00118    if (!caching_topic) {
00119       return NULL;
00120    }
00121 
00122    /* Hold a ref past the unsubscribe */
00123    ao2_ref(caching_topic, +1);
00124    stasis_caching_unsubscribe(caching_topic);
00125    stasis_subscription_join(caching_topic->sub);
00126    ao2_cleanup(caching_topic);
00127    return NULL;
00128 }

int stasis_config_init ( void   ) 

int stasis_init ( void   ) 

Initialize the Stasis subsystem.

Returns:
0 on success.

Non-zero on error.

Since:
12

Definition at line 1547 of file stasis.c.

References ACO_EXACT, aco_info_init(), aco_option_register, aco_option_register_custom, aco_process_config(), ACO_PROCESS_ERROR, aco_set_defaults(), ao2_cleanup, ao2_global_obj_ref, ao2_global_obj_replace_unref, ao2_ref, ast_log, ast_multi_user_event_type(), ast_register_cleanup(), ast_threadpool_create(), AST_THREADPOOL_OPTIONS_VERSION, ast_threadpool_options::auto_increment, declined_handler(), stasis_config::declined_message_types, declined_option, declined_options, FLDSET, globals, ast_threadpool_options::idle_timeout, ast_threadpool_options::initial_size, LOG_ERROR, LOG_NOTICE, ast_threadpool_options::max_size, NULL, OPT_INT_T, PARSE_IN_RANGE, RAII_VAR, stasis_cache_init(), stasis_cleanup(), stasis_config_alloc(), STASIS_MESSAGE_TYPE_INIT, stasis_subscription_change_type(), threadpool_option, stasis_config::threadpool_options, threadpool_options, and ast_threadpool_options::version.

Referenced by main().

01548 {
01549    RAII_VAR(struct stasis_config *, cfg, NULL, ao2_cleanup);
01550    int cache_init;
01551    struct ast_threadpool_options threadpool_opts = { 0, };
01552 
01553    /* Be sure the types are cleaned up after the message bus */
01554    ast_register_cleanup(stasis_cleanup);
01555 
01556    if (aco_info_init(&cfg_info)) {
01557       return -1;
01558    }
01559 
01560    aco_option_register_custom(&cfg_info, "decline", ACO_EXACT,
01561       declined_options, "", declined_handler, 0);
01562    aco_option_register(&cfg_info, "initial_size", ACO_EXACT,
01563       threadpool_options, "5", OPT_INT_T, PARSE_IN_RANGE,
01564       FLDSET(struct stasis_threadpool_conf, initial_size), 0,
01565       INT_MAX);
01566    aco_option_register(&cfg_info, "idle_timeout_sec", ACO_EXACT,
01567       threadpool_options, "20", OPT_INT_T, PARSE_IN_RANGE,
01568       FLDSET(struct stasis_threadpool_conf, idle_timeout_sec), 0,
01569       INT_MAX);
01570    aco_option_register(&cfg_info, "max_size", ACO_EXACT,
01571       threadpool_options, "50", OPT_INT_T, PARSE_IN_RANGE,
01572       FLDSET(struct stasis_threadpool_conf, max_size), 0,
01573       INT_MAX);
01574 
01575    if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
01576       struct stasis_config *default_cfg = stasis_config_alloc();
01577 
01578       if (!default_cfg) {
01579          return -1;
01580       }
01581 
01582       if (aco_set_defaults(&threadpool_option, "threadpool", default_cfg->threadpool_options)) {
01583          ast_log(LOG_ERROR, "Failed to initialize defaults on Stasis configuration object\n");
01584          ao2_ref(default_cfg, -1);
01585          return -1;
01586       }
01587 
01588       if (aco_set_defaults(&declined_option, "declined_message_types", default_cfg->declined_message_types)) {
01589          ast_log(LOG_ERROR, "Failed to load stasis.conf and failed to initialize defaults.\n");
01590          return -1;
01591       }
01592 
01593       ast_log(LOG_NOTICE, "Could not load Stasis configuration; using defaults\n");
01594       ao2_global_obj_replace_unref(globals, default_cfg);
01595       cfg = default_cfg;
01596    } else {
01597       cfg = ao2_global_obj_ref(globals);
01598       if (!cfg) {
01599          ast_log(LOG_ERROR, "Failed to obtain Stasis configuration object\n");
01600          return -1;
01601       }
01602    }
01603 
01604    threadpool_opts.version = AST_THREADPOOL_OPTIONS_VERSION;
01605    threadpool_opts.initial_size = cfg->threadpool_options->initial_size;
01606    threadpool_opts.auto_increment = 1;
01607    threadpool_opts.max_size = cfg->threadpool_options->max_size;
01608    threadpool_opts.idle_timeout = cfg->threadpool_options->idle_timeout_sec;
01609    pool = ast_threadpool_create("stasis-core", NULL, &threadpool_opts);
01610    if (!pool) {
01611       ast_log(LOG_ERROR, "Failed to create 'stasis-core' threadpool\n");
01612       return -1;
01613    }
01614 
01615    cache_init = stasis_cache_init();
01616    if (cache_init != 0) {
01617       return -1;
01618    }
01619 
01620    if (STASIS_MESSAGE_TYPE_INIT(stasis_subscription_change_type) != 0) {
01621       return -1;
01622    }
01623    if (STASIS_MESSAGE_TYPE_INIT(ast_multi_user_event_type) != 0) {
01624       return -1;
01625    }
01626 
01627    return 0;
01628 }

void stasis_log_bad_type_access ( const char *  name  ) 

Definition at line 1158 of file stasis.c.

References ast_log, and LOG_ERROR.

01159 {
01160 #ifdef AST_DEVMODE
01161    ast_log(LOG_ERROR, "Use of %s() before init/after destruction\n", name);
01162 #endif
01163 }

struct stasis_message_type* stasis_subscription_change_type ( void   )  [read]

struct stasis_message* stasis_test_message_create ( void   )  [read]

Creates a test message.

Definition at line 250 of file res_stasis_test.c.

References ao2_alloc, ao2_cleanup, stasis_message::data, NULL, RAII_VAR, stasis_message_create(), and stasis_test_message_type().

00251 {
00252    RAII_VAR(void *, data, NULL, ao2_cleanup);
00253 
00254    if (!stasis_test_message_type()) {
00255       return NULL;
00256    }
00257 
00258    /* We just need the unique pointer; don't care what's in it */
00259    data = ao2_alloc(1, NULL);
00260    if (!data) {
00261       return NULL;
00262    }
00263 
00264    return stasis_message_create(stasis_test_message_type(), data);
00265 }

struct stasis_message_type* stasis_test_message_type ( void   )  [read]

Gets the type of messages created by stasis_test_message_create().

Referenced by load_module(), stasis_test_message_create(), and unload_module().

struct stasis_topic_pool* stasis_topic_pool_create ( struct stasis_topic pooled_topic  )  [read]

Create a topic pool that routes messages from dynamically generated topics to the given topic.

Parameters:
pooled_topic Topic to which messages will be routed
Returns:
the new stasis_topic_pool

NULL on failure

Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 1105 of file stasis.c.

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_container_alloc, ao2_ref, NULL, stasis_topic_pool::pool_container, stasis_topic_pool::pool_topic, TOPIC_POOL_BUCKETS, topic_pool_dtor(), topic_pool_entry_cmp(), and topic_pool_entry_hash().

Referenced by app_init(), and devstate_init().

01106 {
01107    struct stasis_topic_pool *pool;
01108 
01109    pool = ao2_alloc_options(sizeof(*pool), topic_pool_dtor, AO2_ALLOC_OPT_LOCK_NOLOCK);
01110    if (!pool) {
01111       return NULL;
01112    }
01113 
01114    pool->pool_container = ao2_container_alloc(TOPIC_POOL_BUCKETS,
01115       topic_pool_entry_hash, topic_pool_entry_cmp);
01116    if (!pool->pool_container) {
01117       ao2_cleanup(pool);
01118       return NULL;
01119    }
01120    ao2_ref(pooled_topic, +1);
01121    pool->pool_topic = pooled_topic;
01122 
01123    return pool;
01124 }

struct stasis_topic* stasis_topic_pool_get_topic ( struct stasis_topic_pool pool,
const char *  topic_name 
) [read]

Find or create a topic in the pool.

Parameters:
pool Pool for which to get the topic
topic_name Name of the topic to get
Returns:
The already stored or newly allocated topic

NULL if the topic was not found and could not be allocated

Examples:
/tmp/asterisk-trunk/trunk/main/app.c.

Definition at line 1126 of file stasis.c.

References ao2_cleanup, ao2_find, ao2_link_flags, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, stasis_topic_pool::pool_container, stasis_topic_pool::pool_topic, RAII_VAR, SCOPED_AO2LOCK, stasis_forward_all(), stasis_topic_create(), and topic_pool_entry_alloc().

Referenced by ast_device_state_topic(), ast_mwi_topic(), and ast_queue_topic().

01127 {
01128    RAII_VAR(struct topic_pool_entry *, topic_pool_entry, NULL, ao2_cleanup);
01129    SCOPED_AO2LOCK(topic_container_lock, pool->pool_container);
01130 
01131    topic_pool_entry = ao2_find(pool->pool_container, topic_name, OBJ_SEARCH_KEY | OBJ_NOLOCK);
01132    if (topic_pool_entry) {
01133       return topic_pool_entry->topic;
01134    }
01135 
01136    topic_pool_entry = topic_pool_entry_alloc();
01137    if (!topic_pool_entry) {
01138       return NULL;
01139    }
01140 
01141    topic_pool_entry->topic = stasis_topic_create(topic_name);
01142    if (!topic_pool_entry->topic) {
01143       return NULL;
01144    }
01145 
01146    topic_pool_entry->forward = stasis_forward_all(topic_pool_entry->topic, pool->pool_topic);
01147    if (!topic_pool_entry->forward) {
01148       return NULL;
01149    }
01150 
01151    if (!ao2_link_flags(pool->pool_container, topic_pool_entry, OBJ_NOLOCK)) {
01152       return NULL;
01153    }
01154 
01155    return topic_pool_entry->topic;
01156 }


Variable Documentation

struct ast_string_field_mgr __field_mgr [read, inherited]

Definition at line 689 of file stasis.h.

int(* activate)(struct ast_rtp_instance *instance) [inherited]

Callback to indicate that packets will now flow

Referenced by ast_rtp_instance_activate().

int(* active)(struct ast_rtp_instance *instance) [inherited]

Get if the DTLS SRTP support is active or not

Referenced by add_dtls_to_sdp(), ast_sdp_get_rtp_profile(), and process_sdp().

void(* add_remote_candidate)(struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate) [inherited]

Callback for adding a remote candidate

Referenced by jingle_interpret_ice_udp_transport(), process_ice_attributes(), and process_sdp_a_ice().

struct ast_sockaddr address [read, inherited]

int(* allow_rtp_remote)(struct ast_channel *chan1, struct ast_rtp_instance *instance) [inherited]

Used to prevent two channels from remotely bridging audio rtp if the channel tech has a reason for prohibiting it based on qualities that need to be compared from both channels.

Note:
This function may be NULL for a given channel driver. This should be accounted for and if that is the case, function this is not used.

int(* allow_vrtp_remote)(struct ast_channel *chan1, struct ast_rtp_instance *instance) [inherited]

Used to prevent two channels from remotely bridging video rtp if the channel tech has a reason for prohibiting it based on qualities that need to be compared from both channels.

Note:
This function may be NULL for a given channel driver. This should be accounted for and if that is the case, this function is not used.

void(* available_formats)(struct ast_rtp_instance *instance, struct ast_format_cap *to_endpoint, struct ast_format_cap *to_asterisk, struct ast_format_cap *result) [inherited]

Callback to get the transcodeable formats supported. result returned in ast_format_cap *result

Referenced by ast_rtp_instance_available_formats().

char* cafile [inherited]

Certificate authority file

Definition at line 476 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_free(), ast_rtp_dtls_cfg_parse(), dtlscafile_to_str(), and reload_config().

char* capath [inherited]

Path to certificate authority

Definition at line 477 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_free(), ast_rtp_dtls_cfg_parse(), dtlscapath_to_str(), and reload_config().

char* certfile [inherited]

void(* change_source)(struct ast_rtp_instance *instance) [inherited]

Callback to indicate that we should update the marker bit and ssrc

Referenced by ast_rtp_instance_change_source().

int(* channel)(const struct ast_channel *chan) [inherited]

Callback which determines whether a channel should be sanitized from a message based on the channel.

Parameters:
chan The channel to be checked
Return values:
non-zero if the channel should be left out of the message
zero if the channel should remain in the message

Referenced by app_send_end_msg().

int(* channel_snapshot)(const struct ast_channel_snapshot *snapshot) [inherited]

Callback which determines whether a channel should be sanitized from a message based on the channel's snapshot.

Parameters:
snapshot A snapshot generated from the channel
Return values:
non-zero if the channel should be left out of the message
zero if the channel should remain in the message

Referenced by ast_ari_channels_list(), ast_channel_snapshot_to_json(), stasis_end_to_json(), and stasis_start_to_json().

char channel_uniqueid[MAX_CHANNEL_ID] [inherited]

The Asterisk channel's unique ID that owns this instance

Definition at line 358 of file rtp_engine.h.

Referenced by ast_rtp_get_stat().

char* cipher [inherited]

ast_rwlock_t codecs_lock [inherited]

enum ast_rtp_dtls_setup default_setup [inherited]

Default setup type to use for outgoing

Definition at line 469 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_parse(), and dtlssetup_to_str().

const ast_string_field description [inherited]

Definition at line 689 of file stasis.h.

Referenced by AST_TEST_DEFINE(), mwi_event_cb(), and stasis_subscription_final_message().

int(* destroy)(struct ast_rtp_instance *instance) [inherited]

Callback for destroying an RTP instance

Referenced by ast_rtp_engine_register2(), and instance_destructor().

unsigned int dlsr [inherited]

struct ast_rtp_engine_dtls* dtls [read, inherited]

Callback to pointer for optional DTLS SRTP support

Definition at line 574 of file rtp_engine.h.

Referenced by ast_rtp_instance_get_dtls().

int(* dtmf_begin)(struct ast_rtp_instance *instance, char digit) [inherited]

Callback for starting RFC2833 DTMF transmission

Referenced by ast_rtp_instance_dtmf_begin().

int(* dtmf_compatible)(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1) [inherited]

Callback to see if two instances are compatible with DTMF

int(* dtmf_end)(struct ast_rtp_instance *instance, char digit) [inherited]

Callback for stopping RFC2833 DTMF transmission

Referenced by ast_rtp_instance_dtmf_end().

int(* dtmf_end_with_duration)(struct ast_rtp_instance *instance, char digit, unsigned int duration) [inherited]

enum ast_rtp_dtmf_mode(* dtmf_mode_get)(struct ast_rtp_instance *instance) [inherited]

Callback for getting DTMF mode

Referenced by ast_rtp_instance_dtmf_mode_get().

int(* dtmf_mode_set)(struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode) [inherited]

Callback for changing DTMF mode

Referenced by ast_rtp_instance_dtmf_mode_set().

struct { ... } entry [inherited]

Linked list information

struct { ... } entry [inherited]

Linked list information

void*(* extended_prop_get)(struct ast_rtp_instance *instance, int property) [inherited]

Callback for getting an extended RTP property

Referenced by ast_rtp_instance_get_extended_prop().

int(* extended_prop_set)(struct ast_rtp_instance *instance, int property, void *value) [inherited]

Callback for setting an extended RTP property

Referenced by ast_rtp_instance_set_extended_prop().

int(* fd)(struct ast_rtp_instance *instance, int rtcp) [inherited]

Callback for retrieving a file descriptor to poll on, not always required

Referenced by ast_rtp_instance_fd().

struct ast_format* format [read, inherited]

unsigned short fraction [inherited]

Definition at line 269 of file rtp_engine.h.

unsigned int framing [inherited]

void(* get_codec)(struct ast_channel *chan, struct ast_format_cap *result_cap) [inherited]

Callback for retrieving codecs that the channel can do. Result returned in result_cap

Referenced by ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), native_rtp_bridge_compatible(), and native_rtp_bridge_start().

enum ast_rtp_dtls_connection(* get_connection)(struct ast_rtp_instance *instance) [inherited]

Get the current connection state

Referenced by add_crypto_to_stream(), and add_dtls_to_sdp().

const char*(* get_fingerprint)(struct ast_rtp_instance *instance) [inherited]

Get the local fingerprint

Referenced by add_crypto_to_stream(), and add_dtls_to_sdp().

enum ast_rtp_dtls_hash(* get_fingerprint_hash)(struct ast_rtp_instance *instance) [inherited]

Get the local fingerprint hash type

Referenced by add_crypto_to_stream(), and add_dtls_to_sdp().

struct ao2_container*(* get_local_candidates)(struct ast_rtp_instance *instance) [read, inherited]

const char*(* get_password)(struct ast_rtp_instance *instance) [inherited]

enum ast_rtp_glue_result(* get_rtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance) [inherited]

Callback for retrieving the RTP instance carrying audio.

Note:
This function increases the reference count on the returned RTP instance.

Referenced by ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), and ast_rtp_instance_make_compatible().

enum ast_rtp_dtls_setup(* get_setup)(struct ast_rtp_instance *instance) [inherited]

Get the current setup state

Referenced by add_crypto_to_stream(), and add_dtls_to_sdp().

int(* get_stat)(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat) [inherited]

Callback for retrieving statistics

Referenced by ast_rtp_instance_get_stats().

enum ast_rtp_glue_result(* get_trtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance) [inherited]

Callback for retrieving the RTP instance carrying text.

Note:
This function increases the reference count on the returned RTP instance.

const char*(* get_ufrag)(struct ast_rtp_instance *instance) [inherited]

enum ast_rtp_glue_result(* get_vrtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance) [inherited]

Callback for retrieving the RTP instance carrying video.

Note:
This function increases the reference count on the returned RTP instance.

Referenced by ast_rtp_instance_early_bridge(), and ast_rtp_instance_early_bridge_make_compatible().

enum ast_rtp_dtls_hash hash [inherited]

Hash to use for fingerprint

Definition at line 471 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_parse(), and dtlsfingerprint_to_str().

unsigned int highest_seq_no [inherited]

unsigned int ia_jitter [inherited]

struct ast_rtp_engine_ice* ice [read, inherited]

Callback to pointer for optional ICE support

Definition at line 572 of file rtp_engine.h.

Referenced by ast_rtp_instance_get_ice().

void(* ice_lite)(struct ast_rtp_instance *instance) [inherited]

Callback for telling the ICE support that it is talking to an ice-lite implementation

Referenced by jingle_request(), process_ice_attributes(), and process_sdp_a_ice().

enum ast_rtp_ice_component_type id [inherited]

int(* local_bridge)(struct ast_rtp_instance *instance0, struct ast_rtp_instance *instance1) [inherited]

Callback to locally bridge two RTP instances

Referenced by native_rtp_bridge_start(), and native_rtp_bridge_stop().

double local_maxjitter [inherited]

Maximum jitter on local side

Definition at line 316 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double local_maxrxploss [inherited]

Maximum number of packets lost on local side

Definition at line 336 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double local_minjitter [inherited]

Minimum jitter on local side

Definition at line 318 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double local_minrxploss [inherited]

Minimum number of packets lost on local side

Definition at line 338 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double local_normdevjitter [inherited]

Average jitter on local side

Definition at line 320 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double local_normdevrxploss [inherited]

Average number of packets lost on local side

Definition at line 340 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

unsigned int local_ssrc [inherited]

double local_stdevjitter [inherited]

Standard deviation jitter on local side

Definition at line 322 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double local_stdevrxploss [inherited]

Standard deviation packets lost on local side

Definition at line 342 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

struct { ... } lost_count [inherited]

unsigned int lsr [inherited]

int(* make_compatible)(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1) [inherited]

Callback to make two instances compatible

Referenced by ast_rtp_instance_make_compatible().

double maxrtt [inherited]

Maximum round trip time

Definition at line 346 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double minrtt [inherited]

Minimum round trip time

Definition at line 348 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

struct ast_module* mod [read, inherited]

Module that the RTP glue came from

Definition at line 597 of file rtp_engine.h.

Referenced by ast_rtp_glue_register2().

struct ast_module* mod [read, inherited]

Module this RTP engine came from, used for reference counting

Definition at line 509 of file rtp_engine.h.

Referenced by ast_rtp_engine_register2(), ast_rtp_instance_new(), and instance_destructor().

int(* new)(struct ast_rtp_instance *instance, struct ast_sched_context *sched, struct ast_sockaddr *sa, void *data) [inherited]

Callback for setting up a new RTP instance

Referenced by ast_rtp_engine_register2(), and ast_rtp_instance_new().

struct stasis_message* new_snapshot [read, inherited]

struct ast_rtp_glue* next [read, inherited]

Definition at line 631 of file rtp_engine.h.

struct ast_rtp_engine* next [read, inherited]

Definition at line 576 of file rtp_engine.h.

double normdevrtt [inherited]

Average round trip time

Definition at line 350 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

struct timeval ntp_timestamp [read, inherited]

Definition at line 286 of file rtp_engine.h.

unsigned int octet_count [inherited]

Definition at line 289 of file rtp_engine.h.

unsigned int octet_count [inherited]

Definition at line 289 of file rtp_engine.h.

Referenced by rtcp_report_to_ami(), and rtcp_report_to_json().

struct stasis_message* old_snapshot [read, inherited]

unsigned int packet_count [inherited]

Definition at line 288 of file rtp_engine.h.

unsigned int packet_count [inherited]

Definition at line 288 of file rtp_engine.h.

Referenced by rtcp_report_to_ami(), and rtcp_report_to_json().

unsigned int packets [inherited]

Definition at line 270 of file rtp_engine.h.

unsigned int packets [inherited]

int payload [inherited]

void(* payload_set)(struct ast_rtp_instance *instance, int payload, int asterisk_format, struct ast_format *format, int code) [inherited]

Callback for setting a payload. If asterisk is to be used, asterisk_format will be set, otherwise value in code is used.

Referenced by ast_rtp_codecs_payloads_clear(), ast_rtp_codecs_payloads_copy(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), and ast_rtp_codecs_payloads_unset().

int priority [inherited]

Priority which is used if multiple candidates can be used

Definition at line 406 of file rtp_engine.h.

Referenced by add_ice_to_sdp(), add_ice_to_stream(), jingle_add_ice_udp_candidates_to_transport(), jingle_interpret_ice_udp_transport(), process_ice_attributes(), and process_sdp_a_ice().

void(* prop_set)(struct ast_rtp_instance *instance, enum ast_rtp_property property, int value) [inherited]

Callback for setting an RTP property

Referenced by ast_rtp_instance_set_prop().

char* pvtfile [inherited]

int(* qos)(struct ast_rtp_instance *instance, int tos, int cos, const char *desc) [inherited]

Callback for setting QoS values

Referenced by ast_rtp_instance_set_qos().

struct ast_frame*(* read)(struct ast_rtp_instance *instance, int rtcp) [read, inherited]

Callback for reading a frame from the RTP engine

Referenced by ast_rtp_engine_register2(), and ast_rtp_instance_read().

int(* red_buffer)(struct ast_rtp_instance *instance, struct ast_frame *frame) [inherited]

Callback for buffering a frame using RED

Referenced by ast_rtp_red_buffer().

int(* red_init)(struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations) [inherited]

Callback for initializing RED support

Referenced by ast_rtp_red_init().

unsigned int rekey [inherited]

Interval at which to renegotiate and rekey - defaults to 0 (off)

Definition at line 468 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_parse(), and dtlsrekey_to_str().

struct ast_sockaddr relay_address [read, inherited]

Relay address for the candidate

Definition at line 408 of file rtp_engine.h.

Referenced by add_ice_to_sdp(), add_ice_to_stream(), process_ice_attributes(), and process_sdp_a_ice().

void(* remote_address_set)(struct ast_rtp_instance *instance, struct ast_sockaddr *sa) [inherited]

Callback for setting the remote address that RTP is to be sent to

Referenced by ast_rtp_instance_set_incoming_source_address().

double remote_maxjitter [inherited]

Maximum jitter on remote side

Definition at line 308 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double remote_maxrxploss [inherited]

Maximum number of packets lost on remote side

Definition at line 328 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double remote_minjitter [inherited]

Minimum jitter on remote side

Definition at line 310 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double remote_minrxploss [inherited]

Minimum number of packets lost on remote side

Definition at line 330 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double remote_normdevjitter [inherited]

Average jitter on remote side

Definition at line 312 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double remote_normdevrxploss [inherited]

Average number of packets lost on remote side

Definition at line 332 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

unsigned int remote_ssrc [inherited]

double remote_stdevjitter [inherited]

Standard deviation jitter on remote side

Definition at line 314 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

double remote_stdevrxploss [inherited]

Standard deviation packets lost on remote side

Definition at line 334 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

struct ast_rtp_rtcp_report_block* report_block[0] [read, inherited]

A dynamic array of report blocks. The number of elements is given by reception_report_count.

Definition at line 294 of file rtp_engine.h.

Referenced by rtcp_report_to_ami(), rtcp_report_to_json(), and rtp_rtcp_report_dtor().

void(* reset)(struct ast_rtp_instance *instance) [inherited]

Reset the connection and start fresh

Referenced by apply_dtls_attrib(), and process_sdp_a_dtls().

int rtp_code [inherited]

unsigned int rtp_timestamp [inherited]

Definition at line 287 of file rtp_engine.h.

unsigned int rtp_timestamp [inherited]

Definition at line 287 of file rtp_engine.h.

Referenced by rtcp_report_to_ami(), and rtcp_report_to_json().

double rtt [inherited]

Total round trip time

Definition at line 344 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

unsigned int rxcount [inherited]

Number of packets received

Definition at line 302 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), show_chanstats_cb(), and sip_acf_channel_read().

double rxjitter [inherited]

Jitter on received packets

Definition at line 306 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), show_chanstats_cb(), and sip_acf_channel_read().

unsigned int rxploss [inherited]

Number of received packets lost

Definition at line 326 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), show_chanstats_cb(), and sip_acf_channel_read().

int(* sendcng)(struct ast_rtp_instance *instance, int level) [inherited]

Callback to send CNG

Referenced by ast_rtp_instance_sendcng().

struct { ... } sender_information [inherited]

void(* set_fingerprint)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint) [inherited]

Set the remote fingerprint

Referenced by apply_dtls_attrib(), and process_sdp_a_dtls().

int(* set_read_format)(struct ast_rtp_instance *instance, struct ast_format *format) [inherited]

Callback to set the read format

Referenced by ast_rtp_instance_set_read_format().

void(* set_role)(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role) [inherited]

Callback for changing our role in negotiation

Referenced by process_ice_attributes(), and start_ice().

void(* set_setup)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup) [inherited]

Set the remote setup state

Referenced by apply_dtls_attrib(), and process_sdp_a_dtls().

int(* set_write_format)(struct ast_rtp_instance *instance, struct ast_format *format) [inherited]

Callback to set the write format

Referenced by ast_rtp_instance_set_write_format().

unsigned int ssrc [inherited]

Definition at line 283 of file rtp_engine.h.

Referenced by rtcp_report_to_ami(), and rtcp_report_to_json().

void(* start)(struct ast_rtp_instance *instance) [inherited]

Callback for starting ICE negotiation

Referenced by jingle_interpret_ice_udp_transport(), process_ice_attributes(), and start_ice().

double stdevrtt [inherited]

Standard deviation round trip time

Definition at line 352 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), and sip_acf_channel_read().

void(* stop)(struct ast_rtp_instance *instance) [inherited]

Callback for stopping the RTP instance

Referenced by ast_rtp_instance_stop().

void(* stop)(struct ast_rtp_instance *instance) [inherited]

Stop and terminate DTLS SRTP support

Referenced by process_crypto().

void(* stop)(struct ast_rtp_instance *instance) [inherited]

void(* stun_request)(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username) [inherited]

Callback to request that the RTP engine send a STUN BIND request

Referenced by ast_rtp_instance_stun_request().

enum ast_srtp_suite suite [inherited]

Crypto suite in use

Definition at line 470 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), build_peer(), and setup_dtls_srtp().

struct ast_manager_event_blob*(* to_ami)(struct stasis_message *message) [read, inherited]

Build the AMI representation of the message.

May be NULL, or may return NULL, to indicate no representation. The returned object should be ao2_cleanup()'ed.

Parameters:
message Message to convert to AMI string.
Returns:
Newly allocated ast_manager_event_blob.

NULL on error.

NULL if AMI format is not supported.

struct ast_event*(* to_event)(struct stasis_message *message) [read, inherited]

Build the ast_event representation of the message.

Since:
12.3.0 May be NULL, or may return NULL, to indicate no representation. The returned object should be free'd.
Parameters:
message Message to convert to an ast_event.
Returns:
Newly allocated ast_event.

NULL on error.

NULL if AMI format is not supported.

struct stasis_topic* topic [read, inherited]

The topic the subscription is/was subscribing to

Definition at line 690 of file stasis.h.

Referenced by AST_TEST_DEFINE(), mwi_event_cb(), mwi_sub_event_cb(), subscription_change_alloc(), and subscription_change_dtor().

char* transport [inherited]

void(* turn_request)(struct ast_rtp_instance *instance, enum ast_rtp_ice_component_type component, enum ast_transport transport, const char *server, unsigned int port, const char *username, const char *password) [inherited]

Callback for requesting a TURN session

double txjitter [inherited]

Jitter on transmitted packets

Definition at line 304 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), show_chanstats_cb(), and sip_acf_channel_read().

unsigned int txploss [inherited]

Number of transmitted packets lost

Definition at line 324 of file rtp_engine.h.

Referenced by ast_rtp_get_stat(), ast_rtp_instance_get_quality(), channel_read_rtcp(), show_chanstats_cb(), and sip_acf_channel_read().

enum ast_rtp_ice_candidate_type type [inherited]

unsigned int type [inherited]

Definition at line 284 of file rtp_engine.h.

Referenced by rtcp_report_to_ami(), and rtcp_report_to_json().

const ast_string_field uniqueid [inherited]

int(* update_peer)(struct ast_channel *chan, struct ast_rtp_instance *instance, struct ast_rtp_instance *vinstance, struct ast_rtp_instance *tinstance, const struct ast_format_cap *cap, int nat_active) [inherited]

Callback for updating the destination that the remote side should send RTP to

Referenced by ast_rtp_instance_early_bridge(), ast_rtp_instance_early_bridge_make_compatible(), native_rtp_bridge_start(), and native_rtp_bridge_stop().

void(* update_source)(struct ast_rtp_instance *instance) [inherited]

Callback to indicate that we should update the marker bit

Referenced by ast_rtp_instance_update_source().

enum ast_rtp_dtls_verify verify [inherited]

What should be verified

Definition at line 472 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_parse(), and dtlsverify_to_str().

int(* write)(struct ast_rtp_instance *instance, struct ast_frame *frame) [inherited]

Callback for writing out a frame

Referenced by ast_rtp_engine_register2(), and ast_rtp_instance_write().


Generated on Thu Apr 16 06:34:44 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6