Asterisk - The Open Source Telephony Project  GIT-master-4a4f1a5
Data Structures | Macros | Enumerations | Enumerator | Functions | Variables
Stasis topics, and their messages.

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

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_channel_snapshot_base
 Structure containing base information for a channel snapshot. More...
 
struct  ast_channel_snapshot_bridge
 Structure containing bridge information for a channel snapshot. More...
 
struct  ast_channel_snapshot_caller
 Structure containing caller information for a channel snapshot. More...
 
struct  ast_channel_snapshot_connected
 Structure containing connected information for a channel snapshot. More...
 
struct  ast_channel_snapshot_dialplan
 Structure containing dialplan information for a channel snapshot. More...
 
struct  ast_channel_snapshot_hangup
 Structure containing hangup information for a channel snapshot. More...
 
struct  ast_channel_snapshot_peer
 Structure containing peer information for a channel snapshot. More...
 
struct  ast_channel_snapshot_update
 Structure representing a change of snapshot of channel state. More...
 
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...
 

Macros

#define AST_DEBUG_CATEGORY_DTLS   ast_debug_category_dtls_id() /* DTLS debug logging category id */
 
#define AST_DEBUG_CATEGORY_DTLS_PACKET   ast_debug_category_dtls_packet_id() /* DTLS packet debug logging category id */
 
#define AST_DEBUG_CATEGORY_ICE   ast_debug_category_ice_id() /* ICE debug logging category id */
 
#define AST_DEBUG_CATEGORY_RTCP   ast_debug_category_rtcp_id() /* RTCP debug logging category id */
 
#define AST_DEBUG_CATEGORY_RTCP_PACKET   ast_debug_category_rtcp_packet_id() /* RTCP packet debug logging category id */
 
#define AST_DEBUG_CATEGORY_RTP   ast_debug_category_rtp_id() /* RTP debug logging category id */
 
#define AST_DEBUG_CATEGORY_RTP_PACKET   ast_debug_category_rtp_packet_id() /* RTP packet debug logging category id */
 
#define ast_debug_dtls(sublevel, ...)    ast_debug_category(sublevel, AST_DEBUG_CATEGORY_DTLS, __VA_ARGS__)
 Log debug level DTLS information. More...
 
#define ast_debug_dtls_packet_is_allowed    ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_DTLS_PACKET)
 
#define ast_debug_ice(sublevel, ...)    ast_debug_category(sublevel, AST_DEBUG_CATEGORY_ICE, __VA_ARGS__)
 Log debug level ICE information. More...
 
#define ast_debug_rtcp(sublevel, ...)    ast_debug_category(sublevel, AST_DEBUG_CATEGORY_RTCP, __VA_ARGS__)
 Log debug level RTCP information. More...
 
#define ast_debug_rtcp_packet_is_allowed    ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_RTCP_PACKET)
 
#define ast_debug_rtp(sublevel, ...)    ast_debug_category(sublevel, AST_DEBUG_CATEGORY_RTP, __VA_ARGS__)
 Log debug level RTP information. More...
 
#define ast_debug_rtp_packet_is_allowed    ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_RTP_PACKET)
 
#define AST_LOG_CATEGORY_DTLS   "dtls"
 
#define AST_LOG_CATEGORY_DTLS_PACKET   "dtls_packet"
 
#define AST_LOG_CATEGORY_ICE   "ice"
 
#define AST_LOG_CATEGORY_RTCP   "rtcp"
 
#define AST_LOG_CATEGORY_RTCP_PACKET   "rtcp_packet"
 
#define AST_LOG_CATEGORY_RTP   "rtp"
 
#define AST_LOG_CATEGORY_RTP_PACKET   "rtp_packet"
 
#define AST_MAX_MAILBOX_UNIQUEID   (AST_MAX_EXTENSION + AST_MAX_CONTEXT + 2)
 
#define STASIS_UMOS_MAX   (STASIS_UMOS_ENDPOINT + 1)
 Number of snapshot types. More...
 

Enumerations

enum  ast_channel_snapshot_segment_invalidation {
  AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE = (1 << 1) , AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN = (1 << 2) , AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED = (1 << 3) , AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER = (1 << 4) ,
  AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP = (1 << 5) , AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER = (1 << 6) , AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE = (1 << 7)
}
 Channel snapshot invalidation flags, used to force generation of segments. More...
 
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...
 

Functions

struct stasis_message_typeast_channel_agent_login_type (void)
 Message type for agent login on a channel. More...
 
struct stasis_message_typeast_channel_agent_logoff_type (void)
 Message type for agent logoff on a channel. More...
 
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. More...
 
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. More...
 
struct ao2_containerast_channel_cache_all (void)
 
struct ao2_containerast_channel_cache_by_name (void)
 Secondary channel cache, indexed by name. More...
 
struct stasis_message_typeast_channel_chanspy_start_type (void)
 Message type for when a channel starts spying on another channel. More...
 
struct stasis_message_typeast_channel_chanspy_stop_type (void)
 Message type for when a channel stops spying on another channel. More...
 
struct stasis_message_typeast_channel_dial_type (void)
 Message type for when a channel dials another channel. More...
 
struct stasis_message_typeast_channel_dtmf_begin_type (void)
 Message type for when DTMF begins on a channel. More...
 
struct stasis_message_typeast_channel_dtmf_end_type (void)
 Message type for when DTMF ends on a channel. More...
 
struct stasis_message_typeast_channel_fax_type (void)
 Message type for a fax operation. More...
 
struct stasis_message_typeast_channel_flash_type (void)
 Message type for when a hook flash occurs on a channel. More...
 
struct stasis_message_typeast_channel_hangup_handler_type (void)
 Message type for hangup handler related actions. More...
 
struct stasis_message_typeast_channel_hangup_request_type (void)
 Message type for when a hangup is requested on a channel. More...
 
struct stasis_message_typeast_channel_hold_type (void)
 Message type for when a channel is placed on hold. More...
 
struct stasis_message_typeast_channel_masquerade_type (void)
 Message type for when a channel is being masqueraded. More...
 
struct stasis_message_typeast_channel_mixmonitor_mute_type (void)
 Message type for muting or unmuting mixmonitor on a channel. More...
 
struct stasis_message_typeast_channel_mixmonitor_start_type (void)
 Message type for starting mixmonitor on a channel. More...
 
struct stasis_message_typeast_channel_mixmonitor_stop_type (void)
 Message type for stopping mixmonitor on a channel. More...
 
struct stasis_message_typeast_channel_moh_start_type (void)
 Message type for starting music on hold on a channel. More...
 
struct stasis_message_typeast_channel_moh_stop_type (void)
 Message type for stopping music on hold on a channel. More...
 
struct stasis_message_typeast_channel_monitor_start_type (void)
 Message type for starting monitor on a channel. More...
 
struct stasis_message_typeast_channel_monitor_stop_type (void)
 Message type for stopping monitor on a channel. More...
 
void ast_channel_publish_blob (struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
 Publish a channel blob message. More...
 
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. More...
 
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. More...
 
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. More...
 
void ast_channel_publish_final_snapshot (struct ast_channel *chan)
 Send the final channel snapshot for a channel, thus removing it from cache. More...
 
void ast_channel_publish_snapshot (struct ast_channel *chan)
 Publish a ast_channel_snapshot for a channel. More...
 
void ast_channel_publish_varset (struct ast_channel *chan, const char *variable, const char *value)
 Publish a ast_channel_publish_varset for a channel. More...
 
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. More...
 
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. More...
 
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. More...
 
void ast_channel_snapshot_invalidate_segment (struct ast_channel *chan, enum ast_channel_snapshot_segment_invalidation segment)
 Invalidate a channel snapshot segment from being reused. More...
 
struct stasis_message_typeast_channel_snapshot_type (void)
 Message type for ast_channel_snapshot_update. More...
 
void ast_channel_stage_snapshot (struct ast_channel *chan)
 Set flag to indicate channel snapshot is being staged. More...
 
void ast_channel_stage_snapshot_done (struct ast_channel *chan)
 Clear flag to indicate channel snapshot is being staged, and publish snapshot. More...
 
struct stasis_message_typeast_channel_talking_start (void)
 Message type for a channel starting talking. More...
 
struct stasis_message_typeast_channel_talking_stop (void)
 Message type for a channel stopping talking. More...
 
struct stasis_topicast_channel_topic_all (void)
 A topic which publishes the events for all channels. More...
 
struct stasis_message_typeast_channel_unhold_type (void)
 Message type for when a channel is removed from hold. More...
 
struct stasis_message_typeast_channel_varset_type (void)
 Message type for when a variable is set on a channel. More...
 
uintmax_t ast_debug_category_dtls_id (void)
 
uintmax_t ast_debug_category_dtls_packet_id (void)
 
uintmax_t ast_debug_category_ice_id (void)
 
uintmax_t ast_debug_category_rtcp_id (void)
 
uintmax_t ast_debug_category_rtcp_packet_id (void)
 
uintmax_t ast_debug_category_rtp_id (void)
 
uintmax_t ast_debug_category_rtp_packet_id (void)
 
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. More...
 
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. More...
 
struct stasis_cacheast_endpoint_cache (void)
 Backend cache for ast_endpoint_topic_all_cached(). More...
 
struct stasis_cp_allast_endpoint_cache_all (void)
 
struct stasis_message_typeast_endpoint_contact_state_type (void)
 Message type for endpoint contact state changes. More...
 
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. More...
 
struct ast_endpoint_snapshotast_endpoint_snapshot_create (struct ast_endpoint *endpoint)
 Create a snapshot of an endpoint. More...
 
struct stasis_message_typeast_endpoint_snapshot_type (void)
 Message type for ast_endpoint_snapshot. More...
 
struct stasis_message_typeast_endpoint_state_type (void)
 Message type for endpoint state changes. More...
 
struct stasis_topicast_endpoint_topic (struct ast_endpoint *endpoint)
 Returns the topic for a specific endpoint. More...
 
struct stasis_topicast_endpoint_topic_all (void)
 Topic for all endpoint related messages. More...
 
struct stasis_topicast_endpoint_topic_all_cached (void)
 Cached topic for all endpoint related messages. More...
 
struct stasis_topicast_endpoint_topic_cached (struct ast_endpoint *endpoint)
 Returns the topic for a specific endpoint. More...
 
 AST_LIST_ENTRY (ast_rtp_engine) entry
 
 AST_LIST_ENTRY (ast_rtp_glue) entry
 
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. More...
 
struct ast_multi_channel_blobast_multi_channel_blob_create (struct ast_json *blob)
 Create a ast_multi_channel_blob suitable for a stasis_message. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
struct ast_multi_object_blobast_multi_object_blob_create (struct ast_json *blob)
 Create a stasis multi object blob. More...
 
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. More...
 
struct stasis_message_typeast_multi_user_event_type (void)
 Message type for custom user defined events with multi object blobs. More...
 
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. More...
 
struct ast_mwi_stateast_mwi_create (const char *mailbox, const char *context)
 Create a ast_mwi_state object. More...
 
struct stasis_cacheast_mwi_state_cache (void)
 Backend cache for ast_mwi_topic_cached(). More...
 
struct stasis_message_typeast_mwi_state_type (void)
 Get the Stasis Message Bus API message type for MWI messages. More...
 
struct stasis_topicast_mwi_topic (const char *uniqueid)
 Get the Stasis Message Bus API topic for MWI messages on a unique ID. More...
 
struct stasis_topicast_mwi_topic_all (void)
 Get the Stasis Message Bus API topic for MWI messages. More...
 
struct stasis_topicast_mwi_topic_cached (void)
 Get the Stasis Message Bus API caching topic for MWI messages. More...
 
struct stasis_message_typeast_mwi_vm_app_type (void)
 Get the Stasis Message Bus API message type for voicemail application specific messages. More...
 
struct stasis_message_typeast_parked_call_type (void)
 accessor for the parked call stasis message type More...
 
struct stasis_topicast_parking_topic (void)
 accessor for the parking stasis topic More...
 
struct ast_jsonast_rtp_convert_stats_json (const struct ast_rtp_instance_stats *stats)
 Convert given stat instance into json format. More...
 
int ast_rtp_get_rate (const struct ast_format *format)
 Retrieve the sample rate of a format according to RTP specifications. More...
 
struct ast_jsonast_rtp_instance_get_stats_all_json (struct ast_rtp_instance *instance)
 Retrieve statistics about an RTP instance in json format. More...
 
struct stasis_message_typeast_rtp_rtcp_received_type (void)
 Message type for an RTCP message received from some external source. More...
 
struct stasis_message_typeast_rtp_rtcp_sent_type (void)
 Message type for an RTCP message sent from this Asterisk instance. More...
 
struct stasis_topicast_rtp_topic (void)
 Stasis Message Bus API topic for RTP and RTCP related messages More...
 
 AST_VECTOR (, struct ast_rtp_payload_type *) payload_mapping_rx
 
int mwi_init (void)
 Initialize the mwi core. More...
 
struct stasis_message_typestasis_cache_clear_type (void)
 Message type for clearing a message from a stasis cache. More...
 
struct stasis_message_typestasis_cache_update_type (void)
 Message type for cache update messages. More...
 
struct stasis_message_typestasis_subscription_change_type (void)
 Gets the message type for subscription change notices. More...
 
struct stasis_messagestasis_test_message_create (void)
 Creates a test message. More...
 
struct stasis_message_typestasis_test_message_type (void)
 Gets the type of messages created by stasis_test_message_create(). More...
 

Variables

union {
   struct ast_rtp_rtcp_feedback_remb   remb
 
}; 
 
struct ast_string_field_mgr __field_mgr
 
struct ast_string_field_pool__field_mgr_pool
 
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. More...
 
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. More...
 
int asterisk_format
 
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)
 
struct ast_jsonblob
 
unsigned int br_exp
 
unsigned int br_mantissa
 
int(* bundle )(struct ast_rtp_instance *child, struct ast_rtp_instance *parent)
 
char * cafile
 
char * capath
 
char * certfile
 
void(* change_components )(struct ast_rtp_instance *instance, int num_components)
 
void(* change_source )(struct ast_rtp_instance *instance)
 
char channel_uniqueid [MAX_CHANNEL_ID]
 
char * cipher
 
const char *(* cname_get )(struct ast_rtp_instance *instance)
 
ast_rwlock_t codecs_lock
 
enum ast_rtp_dtls_setup default_setup
 
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 ast_eid eid
 
unsigned int enabled:1
 
unsigned int ephemeral_cert:1
 
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(* extension_enable )(struct ast_rtp_instance *instance, enum ast_rtp_extension extension)
 
int(* fd )(struct ast_rtp_instance *instance, int rtcp)
 
unsigned int fmt
 
struct ast_formatformat
 
char * foundation
 
unsigned short   fraction
 
unsigned int framing
 
void(* get_codec )(struct ast_channel *chan, struct ast_format_cap *result_cap)
 Callback for retrieving codecs that the channel can do. Result returned in result_cap. More...
 
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. More...
 
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. More...
 
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. More...
 
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
 
struct ast_mwi_statemwi_state
 
const char * name
 
int(* new )(struct ast_rtp_instance *instance, struct ast_sched_context *sched, struct ast_sockaddr *sa, void *data)
 
int new_msgs
 
double normdevrtt
 
struct timeval   ntp_timestamp
 
unsigned int   octet_count
 
int old_msgs
 
void(* on_subscribe )(const char *mailbox, struct ast_mwi_subscriber *sub)
 Raised when MWI is being subscribed. More...
 
void(* on_unsubscribe )(const char *mailbox, struct ast_mwi_subscriber *sub)
 Raised when MWI is being unsubscribed. More...
 
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)
 
unsigned int primary_mapping:1
 
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)
 
unsigned short reception_report_count
 
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
 
struct ast_rtp_rtcp_feedback_remb   remb
 
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 rxoctetcount
 
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_authentication )(struct ast_rtp_instance *instance, const char *ufrag, const char *password)
 
int(* set_configuration )(struct ast_rtp_instance *instance, const struct ast_rtp_dtls_cfg *dtls_cfg)
 
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_remote_ssrc )(struct ast_rtp_instance *instance, unsigned int ssrc)
 
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)
 
void(* set_stream_num )(struct ast_rtp_instance *instance, int stream_num)
 
int(* set_write_format )(struct ast_rtp_instance *instance, struct ast_format *format)
 
struct ast_channel_snapshotsnapshot
 
unsigned int source_ssrc
 
unsigned int ssrc
 
unsigned int(* ssrc_get )(struct ast_rtp_instance *instance)
 
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
 
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)
 
unsigned int txcount
 
double txjitter
 
unsigned int txoctetcount
 
unsigned int txploss
 
unsigned int type
 
enum ast_rtp_ice_candidate_type type
 
const char * 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)
 
int urgent_msgs
 
enum ast_rtp_dtls_verify verify
 
struct timeval when_retired
 
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.

Macro Definition Documentation

◆ AST_DEBUG_CATEGORY_DTLS

#define AST_DEBUG_CATEGORY_DTLS   ast_debug_category_dtls_id() /* DTLS debug logging category id */

Definition at line 2850 of file rtp_engine.h.

◆ AST_DEBUG_CATEGORY_DTLS_PACKET

#define AST_DEBUG_CATEGORY_DTLS_PACKET   ast_debug_category_dtls_packet_id() /* DTLS packet debug logging category id */

Definition at line 2851 of file rtp_engine.h.

◆ AST_DEBUG_CATEGORY_ICE

#define AST_DEBUG_CATEGORY_ICE   ast_debug_category_ice_id() /* ICE debug logging category id */

Definition at line 2852 of file rtp_engine.h.

◆ AST_DEBUG_CATEGORY_RTCP

#define AST_DEBUG_CATEGORY_RTCP   ast_debug_category_rtcp_id() /* RTCP debug logging category id */

Definition at line 2848 of file rtp_engine.h.

◆ AST_DEBUG_CATEGORY_RTCP_PACKET

#define AST_DEBUG_CATEGORY_RTCP_PACKET   ast_debug_category_rtcp_packet_id() /* RTCP packet debug logging category id */

Definition at line 2849 of file rtp_engine.h.

◆ AST_DEBUG_CATEGORY_RTP

#define AST_DEBUG_CATEGORY_RTP   ast_debug_category_rtp_id() /* RTP debug logging category id */

Definition at line 2846 of file rtp_engine.h.

◆ AST_DEBUG_CATEGORY_RTP_PACKET

#define AST_DEBUG_CATEGORY_RTP_PACKET   ast_debug_category_rtp_packet_id() /* RTP packet debug logging category id */

Definition at line 2847 of file rtp_engine.h.

◆ ast_debug_dtls

#define ast_debug_dtls (   sublevel,
  ... 
)     ast_debug_category(sublevel, AST_DEBUG_CATEGORY_DTLS, __VA_ARGS__)

Log debug level DTLS information.

Parameters
sublevelDebug output sublevel (>= 0)
...String format and any associated arguments

Definition at line 2886 of file rtp_engine.h.

◆ ast_debug_dtls_packet_is_allowed

Definition at line 2890 of file rtp_engine.h.

◆ ast_debug_ice

#define ast_debug_ice (   sublevel,
  ... 
)     ast_debug_category(sublevel, AST_DEBUG_CATEGORY_ICE, __VA_ARGS__)

Log debug level ICE information.

Parameters
sublevelDebug output sublevel (>= 0)
...String format and any associated arguments

Definition at line 2898 of file rtp_engine.h.

◆ ast_debug_rtcp

#define ast_debug_rtcp (   sublevel,
  ... 
)     ast_debug_category(sublevel, AST_DEBUG_CATEGORY_RTCP, __VA_ARGS__)

Log debug level RTCP information.

Parameters
sublevelDebug output sublevel (>= 0)
...String format and any associated arguments

Definition at line 2873 of file rtp_engine.h.

◆ ast_debug_rtcp_packet_is_allowed

Definition at line 2877 of file rtp_engine.h.

◆ ast_debug_rtp

#define ast_debug_rtp (   sublevel,
  ... 
)     ast_debug_category(sublevel, AST_DEBUG_CATEGORY_RTP, __VA_ARGS__)

Log debug level RTP information.

Parameters
sublevelDebug output sublevel (>= 0)
...String format and any associated arguments

Definition at line 2860 of file rtp_engine.h.

◆ ast_debug_rtp_packet_is_allowed

Definition at line 2864 of file rtp_engine.h.

◆ AST_LOG_CATEGORY_DTLS

#define AST_LOG_CATEGORY_DTLS   "dtls"

Definition at line 2832 of file rtp_engine.h.

◆ AST_LOG_CATEGORY_DTLS_PACKET

#define AST_LOG_CATEGORY_DTLS_PACKET   "dtls_packet"

Definition at line 2834 of file rtp_engine.h.

◆ AST_LOG_CATEGORY_ICE

#define AST_LOG_CATEGORY_ICE   "ice"

Definition at line 2836 of file rtp_engine.h.

◆ AST_LOG_CATEGORY_RTCP

#define AST_LOG_CATEGORY_RTCP   "rtcp"

Definition at line 2828 of file rtp_engine.h.

◆ AST_LOG_CATEGORY_RTCP_PACKET

#define AST_LOG_CATEGORY_RTCP_PACKET   "rtcp_packet"

Definition at line 2830 of file rtp_engine.h.

◆ AST_LOG_CATEGORY_RTP

#define AST_LOG_CATEGORY_RTP   "rtp"

Definition at line 2824 of file rtp_engine.h.

◆ AST_LOG_CATEGORY_RTP_PACKET

#define AST_LOG_CATEGORY_RTP_PACKET   "rtp_packet"

Definition at line 2826 of file rtp_engine.h.

◆ AST_MAX_MAILBOX_UNIQUEID

#define AST_MAX_MAILBOX_UNIQUEID   (AST_MAX_EXTENSION + AST_MAX_CONTEXT + 2)

Definition at line 574 of file mwi.h.

◆ STASIS_UMOS_MAX

#define STASIS_UMOS_MAX   (STASIS_UMOS_ENDPOINT + 1)

Number of snapshot types.

Definition at line 1362 of file stasis.h.

Enumeration Type Documentation

◆ ast_channel_snapshot_segment_invalidation

Channel snapshot invalidation flags, used to force generation of segments.

Since
17
Enumerator
AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE 

Invalidate the bridge segment

AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN 

Invalidate the dialplan segment

AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED 

Invalidate the connected segment

AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER 

Invalidate the caller segment

AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP 

Invalidate the hangup segment

AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER 

Invalidate the peer segment

AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE 

Invalidate the base segment

Definition at line 35 of file stasis_channels.h.

35  {
36  /*! Invalidate the bridge segment */
38  /*! Invalidate the dialplan segment */
40  /*! Invalidate the connected segment */
42  /*! Invalidate the caller segment */
44  /*! Invalidate the hangup segment */
46  /*! Invalidate the peer segment */
48  /*! Invalidate the base segment */
50 };
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CALLER
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_CONNECTED
@ AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN

◆ stasis_user_multi_object_snapshot_type

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 1355 of file stasis.h.

1355  {
1356  STASIS_UMOS_CHANNEL = 0, /*!< Channel Snapshots */
1357  STASIS_UMOS_BRIDGE, /*!< Bridge Snapshots */
1358  STASIS_UMOS_ENDPOINT, /*!< Endpoint Snapshots */
1359 };
@ STASIS_UMOS_ENDPOINT
Definition: stasis.h:1358
@ STASIS_UMOS_BRIDGE
Definition: stasis.h:1357
@ STASIS_UMOS_CHANNEL
Definition: stasis.h:1356

Function Documentation

◆ ast_channel_agent_login_type()

struct stasis_message_type* ast_channel_agent_login_type ( void  )

Message type for agent login on a channel.

Since
18.0.0
Returns
A stasis message type

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

◆ ast_channel_agent_logoff_type()

struct stasis_message_type* ast_channel_agent_logoff_type ( void  )

Message type for agent logoff on a channel.

Since
12.0.0
Returns
A stasis message type

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

◆ ast_channel_blob_create()

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

Creates a ast_channel_blob message.

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
chanChannel blob is associated with, or NULL for global/all channels.
typeMessage type for this blob.
blobJSON object representing the data, or NULL for no data. If NULL, ast_json_null() is put into the object.
Returns
ast_channel_blob message.
Return values
NULLon error

Definition at line 788 of file stasis_channels.c.

790 {
791  struct ast_channel_snapshot *snapshot;
792  struct stasis_message *msg;
793 
794  if (!type) {
795  return NULL;
796  }
797 
798  snapshot = chan ? ao2_bump(ast_channel_snapshot(chan)) : NULL;
799  msg = create_channel_blob_message(snapshot, type, blob);
800  ao2_cleanup(snapshot);
801  return msg;
802 }
#define ao2_cleanup(obj)
Definition: astobj2.h:1958
#define ao2_bump(obj)
Definition: astobj2.h:491
static const char type[]
Definition: chan_ooh323.c:109
struct ast_channel_snapshot * ast_channel_snapshot(const struct ast_channel *chan)
#define NULL
Definition: resample.c:96
static struct stasis_message * create_channel_blob_message(struct ast_channel_snapshot *snapshot, struct stasis_message_type *type, struct ast_json *blob)
Structure representing a snapshot of channel state.

References ao2_bump, ao2_cleanup, ast_channel_snapshot(), create_channel_blob_message(), NULL, and type.

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

◆ ast_channel_blob_create_from_cache()

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

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

Since
12
Parameters
uniqueidUniqueid of the channel.
typeMessage type for this blob.
blobJSON object representing the data, or NULL for no data. If NULL, ast_json_null() is put into the object.
Returns
ast_channel_blob message.
Return values
NULLon error

Definition at line 771 of file stasis_channels.c.

774 {
775  struct ast_channel_snapshot *snapshot;
776  struct stasis_message *msg;
777 
778  if (!type) {
779  return NULL;
780  }
781 
782  snapshot = ast_channel_snapshot_get_latest(channel_id);
783  msg = create_channel_blob_message(snapshot, type, blob);
784  ao2_cleanup(snapshot);
785  return msg;
786 }
struct ast_channel_snapshot * ast_channel_snapshot_get_latest(const char *uniqueid)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object,...

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

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

◆ ast_channel_cache_all()

struct ao2_container* ast_channel_cache_all ( void  )

Definition at line 123 of file stasis_channels.c.

124 {
125  return ao2_bump(channel_cache);
126 }
static struct ao2_container * channel_cache

References ao2_bump, and channel_cache.

Referenced by ast_ari_channels_list(), and ast_complete_channels().

◆ ast_channel_cache_by_name()

struct ao2_container* ast_channel_cache_by_name ( void  )

Secondary channel cache, indexed by name.

Since
12
Returns
Cache of ast_channel_snapshot.

Definition at line 133 of file stasis_channels.c.

134 {
136 }
static struct ao2_container * channel_cache_by_name

References ao2_bump, and channel_cache_by_name.

Referenced by action_coreshowchannels(), get_container(), and handle_chanlist().

◆ ast_channel_chanspy_start_type()

struct stasis_message_type* ast_channel_chanspy_start_type ( void  )

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

Since
12
Returns
A stasis message type

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

◆ ast_channel_chanspy_stop_type()

struct stasis_message_type* ast_channel_chanspy_stop_type ( void  )

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

Since
12
Returns
A stasis message type

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

◆ ast_channel_dial_type()

struct stasis_message_type* ast_channel_dial_type ( void  )

Message type for when a channel dials another channel.

Since
12
Returns
A stasis message type

Referenced by ast_channel_publish_dial_internal(), ast_stasis_channels_init(), create_routes(), load_module(), manager_channels_init(), and stasis_channels_cleanup().

◆ ast_channel_dtmf_begin_type()

struct stasis_message_type* ast_channel_dtmf_begin_type ( void  )

Message type for when DTMF begins on a channel.

Since
12
Returns
A stasis message type

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

◆ ast_channel_dtmf_end_type()

struct stasis_message_type* ast_channel_dtmf_end_type ( void  )

Message type for when DTMF ends on a channel.

Since
12
Returns
A stasis message type

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

◆ ast_channel_fax_type()

struct stasis_message_type* ast_channel_fax_type ( void  )

Message type for a fax operation.

Since
12
Returns
A stasis message type

Referenced by ast_stasis_channels_init(), manager_channels_init(), report_fax_status(), report_receive_fax_status(), report_send_fax_status(), and stasis_channels_cleanup().

◆ ast_channel_flash_type()

struct stasis_message_type* ast_channel_flash_type ( void  )

Message type for when a hook flash occurs on a channel.

Returns
A stasis message type

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

◆ ast_channel_hangup_handler_type()

struct stasis_message_type* ast_channel_hangup_handler_type ( void  )

Message type for hangup handler related actions.

Since
12
Returns
A stasis message type

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

◆ ast_channel_hangup_request_type()

struct stasis_message_type* ast_channel_hangup_request_type ( void  )

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

Since
12
Returns
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().

◆ ast_channel_hold_type()

struct stasis_message_type* ast_channel_hold_type ( void  )

Message type for when a channel is placed on hold.

Since
12
Returns
A stasis message type

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

◆ ast_channel_masquerade_type()

struct stasis_message_type* ast_channel_masquerade_type ( void  )

Message type for when a channel is being masqueraded.

Since
16
Returns
A stasis message type

Referenced by ast_channel_move(), ast_stasis_channels_init(), setup_stasis_subs(), and stasis_channels_cleanup().

◆ ast_channel_mixmonitor_mute_type()

struct stasis_message_type* ast_channel_mixmonitor_mute_type ( void  )

Message type for muting or unmuting mixmonitor on a channel.

Since
18
Returns
A stasis message type

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

◆ ast_channel_mixmonitor_start_type()

struct stasis_message_type* ast_channel_mixmonitor_start_type ( void  )

Message type for starting mixmonitor on a channel.

Since
18
Returns
A stasis message type

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

◆ ast_channel_mixmonitor_stop_type()

struct stasis_message_type* ast_channel_mixmonitor_stop_type ( void  )

Message type for stopping mixmonitor on a channel.

Since
18
Returns
A stasis message type

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

◆ ast_channel_moh_start_type()

struct stasis_message_type* ast_channel_moh_start_type ( void  )

Message type for starting music on hold on a channel.

Since
12
Returns
A stasis message type

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

◆ ast_channel_moh_stop_type()

struct stasis_message_type* ast_channel_moh_stop_type ( void  )

Message type for stopping music on hold on a channel.

Since
12
Returns
A stasis message type

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

◆ ast_channel_monitor_start_type()

struct stasis_message_type* ast_channel_monitor_start_type ( void  )

Message type for starting monitor on a channel.

Since
12
Returns
A stasis message type

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

◆ ast_channel_monitor_stop_type()

struct stasis_message_type* ast_channel_monitor_stop_type ( void  )

Message type for stopping monitor on a channel.

Since
12
Returns
A stasis message type

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

◆ ast_channel_publish_blob()

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
chanChannel publishing the blob.
typeType of stasis message.
blobThe blob being published. (NULL if no blob)
Note
This will use the current snapshot on the channel and will not generate a new one.

Definition at line 1135 of file stasis_channels.c.

1136 {
1137  struct stasis_message *message;
1138 
1139  if (!blob) {
1140  blob = ast_json_null();
1141  }
1142 
1143  message = ast_channel_blob_create(chan, type, blob);
1144  if (message) {
1146  ao2_ref(message, -1);
1147  }
1148 }
#define ao2_ref(o, delta)
Definition: astobj2.h:464
struct stasis_topic * ast_channel_topic(struct ast_channel *chan)
A topic which publishes the events for a particular channel.
struct stasis_message * ast_channel_blob_create(struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *blob)
Creates a ast_channel_blob message.
struct ast_json * ast_json_null(void)
Get the JSON null value.
Definition: json.c:248
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
Definition: stasis.c:1512

References ao2_ref, ast_channel_blob_create(), ast_channel_topic(), ast_json_null(), stasis_publish(), and type.

Referenced by ast_channel_move(), ast_channel_publish_varset(), ast_queue_hangup(), ast_queue_hangup_with_cause(), ast_queue_hold(), ast_queue_unhold(), ast_softhangup(), publish_dahdichannel(), publish_hangup_handler_message(), send_agent_login(), send_agent_logoff(), send_dtmf_begin_event(), send_dtmf_end_event(), send_flash_event(), and send_session_timeout().

◆ ast_channel_publish_cached_blob()

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
chanChannel publishing the blob.
typeType of stasis message.
blobThe 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.

Definition at line 1120 of file stasis_channels.c.

1121 {
1122  struct stasis_message *message;
1123 
1124  if (!blob) {
1125  blob = ast_json_null();
1126  }
1127 
1129  if (message) {
1131  ao2_ref(message, -1);
1132  }
1133 }
const char * ast_channel_uniqueid(const struct ast_channel *chan)
struct stasis_message * ast_channel_blob_create_from_cache(const char *channel_id, struct stasis_message_type *type, struct ast_json *blob)
Create a ast_channel_blob message, pulling channel state from the cache.

References ao2_ref, ast_channel_blob_create_from_cache(), ast_channel_topic(), ast_channel_uniqueid(), ast_json_null(), stasis_publish(), and type.

Referenced by agi_handle_command(), ast_bridge_channel_write_hold(), ast_bridge_channel_write_unhold(), hold_intercept_framehook(), join_queue(), leave_queue(), and record_abandoned().

◆ ast_channel_publish_dial()

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
callerThe channel performing the dial operation
peerThe channel being dialed
dialstringWhen beginning a dial, the information passed to the dialing application
dialstatusThe current status of the dial operation (NULL if no status is known)

Definition at line 739 of file stasis_channels.c.

741 {
742  ast_channel_publish_dial_forward(caller, peer, NULL, dialstring, dialstatus, NULL);
743 }
void ast_channel_publish_dial_forward(struct ast_channel *caller, struct ast_channel *peer, struct ast_channel *forwarded, const char *dialstring, const char *dialstatus, const char *forward)
Publish in the ast_channel_topic or ast_channel_topic_all topics a stasis message for the channels in...

References ast_channel_publish_dial_forward(), ast_channel_snapshot::caller, NULL, and ast_channel_snapshot::peer.

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

◆ ast_channel_publish_dial_forward()

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
callerThe channel performing the dial operation
peerThe channel being dialed
forwardedThe channel created as a result of the call forwarding
dialstringThe information passed to the dialing application when beginning a dial
dialstatusThe current status of the dial operation
forwardThe call forward string provided by the dialed channel

Definition at line 689 of file stasis_channels.c.

692 {
693  ast_assert(peer != NULL);
694 
695  /* XXX With an early bridge the below dial masquerade datastore code could, theoretically,
696  * go away as the act of changing the channel during dialing would be done using the bridge
697  * API itself and not a masquerade.
698  */
699 
700  if (caller) {
701  /*
702  * Lock two or three channels.
703  *
704  * We need to hold the locks to hold off a potential masquerade
705  * messing up the stasis dial event ordering.
706  */
707  for (;; ast_channel_unlock(caller), sched_yield()) {
708  ast_channel_lock(caller);
709  if (ast_channel_trylock(peer)) {
710  continue;
711  }
712  if (forwarded && ast_channel_trylock(forwarded)) {
713  ast_channel_unlock(peer);
714  continue;
715  }
716  break;
717  }
718 
719  if (ast_strlen_zero(dialstatus)) {
720  set_dial_masquerade(caller, peer, dialstring);
721  } else {
723  }
724  }
725 
726  ast_channel_publish_dial_internal(caller, peer, forwarded, dialstring, dialstatus,
727  forward);
728 
729  if (caller) {
730  if (forwarded) {
731  ast_channel_unlock(forwarded);
732  }
733  ast_channel_unlock(peer);
735  ast_channel_unlock(caller);
736  }
737 }
#define ast_channel_lock(chan)
Definition: channel.h:2888
#define ast_channel_trylock(chan)
Definition: channel.h:2890
#define ast_channel_unlock(chan)
Definition: channel.h:2889
static int set_dial_masquerade(struct ast_channel *caller, struct ast_channel *peer, const char *dialstring)
static void ast_channel_publish_dial_internal(struct ast_channel *caller, struct ast_channel *peer, struct ast_channel *forwarded, const char *dialstring, const char *dialstatus, const char *forward)
static void remove_dial_masquerade_caller(struct ast_channel *caller)
static void remove_dial_masquerade(struct ast_channel *peer)
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Definition: strings.h:65
#define ast_assert(a)
Definition: utils.h:710

References ast_assert, ast_channel_lock, ast_channel_publish_dial_internal(), ast_channel_trylock, ast_channel_unlock, ast_strlen_zero(), ast_channel_snapshot::caller, NULL, ast_channel_snapshot::peer, remove_dial_masquerade(), remove_dial_masquerade_caller(), and set_dial_masquerade().

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

◆ ast_channel_publish_final_snapshot()

void ast_channel_publish_final_snapshot ( struct ast_channel chan)

Send the final channel snapshot for a channel, thus removing it from cache.

Since
17
Precondition
chan is locked
Parameters
chanThe channel to send the final channel snapshot for
Note
This will also remove the cached snapshot from the channel itself

Definition at line 917 of file stasis_channels.c.

918 {
920  struct stasis_message *message;
921 
922  if (!ast_channel_snapshot_type()) {
923  return;
924  }
925 
927  if (!update) {
928  return;
929  }
930 
932  /* In the success path message holds a reference to update so it will be valid
933  * for the lifetime of this function until the end.
934  */
935  ao2_ref(update, -1);
936  if (!message) {
937  return;
938  }
939 
940  ao2_unlink(channel_cache, update->old_snapshot);
941  ao2_unlink(channel_cache_by_name, update->old_snapshot);
942 
944 
946  ao2_ref(message, -1);
947 }
#define ao2_unlink(container, obj)
Definition: astobj2.h:1598
void ast_channel_snapshot_set(struct ast_channel *chan, struct ast_channel_snapshot *snapshot)
static void update(int code_size, int y, int wi, int fi, int dq, int sr, int dqsez, struct g726_state *state_ptr)
Definition: codec_g726.c:367
struct stasis_message_type * ast_channel_snapshot_type(void)
Message type for ast_channel_snapshot_update.
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
static struct ast_channel_snapshot_update * channel_snapshot_update_create(struct ast_channel *chan)
Structure representing a change of snapshot of channel state.

References ao2_ref, ao2_unlink, ast_channel_snapshot_set(), ast_channel_snapshot_type(), ast_channel_topic(), channel_cache, channel_cache_by_name, channel_snapshot_update_create(), NULL, stasis_message_create(), stasis_publish(), and update().

Referenced by ast_channel_destructor().

◆ ast_channel_publish_snapshot()

void ast_channel_publish_snapshot ( struct ast_channel chan)

Publish a ast_channel_snapshot for a channel.

Since
12
Precondition
chan is locked
Parameters
chanChannel to publish.

Definition at line 1055 of file stasis_channels.c.

1056 {
1058  struct stasis_message *message;
1059 
1060  if (!ast_channel_snapshot_type()) {
1061  return;
1062  }
1063 
1065  return;
1066  }
1067 
1069  if (!update) {
1070  return;
1071  }
1072 
1073  /* If an old snapshot exists and is the same as this newly created one don't bother
1074  * raising a message as it hasn't changed.
1075  */
1076  if (update->old_snapshot && !memcmp(update->old_snapshot, update->new_snapshot, sizeof(struct ast_channel_snapshot))) {
1077  ao2_ref(update, -1);
1078  return;
1079  }
1080 
1082  /* In the success path message holds a reference to update so it will be valid
1083  * for the lifetime of this function until the end.
1084  */
1085  ao2_ref(update, -1);
1086  if (!message) {
1087  return;
1088  }
1089 
1090  /* We lock these ourselves so that the update is atomic and there isn't time where a
1091  * snapshot is not in the cache.
1092  */
1094  if (update->old_snapshot) {
1096  }
1097  ao2_link_flags(channel_cache, update->new_snapshot, OBJ_NOLOCK);
1099 
1100  /* The same applies here. */
1102  if (update->old_snapshot) {
1104  }
1107 
1108  ast_channel_snapshot_set(chan, update->new_snapshot);
1109 
1110  /* As this is now the new snapshot any existing invalidated segments have been
1111  * created fresh and are up to date.
1112  */
1114 
1115  ast_assert(ast_channel_topic(chan) != NULL);
1117  ao2_ref(message, -1);
1118 }
#define ao2_wrlock(a)
Definition: astobj2.h:720
#define ao2_unlink_flags(container, obj, flags)
Definition: astobj2.h:1622
#define ao2_link_flags(container, obj, flags)
Definition: astobj2.h:1572
#define ao2_unlock(a)
Definition: astobj2.h:730
@ OBJ_NOLOCK
Assume that the ao2_container is already locked.
Definition: astobj2.h:1067
@ AST_FLAG_SNAPSHOT_STAGE
Definition: channel.h:1050
struct ast_flags * ast_channel_flags(struct ast_channel *chan)
struct ast_flags * ast_channel_snapshot_segment_flags(struct ast_channel *chan)
#define ast_test_flag(p, flag)
Definition: utils.h:63
#define ast_clear_flag(p, flag)
Definition: utils.h:77
#define AST_FLAGS_ALL
Definition: utils.h:196

References ao2_link_flags, ao2_ref, ao2_unlink_flags, ao2_unlock, ao2_wrlock, ast_assert, ast_channel_flags(), ast_channel_snapshot_segment_flags(), ast_channel_snapshot_set(), ast_channel_snapshot_type(), ast_channel_topic(), ast_clear_flag, AST_FLAG_SNAPSHOT_STAGE, AST_FLAGS_ALL, ast_test_flag, channel_cache, channel_cache_by_name, channel_snapshot_update_create(), NULL, OBJ_NOLOCK, stasis_message_create(), stasis_publish(), and update().

Referenced by ast_channel_amaflags_set(), ast_channel_internal_bridge_set(), ast_channel_internal_copy_linkedid(), ast_channel_publish_varset(), ast_channel_set_caller_event(), ast_channel_set_connected_line(), ast_channel_stage_snapshot_done(), ast_set_callerid(), ast_setstate(), AST_TEST_DEFINE(), channel_do_masquerade(), do_forward(), onCallEstablished(), and realtime_exec().

◆ ast_channel_publish_varset()

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

Publish a ast_channel_publish_varset for a channel.

Since
12
Precondition
chan is locked
Parameters
chanChannel to publish the event for, or NULL for 'none'.
variableName of the variable being set
valueValue.

If there are manager variables, force a cache update

Definition at line 1150 of file stasis_channels.c.

1151 {
1152  struct ast_json *blob;
1153 
1154  ast_assert(name != NULL);
1155  ast_assert(value != NULL);
1156 
1157  blob = ast_json_pack("{s: s, s: s}",
1158  "variable", name,
1159  "value", value);
1160  if (!blob) {
1161  ast_log(LOG_ERROR, "Error creating message\n");
1162  return;
1163  }
1164 
1165  /*! If there are manager variables, force a cache update */
1166  if (chan && ast_channel_has_manager_vars()) {
1168  }
1169 
1170  /* This function is NULL safe for global variables */
1172  ast_json_unref(blob);
1173 }
#define ast_log
Definition: astobj2.c:42
int ast_channel_has_manager_vars(void)
Return whether or not any manager variables have been set.
Definition: channel.c:7855
static const char name[]
Definition: format_mp3.c:68
struct stasis_message_type * ast_channel_varset_type(void)
Message type for when a variable is set on a channel.
void ast_channel_publish_snapshot(struct ast_channel *chan)
Publish a ast_channel_snapshot for 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_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
Definition: json.c:73
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
Definition: json.c:591
#define LOG_ERROR
Definition: logger.h:286
Abstract JSON element (object, array, string, int, ...).
int value
Definition: syslog.c:37

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

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

◆ ast_channel_snapshot_create()

struct ast_channel_snapshot* ast_channel_snapshot_create ( struct ast_channel chan)

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

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

Definition at line 451 of file stasis_channels.c.

452 {
453  struct ast_channel_snapshot *old_snapshot;
454  struct ast_channel_snapshot *snapshot;
455 
456  /* no snapshots for dummy channels */
457  if (!ast_channel_tech(chan)) {
458  return NULL;
459  }
460 
461  snapshot = ao2_alloc_options(sizeof(*snapshot), channel_snapshot_dtor,
463  if (!snapshot) {
464  return NULL;
465  }
466 
467  old_snapshot = ast_channel_snapshot(chan);
468 
469  /* Channels automatically have all segments invalidated on them initially so a check for an old
470  * snapshot existing before usage is not done here, as it can not happen. If the stored snapshot
471  * on the channel is updated as a result of this then all segments marked as invalidated will be
472  * cleared.
473  */
475  /* The base information has changed so update our snapshot */
476  snapshot->base = channel_snapshot_base_create(chan);
477  if (!snapshot->base) {
478  ao2_ref(snapshot, -1);
479  return NULL;
480  }
481  } else {
482  snapshot->base = ao2_bump(old_snapshot->base);
483  }
484 
486  /* The peer information has changed so update our snapshot */
487  snapshot->peer = channel_snapshot_peer_create(chan);
488  if (!snapshot->peer) {
489  ao2_ref(snapshot, -1);
490  return NULL;
491  }
492  } else {
493  snapshot->peer = ao2_bump(old_snapshot->peer);
494  }
495 
496  /* Unfortunately both caller and connected information do not have an enforced contract with
497  * the channel API. This has allowed consumers to directly get the caller or connected structure
498  * and manipulate it. Until such time as there is an enforced contract (which is being tracked under
499  * ASTERISK-28164) they are each regenerated every time a channel snapshot is created.
500  */
501  snapshot->caller = channel_snapshot_caller_create(chan);
502  if (!snapshot->caller) {
503  ao2_ref(snapshot, -1);
504  return NULL;
505  }
506 
508  if (!snapshot->connected) {
509  ao2_ref(snapshot, -1);
510  return NULL;
511  }
512 
514  /* The bridge has changed so update our snapshot */
515  snapshot->bridge = channel_snapshot_bridge_create(chan);
516  if (!snapshot->bridge) {
517  ao2_ref(snapshot, -1);
518  return NULL;
519  }
520  } else {
521  snapshot->bridge = ao2_bump(old_snapshot->bridge);
522  }
523 
525  /* The dialplan information has changed so update our snapshot */
526  snapshot->dialplan = channel_snapshot_dialplan_create(chan);
527  if (!snapshot->dialplan) {
528  ao2_ref(snapshot, -1);
529  return NULL;
530  }
531  } else {
532  snapshot->dialplan = ao2_bump(old_snapshot->dialplan);
533  }
534 
536  /* The hangup information has changed so update our snapshot */
537  snapshot->hangup = channel_snapshot_hangup_create(chan);
538  if (!snapshot->hangup) {
539  ao2_ref(snapshot, -1);
540  return NULL;
541  }
542  } else {
543  snapshot->hangup = ao2_bump(old_snapshot->hangup);
544  }
545 
546  snapshot->state = ast_channel_state(chan);
547  snapshot->amaflags = ast_channel_amaflags(chan);
548  ast_copy_flags(&snapshot->flags, ast_channel_flags(chan), 0xFFFFFFFF);
550 
551  /* These have to be recreated as they may have changed, unfortunately */
552  snapshot->manager_vars = ast_channel_get_manager_vars(chan);
553  snapshot->ari_vars = ast_channel_get_ari_vars(chan);
554 
555  return snapshot;
556 }
@ AO2_ALLOC_OPT_LOCK_NOLOCK
Definition: astobj2.h:369
#define ao2_alloc_options(data_size, destructor_fn, options)
Definition: astobj2.h:406
struct varshead * ast_channel_get_ari_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_ari_vars().
Definition: channel.c:7988
struct varshead * ast_channel_get_manager_vars(struct ast_channel *chan)
Gets the variables for a given channel, as specified by ast_channel_set_manager_vars().
Definition: channel.c:7983
enum ama_flags ast_channel_amaflags(const struct ast_channel *chan)
int ast_channel_softhangup_internal_flag(struct ast_channel *chan)
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
ast_channel_state
ast_channel states
Definition: channelstate.h:35
static struct ast_channel_snapshot_base * channel_snapshot_base_create(struct ast_channel *chan)
static struct ast_channel_snapshot_caller * channel_snapshot_caller_create(struct ast_channel *chan)
static struct ast_channel_snapshot_peer * channel_snapshot_peer_create(struct ast_channel *chan)
static struct ast_channel_snapshot_bridge * channel_snapshot_bridge_create(struct ast_channel *chan)
static void channel_snapshot_dtor(void *obj)
static struct ast_channel_snapshot_hangup * channel_snapshot_hangup_create(struct ast_channel *chan)
static struct ast_channel_snapshot_connected * channel_snapshot_connected_create(struct ast_channel *chan)
static struct ast_channel_snapshot_dialplan * channel_snapshot_dialplan_create(struct ast_channel *chan)
struct ast_channel_snapshot_connected * connected
struct varshead * manager_vars
struct varshead * ari_vars
struct ast_channel_snapshot_dialplan * dialplan
struct ast_channel_snapshot_peer * peer
struct ast_channel_snapshot_bridge * bridge
struct ast_channel_snapshot_base * base
enum ast_channel_state state
struct ast_flags softhangup_flags
struct ast_channel_snapshot_caller * caller
struct ast_flags flags
struct ast_channel_snapshot_hangup * hangup
#define ast_set_flag(p, flag)
Definition: utils.h:70
#define ast_copy_flags(dest, src, flagz)
Definition: utils.h:84

References ast_channel_snapshot::amaflags, AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_ref, ast_channel_snapshot::ari_vars, ast_channel_amaflags(), ast_channel_flags(), ast_channel_get_ari_vars(), ast_channel_get_manager_vars(), ast_channel_snapshot(), AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE, AST_CHANNEL_SNAPSHOT_INVALIDATE_BRIDGE, AST_CHANNEL_SNAPSHOT_INVALIDATE_DIALPLAN, AST_CHANNEL_SNAPSHOT_INVALIDATE_HANGUP, AST_CHANNEL_SNAPSHOT_INVALIDATE_PEER, ast_channel_snapshot_segment_flags(), ast_channel_softhangup_internal_flag(), ast_channel_tech(), ast_copy_flags, ast_set_flag, ast_test_flag, ast_channel_snapshot::base, ast_channel_snapshot::bridge, ast_channel_snapshot::caller, channel_snapshot_base_create(), channel_snapshot_bridge_create(), channel_snapshot_caller_create(), channel_snapshot_connected_create(), channel_snapshot_dialplan_create(), channel_snapshot_dtor(), channel_snapshot_hangup_create(), channel_snapshot_peer_create(), ast_channel_snapshot::connected, ast_channel_snapshot::dialplan, ast_channel_snapshot::flags, ast_channel_snapshot::hangup, ast_channel_snapshot::manager_vars, NULL, ast_channel_snapshot::peer, ast_channel_snapshot::softhangup_flags, and ast_channel_snapshot::state.

Referenced by action_agents(), append_expected_event(), ast_channel_publish_dial_internal(), ast_do_pickup(), ast_multi_object_blob_single_channel_publish(), AST_TEST_DEFINE(), channel_snapshot_update_create(), parked_call_app_exec(), parked_call_payload_from_failure(), parked_call_payload_from_parked_user(), queue_publish_multi_channel_blob(), and send_start_msg().

◆ ast_channel_snapshot_get_latest()

struct ast_channel_snapshot* ast_channel_snapshot_get_latest ( const char *  uniqueid)

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

Since
12
Parameters
uniqueidThe channel's unique ID
Returns
A ast_channel_snapshot on success
Return values
NULLon error

Definition at line 903 of file stasis_channels.c.

904 {
905  ast_assert(!ast_strlen_zero(uniqueid));
906 
907  return ao2_find(channel_cache, uniqueid, OBJ_SEARCH_KEY);
908 }
#define ao2_find(container, arg, flags)
Definition: astobj2.h:1756
@ OBJ_SEARCH_KEY
The arg parameter is a search key, but is not an object.
Definition: astobj2.h:1105

References ao2_find, ast_assert, ast_strlen_zero(), channel_cache, and OBJ_SEARCH_KEY.

Referenced by __test_cel_generate_peer_str(), action_confbridgelist_item(), ari_channels_handle_originate_with_id(), ari_channels_handle_snoop_channel(), ast_ari_channels_create(), ast_ari_channels_get(), 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_channel_blob_create_from_cache(), ast_channel_publish_dial_internal(), ast_do_pickup(), ast_rtp_publish_rtcp_message(), ast_sip_for_each_channel_snapshot(), bridge_channel_snapshot_pair_init(), bridge_parking_push(), bridge_show_specific_print_channel(), bridge_stasis_push_peek(), cel_generate_peer_str(), chan_pjsip_devicestate(), channel_replaced_cb(), conf_send_event_to_participants(), find_channel_control(), generate_status(), handle_attended_transfer(), handle_blind_transfer(), handle_hangup(), local_channel_optimization_blob(), local_optimization_started_cb(), mwi_state_create_message(), notify_new_message(), pack_channel_into_message(), publish_chanspy_message(), publish_local_bridge_message(), send_bridge_info_item_cb(), stasis_app_control_get_snapshot(), stasis_app_exec(), and test_cel_generate_peer_str().

◆ ast_channel_snapshot_get_latest_by_name()

struct ast_channel_snapshot* ast_channel_snapshot_get_latest_by_name ( const char *  name)

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

Since
12
Parameters
nameThe channel's name
Returns
A ast_channel_snapshot on success
Return values
NULLon error

Definition at line 910 of file stasis_channels.c.

911 {
913 
915 }

References ao2_find, ast_assert, ast_strlen_zero(), channel_cache_by_name, name, and OBJ_SEARCH_KEY.

Referenced by cli_channel_retrieve_by_id(), and handle_channelstatus().

◆ ast_channel_snapshot_invalidate_segment()

void ast_channel_snapshot_invalidate_segment ( struct ast_channel chan,
enum ast_channel_snapshot_segment_invalidation  segment 
)

◆ ast_channel_snapshot_type()

struct stasis_message_type* ast_channel_snapshot_type ( void  )

◆ ast_channel_stage_snapshot()

void ast_channel_stage_snapshot ( struct ast_channel chan)

◆ ast_channel_stage_snapshot_done()

void ast_channel_stage_snapshot_done ( struct ast_channel chan)

◆ ast_channel_talking_start()

struct stasis_message_type* ast_channel_talking_start ( void  )

Message type for a channel starting talking.

Since
12.4.0
Returns
A stasis message type

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

◆ ast_channel_talking_stop()

struct stasis_message_type* ast_channel_talking_stop ( void  )

Message type for a channel stopping talking.

Since
12.4.0
Returns
A stasis message type

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

◆ ast_channel_topic_all()

struct stasis_topic* ast_channel_topic_all ( void  )

A topic which publishes the events for all channels.

Since
12
Returns
Topic for all channel events.

Definition at line 128 of file stasis_channels.c.

129 {
130  return channel_topic_all;
131 }
static struct stasis_topic * channel_topic_all

References channel_topic_all.

Referenced by ast_channel_internal_setup_topics(), ast_channel_topic(), create_subscriptions(), forwards_create_channel(), manager_channels_init(), manager_confbridge_init(), meetme_stasis_init(), publish_message_for_channel_topics(), and setup_stasis_subs().

◆ ast_channel_unhold_type()

struct stasis_message_type* ast_channel_unhold_type ( void  )

Message type for when a channel is removed from hold.

Since
12
Returns
A stasis message type

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

◆ ast_channel_varset_type()

struct stasis_message_type* ast_channel_varset_type ( void  )

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

Since
12
Returns
A stasis message type

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

◆ ast_debug_category_dtls_id()

uintmax_t ast_debug_category_dtls_id ( void  )

Definition at line 3567 of file rtp_engine.c.

3568 {
3569  return debug_category_dtls_id;
3570 }
static uintmax_t debug_category_dtls_id
Definition: rtp_engine.c:3565

References debug_category_dtls_id.

◆ ast_debug_category_dtls_packet_id()

uintmax_t ast_debug_category_dtls_packet_id ( void  )

Definition at line 3574 of file rtp_engine.c.

3575 {
3577 }
static uintmax_t debug_category_dtls_packet_id
Definition: rtp_engine.c:3572

References debug_category_dtls_packet_id.

◆ ast_debug_category_ice_id()

uintmax_t ast_debug_category_ice_id ( void  )

Definition at line 3581 of file rtp_engine.c.

3582 {
3583  return debug_category_ice_id;
3584 }
static uintmax_t debug_category_ice_id
Definition: rtp_engine.c:3579

References debug_category_ice_id.

◆ ast_debug_category_rtcp_id()

uintmax_t ast_debug_category_rtcp_id ( void  )

Definition at line 3553 of file rtp_engine.c.

3554 {
3555  return debug_category_rtcp_id;
3556 }
static uintmax_t debug_category_rtcp_id
Definition: rtp_engine.c:3551

References debug_category_rtcp_id.

◆ ast_debug_category_rtcp_packet_id()

uintmax_t ast_debug_category_rtcp_packet_id ( void  )

Definition at line 3560 of file rtp_engine.c.

3561 {
3563 }
static uintmax_t debug_category_rtcp_packet_id
Definition: rtp_engine.c:3558

References debug_category_rtcp_packet_id.

◆ ast_debug_category_rtp_id()

uintmax_t ast_debug_category_rtp_id ( void  )

Definition at line 3539 of file rtp_engine.c.

3540 {
3541  return debug_category_rtp_id;
3542 }
static uintmax_t debug_category_rtp_id
Definition: rtp_engine.c:3537

References debug_category_rtp_id.

◆ ast_debug_category_rtp_packet_id()

uintmax_t ast_debug_category_rtp_packet_id ( void  )

Definition at line 3546 of file rtp_engine.c.

3547 {
3549 }
static uintmax_t debug_category_rtp_packet_id
Definition: rtp_engine.c:3544

References debug_category_rtp_packet_id.

◆ ast_endpoint_blob_create()

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

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
endpointEndpoint blob is associated with.
typeMessage type for this blob.
blobJSON 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 293 of file stasis_endpoints.c.

295 {
296  struct ast_endpoint_blob *obj;
297  struct stasis_message *msg;
298 
299  if (!type) {
300  return NULL;
301  }
302  if (!blob) {
303  blob = ast_json_null();
304  }
305 
306  if (!(obj = ao2_alloc(sizeof(*obj), endpoint_blob_dtor))) {
307  return NULL;
308  }
309 
310  if (endpoint) {
311  if (!(obj->snapshot = ast_endpoint_snapshot_create(endpoint))) {
312  ao2_ref(obj, -1);
313 
314  return NULL;
315  }
316  }
317 
318  obj->blob = ast_json_ref(blob);
319  msg = stasis_message_create(type, obj);
320  ao2_ref(obj, -1);
321 
322  return msg;
323 }
#define ao2_alloc(data_size, destructor_fn)
Definition: astobj2.h:411
struct ast_endpoint_snapshot * ast_endpoint_snapshot_create(struct ast_endpoint *endpoint)
Create a snapshot of an endpoint.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
Definition: json.c:67
static void endpoint_blob_dtor(void *obj)
Blob of data associated with an endpoint.
struct ast_endpoint_snapshot * snapshot
struct ast_json * blob

References ao2_alloc, ao2_ref, ast_endpoint_snapshot_create(), ast_json_null(), ast_json_ref(), ast_endpoint_blob::blob, endpoint_blob_dtor(), NULL, ast_endpoint_blob::snapshot, stasis_message_create(), and type.

Referenced by ast_endpoint_blob_publish().

◆ ast_endpoint_blob_publish()

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
endpointEndpoint blob is associated with.
typeMessage type for this blob.
blobJSON object representing the data, or NULL for no data. If NULL, ast_json_null() is put into the object.

Definition at line 325 of file stasis_endpoints.c.

327 {
328  struct stasis_message *message;
329 
330  if (!blob) {
331  return;
332  }
333 
334  message = ast_endpoint_blob_create(endpoint, type, blob);
335  if (message) {
337  ao2_ref(message, -1);
338  }
339 }
struct stasis_topic * ast_endpoint_topic(struct ast_endpoint *endpoint)
Returns the topic for a specific endpoint.
struct stasis_message * ast_endpoint_blob_create(struct ast_endpoint *endpoint, struct stasis_message_type *type, struct ast_json *blob)
Creates a ast_endpoint_blob message.

References ao2_ref, ast_endpoint_blob_create(), ast_endpoint_topic(), stasis_publish(), and type.

Referenced by __expire_registry(), __iax2_poke_noanswer(), ast_sip_persistent_endpoint_publish_contact_state(), ast_sip_persistent_endpoint_update_state(), expire_register(), handle_response_peerpoke(), sip_poke_noanswer(), skinny_register(), skinny_session_cleanup(), socket_process_helper(), unload_module(), and update_registry().

◆ ast_endpoint_cache()

struct stasis_cache* ast_endpoint_cache ( void  )

Backend cache for ast_endpoint_topic_all_cached().

Returns
Cache of ast_endpoint_snapshot.
Since
12

Definition at line 111 of file stasis_endpoints.c.

112 {
114 }
struct stasis_cache * stasis_cp_all_cache(struct stasis_cp_all *all)
Get the cache.
static struct stasis_cp_all * endpoint_cache_all

References endpoint_cache_all, and stasis_cp_all_cache().

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

◆ ast_endpoint_cache_all()

struct stasis_cp_all* ast_endpoint_cache_all ( void  )

Definition at line 106 of file stasis_endpoints.c.

107 {
108  return endpoint_cache_all;
109 }

References endpoint_cache_all.

Referenced by endpoint_internal_create().

◆ ast_endpoint_contact_state_type()

struct stasis_message_type* ast_endpoint_contact_state_type ( void  )

◆ ast_endpoint_latest_snapshot()

struct ast_endpoint_snapshot* ast_endpoint_latest_snapshot ( const char *  tech,
const char *  resource 
)

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

Parameters
techName of the endpoint's technology.
resourceResource 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 341 of file stasis_endpoints.c.

343 {
344  char *id = NULL;
345  struct stasis_message *msg;
346  struct ast_endpoint_snapshot *snapshot;
347 
348  if (ast_strlen_zero(name)) {
349  ast_asprintf(&id, "%s", tech);
350  } else {
351  ast_asprintf(&id, "%s/%s", tech, name);
352  }
353  if (!id) {
354  return NULL;
355  }
356  ast_tech_to_upper(id);
357 
359  ast_free(id);
360  if (!msg) {
361  return NULL;
362  }
363 
364  snapshot = stasis_message_data(msg);
365  ast_assert(snapshot != NULL);
366 
367  ao2_ref(snapshot, +1);
368  ao2_ref(msg, -1);
369 
370  return snapshot;
371 }
#define ast_free(a)
Definition: astmm.h:182
#define ast_asprintf(ret, fmt,...)
A wrapper for asprintf()
Definition: astmm.h:269
struct stasis_cache * ast_endpoint_cache(void)
Backend cache for ast_endpoint_topic_all_cached().
struct stasis_message_type * ast_endpoint_snapshot_type(void)
Message type for ast_endpoint_snapshot.
struct stasis_message * stasis_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.
Definition: stasis_cache.c:686
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
char * ast_tech_to_upper(char *dev_str)
Convert the tech portion of a device string to upper case.
Definition: strings.h:1201
A snapshot of an endpoint's state.
const ast_string_field tech

References ao2_ref, ast_asprintf, ast_assert, ast_endpoint_cache(), ast_endpoint_snapshot_type(), ast_free, ast_strlen_zero(), ast_tech_to_upper(), name, NULL, stasis_cache_get(), stasis_message_data(), and ast_endpoint_snapshot::tech.

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

◆ ast_endpoint_snapshot_create()

struct ast_endpoint_snapshot* ast_endpoint_snapshot_create ( struct ast_endpoint endpoint)

Create a snapshot of an endpoint.

Parameters
endpointEndpoint to snap a shot of.
Returns
Snapshot of the endpoint.
NULL on error.
Since
12

Definition at line 445 of file main/endpoints.c.

447 {
448  struct ast_endpoint_snapshot *snapshot;
449  int channel_count;
450  struct ao2_iterator i;
451  void *obj;
452  SCOPED_AO2LOCK(lock, endpoint);
453 
454  ast_assert(endpoint != NULL);
455  ast_assert(!ast_strlen_zero(endpoint->resource));
456 
457  channel_count = ao2_container_count(endpoint->channel_ids);
458 
459  snapshot = ao2_alloc_options(
460  sizeof(*snapshot) + channel_count * sizeof(char *),
463 
464  if (!snapshot || ast_string_field_init(snapshot, 80) != 0) {
465  ao2_cleanup(snapshot);
466  return NULL;
467  }
468 
469  ast_string_field_build(snapshot, id, "%s/%s", endpoint->tech,
470  endpoint->resource);
471  ast_string_field_set(snapshot, tech, endpoint->tech);
472  ast_string_field_set(snapshot, resource, endpoint->resource);
473 
474  snapshot->state = endpoint->state;
475  snapshot->max_channels = endpoint->max_channels;
476 
477  i = ao2_iterator_init(endpoint->channel_ids, 0);
478  while ((obj = ao2_iterator_next(&i))) {
479  /* The reference is kept so the channel id does not go away until the snapshot is gone */
480  snapshot->channel_ids[snapshot->num_channels++] = obj;
481  }
483 
484  return snapshot;
485 }
ast_mutex_t lock
Definition: app_meetme.c:1093
#define ao2_iterator_next(iter)
Definition: astobj2.h:1933
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags) attribute_warn_unused_result
Create an iterator for a container.
void ao2_iterator_destroy(struct ao2_iterator *iter)
Destroy a container iterator.
#define SCOPED_AO2LOCK(varname, obj)
scoped lock specialization for ao2 mutexes.
Definition: lock.h:602
static void endpoint_snapshot_dtor(void *obj)
#define ast_string_field_set(x, field, data)
Set a field to a simple string value.
Definition: stringfields.h:514
#define ast_string_field_init(x, size)
Initialize a field pool and fields.
Definition: stringfields.h:353
#define ast_string_field_build(x, field, fmt, args...)
Set a field to a complex (built) value.
Definition: stringfields.h:550
When we need to walk through a container, we use an ao2_iterator to keep track of the current positio...
Definition: astobj2.h:1841
enum ast_endpoint_state state
struct ao2_container * channel_ids
const ast_string_field tech
enum ast_endpoint_state state
int max_channels
Max channels for this endpoint. -1 means unlimited or unknown.
const ast_string_field resource

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

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

◆ ast_endpoint_snapshot_type()

struct stasis_message_type* ast_endpoint_snapshot_type ( void  )

◆ ast_endpoint_state_type()

struct stasis_message_type* ast_endpoint_state_type ( void  )

◆ ast_endpoint_topic()

struct stasis_topic* ast_endpoint_topic ( struct ast_endpoint endpoint)

Returns the topic for a specific endpoint.

Parameters
endpointThe endpoint.
Returns
The topic for the given endpoint.
ast_endpoint_topic_all() if endpoint is NULL.
Since
12

Definition at line 93 of file main/endpoints.c.

94 {
95  if (!endpoint) {
96  return ast_endpoint_topic_all();
97  }
98  return stasis_cp_single_topic(endpoint->topics);
99 }
struct stasis_topic * ast_endpoint_topic_all(void)
Topic for all endpoint related messages.
struct stasis_topic * stasis_cp_single_topic(struct stasis_cp_single *one)
Get the topic for this instance.
struct stasis_cp_single * topics

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().

◆ ast_endpoint_topic_all()

struct stasis_topic* ast_endpoint_topic_all ( void  )

Topic for all endpoint related messages.

Since
12

Definition at line 116 of file stasis_endpoints.c.

117 {
119 }
struct stasis_topic * stasis_cp_all_topic(struct stasis_cp_all *all)
Get the aggregate topic.

References endpoint_cache_all, and stasis_cp_all_topic().

Referenced by ast_endpoint_topic().

◆ ast_endpoint_topic_all_cached()

struct stasis_topic* ast_endpoint_topic_all_cached ( void  )

Cached topic for all endpoint related messages.

Since
12

Definition at line 121 of file stasis_endpoints.c.

122 {
124 }
struct stasis_topic * stasis_cp_all_topic_cached(struct stasis_cp_all *all)
Get the caching topic.

References endpoint_cache_all, and stasis_cp_all_topic_cached().

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

◆ ast_endpoint_topic_cached()

struct stasis_topic* ast_endpoint_topic_cached ( struct ast_endpoint endpoint)

Returns the topic for a specific endpoint.

ast_endpoint_snapshot messages are replaced with stasis_cache_update

Parameters
endpointThe endpoint.
Returns
The topic for the given endpoint.
ast_endpoint_topic_all() if endpoint is NULL.
Since
12

Definition at line 101 of file main/endpoints.c.

102 {
103  if (!endpoint) {
105  }
106  return stasis_cp_single_topic_cached(endpoint->topics);
107 }
struct stasis_topic * ast_endpoint_topic_all_cached(void)
Cached topic for all endpoint related messages.
struct stasis_topic * stasis_cp_single_topic_cached(struct stasis_cp_single *one)
Get the caching topic for this instance.

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

Referenced by forwards_create_endpoint().

◆ AST_LIST_ENTRY() [1/2]

AST_LIST_ENTRY ( ast_rtp_engine  )

Linked list information

◆ AST_LIST_ENTRY() [2/2]

AST_LIST_ENTRY ( ast_rtp_glue  )

Linked list information

◆ ast_multi_channel_blob_add_channel()

void ast_multi_channel_blob_add_channel ( struct ast_multi_channel_blob obj,
const char *  role,
struct ast_channel_snapshot snapshot 
)

Add a ast_channel_snapshot to a ast_multi_channel_blob object.

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
objThe ast_multi_channel_blob object that will reference the snapshot
roleA role that the snapshot has in the multi channel relationship
snapshotThe ast_channel_snapshot being added to the ast_multi_channel_blob object

Definition at line 956 of file stasis_channels.c.

957 {
958  struct channel_role_snapshot *role_snapshot;
959  int role_len = strlen(role) + 1;
960 
961  if (!obj || ast_strlen_zero(role) || !snapshot) {
962  return;
963  }
964 
965  role_snapshot = ao2_alloc_options(sizeof(*role_snapshot) + role_len,
967  if (!role_snapshot) {
968  return;
969  }
970  ast_copy_string(role_snapshot->role, role, role_len);
971  role_snapshot->snapshot = snapshot;
972  ao2_ref(role_snapshot->snapshot, +1);
973  ao2_link(obj->channel_snapshots, role_snapshot);
974  ao2_ref(role_snapshot, -1);
975 }
#define ao2_link(container, obj)
Definition: astobj2.h:1549
static void channel_role_snapshot_dtor(void *obj)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Definition: strings.h:401
struct ao2_container * channel_snapshots
A channel snapshot wrapper object used in ast_multi_channel_blob objects.
struct ast_channel_snapshot * snapshot

References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_link, ao2_ref, ast_copy_string(), ast_strlen_zero(), channel_role_snapshot_dtor(), ast_multi_channel_blob::channel_snapshots, channel_role_snapshot::role, and channel_role_snapshot::snapshot.

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().

◆ ast_multi_channel_blob_create()

struct ast_multi_channel_blob* ast_multi_channel_blob_create ( struct ast_json blob)

Create a ast_multi_channel_blob suitable for a stasis_message.

Since
12

The given blob should be treated as immutable and not modified after it is put into the message.

Parameters
blobThe JSON blob that defines the data of this ast_multi_channel_blob
Returns
ast_multi_channel_blob object
Return values
NULLon error

Definition at line 881 of file stasis_channels.c.

882 {
883  struct ast_multi_channel_blob *obj;
884 
885  ast_assert(blob != NULL);
886 
887  obj = ao2_alloc(sizeof(*obj), multi_channel_blob_dtor);
888  if (!obj) {
889  return NULL;
890  }
891 
894  if (!obj->channel_snapshots) {
895  ao2_ref(obj, -1);
896  return NULL;
897  }
898 
899  obj->blob = ast_json_ref(blob);
900  return obj;
901 }
@ AO2_ALLOC_OPT_LOCK_MUTEX
Definition: astobj2.h:365
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
Definition: astobj2.h:1310
static int channel_role_cmp_cb(void *obj, void *arg, int flags)
#define NUM_MULTI_CHANNEL_BLOB_BUCKETS
static int channel_role_hash_cb(const void *obj, const int flags)
static void multi_channel_blob_dtor(void *obj)
A multi channel blob data structure for multi_channel_blob stasis messages.
struct ast_json * blob

References ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, ao2_ref, ast_assert, ast_json_ref(), ast_multi_channel_blob::blob, channel_role_cmp_cb(), channel_role_hash_cb(), ast_multi_channel_blob::channel_snapshots, multi_channel_blob_dtor(), NULL, and NUM_MULTI_CHANNEL_BLOB_BUCKETS.

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().

◆ ast_multi_channel_blob_get_channel()

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

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

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
objThe ast_multi_channel_blob containing the channel snapshot to retrieve
roleThe role associated with the channel snapshot
Returns
ast_channel_snapshot matching the role on success
Return values
NULLon error or not found for the role specified

Definition at line 977 of file stasis_channels.c.

978 {
979  struct channel_role_snapshot *role_snapshot;
980  struct ast_channel_snapshot *snapshot;
981 
982  if (!obj || ast_strlen_zero(role)) {
983  return NULL;
984  }
985  role_snapshot = ao2_find(obj->channel_snapshots, role, OBJ_SEARCH_KEY);
986  /* Note that this function does not increase the ref count on snapshot */
987  if (!role_snapshot) {
988  return NULL;
989  }
990  snapshot = role_snapshot->snapshot;
991  ao2_ref(role_snapshot, -1);
992  return snapshot;
993 }

References ao2_find, ao2_ref, ast_strlen_zero(), ast_multi_channel_blob::channel_snapshots, NULL, OBJ_SEARCH_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(), handle_dial_message(), handle_local_optimization_begin(), handle_local_optimization_end(), local_message_to_ami(), and queue_multi_channel_to_ami().

◆ ast_multi_channel_blob_get_channels()

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

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

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
objThe ast_multi_channel_blob containing the channel snapshots to retrieve
roleThe role associated with the channel snapshots
Returns
A container containing all ast_channel_snapshot objects matching the role on success.
Return values
NULLon error or not found for the role specified

Definition at line 995 of file stasis_channels.c.

996 {
997  struct ao2_container *ret_container;
998  struct ao2_iterator *it_role_snapshots;
999  struct channel_role_snapshot *role_snapshot;
1000  char *arg;
1001 
1002  if (!obj || ast_strlen_zero(role)) {
1003  return NULL;
1004  }
1005 
1009  if (!ret_container) {
1010  return NULL;
1011  }
1012 
1013  arg = ast_strdupa(role);
1014  it_role_snapshots = ao2_callback(obj->channel_snapshots,
1016  if (!it_role_snapshots) {
1017  ao2_ref(ret_container, -1);
1018  return NULL;
1019  }
1020 
1021  while ((role_snapshot = ao2_iterator_next(it_role_snapshots))) {
1022  ao2_link(ret_container, role_snapshot->snapshot);
1023  ao2_ref(role_snapshot, -1);
1024  }
1025  ao2_iterator_destroy(it_role_snapshots);
1026 
1027  return ret_container;
1028 }
#define ast_strdupa(s)
duplicate a string in memory from the stack
Definition: astmm.h:300
#define ao2_callback(c, flags, cb_fn, arg)
Definition: astobj2.h:1716
@ OBJ_MULTIPLE
Definition: astobj2.h:1053
static int channel_snapshot_cmp_cb(void *obj, void *arg, int flags)
static int channel_snapshot_hash_cb(const void *obj, const int flags)
Generic container type.

References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_callback, ao2_container_alloc_hash, ao2_iterator_destroy(), ao2_iterator_next, ao2_link, ao2_ref, ast_strdupa, ast_strlen_zero(), channel_role_cmp_cb(), channel_snapshot_cmp_cb(), channel_snapshot_hash_cb(), ast_multi_channel_blob::channel_snapshots, NULL, NUM_MULTI_CHANNEL_BLOB_BUCKETS, OBJ_MULTIPLE, OBJ_SEARCH_KEY, channel_role_snapshot::role, and channel_role_snapshot::snapshot.

Referenced by AST_TEST_DEFINE().

◆ ast_multi_channel_blob_get_json()

struct ast_json* ast_multi_channel_blob_get_json ( struct ast_multi_channel_blob obj)

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

Since
12
Parameters
objChannel blob object.
Returns
Type field value from the blob.
Return values
NULLon error.

Definition at line 1030 of file stasis_channels.c.

1031 {
1032  if (!obj) {
1033  return NULL;
1034  }
1035  return obj->blob;
1036 }

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().

◆ ast_multi_object_blob_add()

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
multiThe multi object blob previously created
typeType code for the object such as channel, bridge, etc.
objectSnapshot object of the type supplied to typename

Add an object to a multi object blob previously created.

Definition at line 2002 of file stasis.c.

2004 {
2005  if (!multi || !object || AST_VECTOR_APPEND(&multi->snapshots[type], object)) {
2006  ao2_cleanup(object);
2007  }
2008 }
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
Definition: vector.h:256

References ao2_cleanup, AST_VECTOR_APPEND, and type.

Referenced by ast_multi_object_blob_single_channel_publish().

◆ ast_multi_object_blob_create()

struct ast_multi_object_blob* ast_multi_object_blob_create ( struct ast_json blob)

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
blobJson 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
NULLif creation failed

Create a stasis multi object blob.

Definition at line 1976 of file stasis.c.

1977 {
1978  int type;
1979  struct ast_multi_object_blob *multi;
1980 
1981  ast_assert(blob != NULL);
1982 
1983  multi = ao2_alloc(sizeof(*multi), multi_object_blob_dtor);
1984  if (!multi) {
1985  return NULL;
1986  }
1987 
1988  for (type = 0; type < STASIS_UMOS_MAX; ++type) {
1989  if (AST_VECTOR_INIT(&multi->snapshots[type], 0)) {
1990  ao2_ref(multi, -1);
1991 
1992  return NULL;
1993  }
1994  }
1995 
1996  multi->blob = ast_json_ref(blob);
1997 
1998  return multi;
1999 }
#define STASIS_UMOS_MAX
Number of snapshot types.
Definition: stasis.h:1362
static void multi_object_blob_dtor(void *obj)
Definition: stasis.c:1960
A multi object blob data structure to carry user event stasis messages.
Definition: stasis.c:1951
struct ast_json * blob
Definition: stasis.c:1952
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
Definition: vector.h:113

References ao2_alloc, ao2_ref, ast_assert, ast_json_ref(), AST_VECTOR_INIT, ast_multi_object_blob::blob, multi_object_blob_dtor(), NULL, STASIS_UMOS_MAX, and type.

Referenced by ast_multi_object_blob_single_channel_publish().

◆ ast_multi_object_blob_single_channel_publish()

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
chanThe channel to snapshot and publish event to
typeThe message type
blobA json blob to publish with the snapshot

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

Definition at line 2011 of file stasis.c.

2013 {
2014  struct stasis_message *message;
2015  struct ast_channel_snapshot *channel_snapshot;
2016  struct ast_multi_object_blob *multi;
2017 
2018  if (!type) {
2019  return;
2020  }
2021 
2023  if (!multi) {
2024  return;
2025  }
2026 
2027  channel_snapshot = ast_channel_snapshot_create(chan);
2028  if (!channel_snapshot) {
2029  ao2_ref(multi, -1);
2030  return;
2031  }
2032 
2033  /* this call steals the channel_snapshot reference */
2034  ast_multi_object_blob_add(multi, STASIS_UMOS_CHANNEL, channel_snapshot);
2035 
2037  ao2_ref(multi, -1);
2038  if (message) {
2039  /* app_userevent still publishes to channel */
2041  ao2_ref(message, -1);
2042  }
2043 }
struct ast_multi_object_blob * ast_multi_object_blob_create(struct ast_json *blob)
Create a stasis user event multi object blob.
Definition: stasis.c:1976
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 (snapshot) to the blob.
Definition: stasis.c:2002
struct ast_channel_snapshot * ast_channel_snapshot_create(struct ast_channel *chan)
Generate a snapshot of the channel state. This is an ao2 object, so ao2_cleanup() to deallocate.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
Definition: stasis.c:1512

References ao2_ref, ast_channel_snapshot_create(), ast_channel_topic(), ast_multi_object_blob_add(), ast_multi_object_blob_create(), ast_multi_object_blob::blob, stasis_message_create(), stasis_publish(), STASIS_UMOS_CHANNEL, and type.

Referenced by userevent_exec().

◆ ast_multi_user_event_type()

struct stasis_message_type* ast_multi_user_event_type ( void  )

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_cleanup(), stasis_init(), and userevent_exec().

◆ ast_mwi_blob_create()

struct stasis_message* ast_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.

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_stateMWI state associated with the update
message_typeThe type of message to create
blobJSON object representing the data.
Returns
ast_mwi_blob message.
NULL on error

Definition at line 462 of file mwi.c.

465 {
466  struct ast_mwi_blob *obj;
467  struct stasis_message *msg;
468 
469  ast_assert(blob != NULL);
470 
471  if (!message_type) {
472  return NULL;
473  }
474 
475  obj = ao2_alloc(sizeof(*obj), mwi_blob_dtor);
476  if (!obj) {
477  return NULL;
478  }
479 
480  obj->mwi_state = mwi_state;
481  ao2_ref(obj->mwi_state, +1);
482  obj->blob = ast_json_ref(blob);
483 
484  /* This is not a normal MWI event. Only used by the MinivmNotify app. */
485  msg = stasis_message_create(message_type, obj);
486  ao2_ref(obj, -1);
487 
488  return msg;
489 }
struct ast_mwi_state * mwi_state
Definition: mwi.h:474
struct ast_json * blob
Definition: mwi.h:475
static void mwi_blob_dtor(void *obj)
Definition: mwi.c:454
Object that represents an MWI update with some additional application defined data.
Definition: mwi.h:473

References ao2_alloc, ao2_ref, ast_assert, ast_json_ref(), ast_mwi_blob::blob, mwi_blob_dtor(), ast_mwi_blob::mwi_state, NULL, and stasis_message_create().

Referenced by notify_new_message().

◆ ast_mwi_create()

struct ast_mwi_state* ast_mwi_create ( const char *  mailbox,
const char *  context 
)

Create a ast_mwi_state object.

Since
12
Parameters
[in]mailboxThe mailbox identifier string.
[in]contextThe context this mailbox resides in (NULL or "" if only using mailbox)
Return values

Definition at line 148 of file mwi.c.

149 {
150  return mwi_create_state(mailbox, context, 0, 0, 0);
151 }
static char context[AST_MAX_CONTEXT]
Definition: chan_alsa.c:120
static char mailbox[AST_MAX_MAILBOX_UNIQUEID]
Definition: chan_mgcp.c:207
static struct ast_mwi_state * mwi_create_state(const char *mailbox, const char *context, int urgent_msgs, int new_msgs, int old_msgs)
Definition: mwi.c:105

References context, mailbox, and mwi_create_state().

Referenced by notify_new_message().

◆ ast_mwi_state_cache()

struct stasis_cache* ast_mwi_state_cache ( void  )

Backend cache for ast_mwi_topic_cached().

Return values
Cacheof ast_mwi_state.

Definition at line 90 of file mwi.c.

91 {
92  return mwi_state_cache;
93 }
static struct stasis_cache * mwi_state_cache
Definition: mwi.c:33

References mwi_state_cache.

Referenced by ast_delete_mwi_state_full(), asterisk_publication_mwi_refresh(), asterisk_start_mwi_publishing(), get_cached_mwi(), has_voicemail(), unistim_send_mwi_to_peer(), and update_registry().

◆ ast_mwi_state_type()

struct stasis_message_type* ast_mwi_state_type ( void  )

◆ ast_mwi_topic()

struct stasis_topic* ast_mwi_topic ( const char *  uniqueid)

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

Parameters
uniqueidThe unique id for which to get the topic
Return values
Thetopic structure for MWI messages for a given uniqueid
NULLif it failed to be found or allocated
Since
12

Definition at line 100 of file mwi.c.

101 {
102  return stasis_state_topic(mwi_state_manager, uniqueid);
103 }
static struct stasis_state_manager * mwi_state_manager
Definition: mwi.c:32
struct stasis_topic * stasis_state_topic(struct stasis_state_manager *manager, const char *id)
Retrieve a managed topic creating one if not currently managed.
Definition: stasis_state.c:370

References mwi_state_manager, and stasis_state_topic().

Referenced by notify_new_message().

◆ ast_mwi_topic_all()

struct stasis_topic* ast_mwi_topic_all ( void  )

Get the Stasis Message Bus API topic for MWI messages.

Return values
Thetopic structure for MWI messages
NULLif it has not been allocated
Since
12

Definition at line 85 of file mwi.c.

86 {
88 }
struct stasis_topic * stasis_state_all_topic(struct stasis_state_manager *manager)
Retrieve the manager's topic (the topic that all state topics get forwarded to)
Definition: stasis_state.c:365

References mwi_state_manager, and stasis_state_all_topic().

Referenced by asterisk_start_mwi_publishing(), manager_mwi_init(), mwi_init(), and xmpp_init_event_distribution().

◆ ast_mwi_topic_cached()

struct stasis_topic* ast_mwi_topic_cached ( void  )

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

Return values
Thecaching topic structure for MWI messages
NULLif it has not been allocated
Since
12

Definition at line 95 of file mwi.c.

96 {
98 }
static struct stasis_caching_topic * mwi_topic_cached
Definition: mwi.c:34
struct stasis_topic * stasis_caching_get_topic(struct stasis_caching_topic *caching_topic)
Returns the topic of cached events from a caching topics.
Definition: stasis_cache.c:85

References mwi_topic_cached, and stasis_caching_get_topic().

◆ ast_mwi_vm_app_type()

struct stasis_message_type* ast_mwi_vm_app_type ( void  )

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
Thestasis_message_type for voicemail application specific messages
NULLon error
Since
12

Referenced by manager_mwi_init(), mwi_cleanup(), mwi_init(), and notify_new_message().

◆ ast_parked_call_type()

struct stasis_message_type* ast_parked_call_type ( void  )

accessor for the parked call stasis message type

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

Referenced by ast_parking_stasis_init(), create_parked_subscription_full(), create_routes(), load_module(), park_and_announce_app_exec(), park_announce_update_cb(), parker_update_cb(), parking_event_cb(), parking_manager_enable_stasis(), parking_stasis_cleanup(), publish_parked_call(), and publish_parked_call_failure().

◆ ast_parking_topic()

struct stasis_topic* ast_parking_topic ( void  )

accessor for the parking stasis topic

Since
12
Return values
NULLif the parking topic hasn't been created or has been disabled
Returns
a pointer to the parking topic

Definition at line 67 of file parking.c.

68 {
69  return parking_topic;
70 }
static struct stasis_topic * parking_topic
Topic for parking lots.
Definition: parking.c:41

References parking_topic.

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().

◆ ast_rtp_convert_stats_json()

struct ast_json* ast_rtp_convert_stats_json ( const struct ast_rtp_instance_stats stats)

Convert given stat instance into json format.

Parameters
stats
Return values
Ajson format stat

Definition at line 3957 of file rtp_engine.c.

3958 {
3959  struct ast_json *j_res;
3960  int ret;
3961 
3962  j_res = ast_json_object_create();
3963  if (!j_res) {
3964  return NULL;
3965  }
3966 
3967  /* set mandatory items */
3968  ret = ast_json_object_set(j_res, "txcount", ast_json_integer_create(stats->txcount));
3969  ret |= ast_json_object_set(j_res, "rxcount", ast_json_integer_create(stats->rxcount));
3970 
3971  ret |= ast_json_object_set(j_res, "txploss", ast_json_integer_create(stats->txploss));
3972  ret |= ast_json_object_set(j_res, "rxploss", ast_json_integer_create(stats->rxploss));
3973 
3974  ret |= ast_json_object_set(j_res, "local_ssrc", ast_json_integer_create(stats->local_ssrc));
3975  ret |= ast_json_object_set(j_res, "remote_ssrc", ast_json_integer_create(stats->remote_ssrc));
3976 
3977  ret |= ast_json_object_set(j_res, "txoctetcount", ast_json_integer_create(stats->txoctetcount));
3978  ret |= ast_json_object_set(j_res, "rxoctetcount", ast_json_integer_create(stats->rxoctetcount));
3979 
3980  ret |= ast_json_object_set(j_res, "channel_uniqueid", ast_json_string_create(stats->channel_uniqueid));
3981  if (ret) {
3982  ast_log(LOG_WARNING, "Could not create rtp statistics info. channel: %s\n", stats->channel_uniqueid);
3983  ast_json_unref(j_res);
3984  return NULL;
3985  }
3986 
3987  /* set other items */
3988  SET_AST_JSON_OBJ(j_res, "txjitter", ast_json_real_create(stats->txjitter));
3989  SET_AST_JSON_OBJ(j_res, "rxjitter", ast_json_real_create(stats->rxjitter));
3990 
3991  SET_AST_JSON_OBJ(j_res, "remote_maxjitter", ast_json_real_create(stats->remote_maxjitter));
3992  SET_AST_JSON_OBJ(j_res, "remote_minjitter", ast_json_real_create(stats->remote_minjitter));
3993  SET_AST_JSON_OBJ(j_res, "remote_normdevjitter", ast_json_real_create(stats->remote_normdevjitter));
3994  SET_AST_JSON_OBJ(j_res, "remote_stdevjitter", ast_json_real_create(stats->remote_stdevjitter));
3995 
3996  SET_AST_JSON_OBJ(j_res, "local_maxjitter", ast_json_real_create(stats->local_maxjitter));
3997  SET_AST_JSON_OBJ(j_res, "local_minjitter", ast_json_real_create(stats->local_minjitter));
3998  SET_AST_JSON_OBJ(j_res, "local_normdevjitter", ast_json_real_create(stats->local_normdevjitter));
3999  SET_AST_JSON_OBJ(j_res, "local_stdevjitter", ast_json_real_create(stats->local_stdevjitter));
4000 
4001  SET_AST_JSON_OBJ(j_res, "remote_maxrxploss", ast_json_real_create(stats->remote_maxrxploss));
4002  SET_AST_JSON_OBJ(j_res, "remote_minrxploss", ast_json_real_create(stats->remote_minrxploss));
4003  SET_AST_JSON_OBJ(j_res, "remote_normdevrxploss", ast_json_real_create(stats->remote_normdevrxploss));
4004  SET_AST_JSON_OBJ(j_res, "remote_stdevrxploss", ast_json_real_create(stats->remote_stdevrxploss));
4005 
4006  SET_AST_JSON_OBJ(j_res, "local_maxrxploss", ast_json_real_create(stats->local_maxrxploss));
4007  SET_AST_JSON_OBJ(j_res, "local_minrxploss", ast_json_real_create(stats->local_minrxploss));
4008  SET_AST_JSON_OBJ(j_res, "local_normdevrxploss", ast_json_real_create(stats->local_normdevrxploss));
4009  SET_AST_JSON_OBJ(j_res, "local_stdevrxploss", ast_json_real_create(stats->local_stdevrxploss));
4010 
4011  SET_AST_JSON_OBJ(j_res, "rtt", ast_json_real_create(stats->rtt));
4012  SET_AST_JSON_OBJ(j_res, "maxrtt", ast_json_real_create(stats->maxrtt));
4013  SET_AST_JSON_OBJ(j_res, "minrtt", ast_json_real_create(stats->minrtt));
4014  SET_AST_JSON_OBJ(j_res, "normdevrtt", ast_json_real_create(stats->normdevrtt));
4015  SET_AST_JSON_OBJ(j_res, "stdevrtt", ast_json_real_create(stats->stdevrtt));
4016 
4017  return j_res;
4018 }
unsigned int remote_ssrc
Definition: rtp_engine.h:424
unsigned int rxcount
Definition: rtp_engine.h:370
unsigned int local_ssrc
Definition: rtp_engine.h:422
unsigned int rxoctetcount
Definition: rtp_engine.h:430
unsigned int rxploss
Definition: rtp_engine.h:394
unsigned int txcount
Definition: rtp_engine.h:368
unsigned int txploss
Definition: rtp_engine.h:392
unsigned int txoctetcount
Definition: rtp_engine.h:428
char channel_uniqueid[MAX_CHANNEL_ID]
Definition: rtp_engine.h:426
struct ast_json * ast_json_real_create(double value)
Create a JSON real number.
Definition: json.c:332
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
Definition: json.c:389
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
Definition: json.c:404
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
Definition: json.c:317
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
Definition: json.c:268
#define LOG_WARNING
Definition: logger.h:275
#define SET_AST_JSON_OBJ(target, name, obj)
Set given json object into target with name.
Definition: rtp_engine.c:288

References ast_json_integer_create(), ast_json_object_create(), ast_json_object_set(), ast_json_real_create(), ast_json_string_create(), ast_json_unref(), ast_log, ast_rtp_instance_stats::channel_uniqueid, ast_rtp_instance_stats::local_maxjitter, ast_rtp_instance_stats::local_maxrxploss, ast_rtp_instance_stats::local_minjitter, ast_rtp_instance_stats::local_minrxploss, ast_rtp_instance_stats::local_normdevjitter, ast_rtp_instance_stats::local_normdevrxploss, ast_rtp_instance_stats::local_ssrc, ast_rtp_instance_stats::local_stdevjitter, ast_rtp_instance_stats::local_stdevrxploss, LOG_WARNING, ast_rtp_instance_stats::maxrtt, ast_rtp_instance_stats::minrtt, ast_rtp_instance_stats::normdevrtt, NULL, ast_rtp_instance_stats::remote_maxjitter, ast_rtp_instance_stats::remote_maxrxploss, ast_rtp_instance_stats::remote_minjitter, ast_rtp_instance_stats::remote_minrxploss, ast_rtp_instance_stats::remote_normdevjitter, ast_rtp_instance_stats::remote_normdevrxploss, ast_rtp_instance_stats::remote_ssrc, ast_rtp_instance_stats::remote_stdevjitter, ast_rtp_instance_stats::remote_stdevrxploss, ast_rtp_instance_stats::rtt, ast_rtp_instance_stats::rxcount, ast_rtp_instance_stats::rxjitter, ast_rtp_instance_stats::rxoctetcount, ast_rtp_instance_stats::rxploss, SET_AST_JSON_OBJ, ast_rtp_instance_stats::stdevrtt, ast_rtp_instance_stats::txcount, ast_rtp_instance_stats::txjitter, ast_rtp_instance_stats::txoctetcount, and ast_rtp_instance_stats::txploss.

Referenced by ast_rtp_instance_get_stats_all_json().

◆ ast_rtp_get_rate()

int ast_rtp_get_rate ( const struct ast_format format)

Retrieve the sample rate of a format according to RTP specifications.

Since
16.7.0
17.1.0
Parameters
formatThe media format
Return values
Thesample rate

Definition at line 4031 of file rtp_engine.c.

4032 {
4033  /* For those wondering: due to a fluke in RFC publication, G.722 is advertised
4034  * as having a sample rate of 8kHz, while implementations must know that its
4035  * real rate is 16kHz. Seriously.
4036  */
4038 }
static snd_pcm_format_t format
Definition: chan_alsa.c:106
unsigned int ast_format_get_sample_rate(const struct ast_format *format)
Get the sample rate of a media format.
Definition: format.c:379
enum ast_format_cmp_res ast_format_cmp(const struct ast_format *format1, const struct ast_format *format2)
Compare two formats.
Definition: format.c:201
@ AST_FORMAT_CMP_EQUAL
Definition: format.h:36
struct ast_format * ast_format_g722
Built-in cached g722 format.
Definition: format_cache.c:106

Referenced by ast_rtcp_calculate_sr_rr_statistics(), ast_rtcp_generate_report(), ast_rtp_dtmf_end_with_duration(), ast_rtp_interpret(), calc_rxstamp(), process_dtmf_cisco(), process_dtmf_rfc2833(), and rtp_raw_write().

◆ ast_rtp_instance_get_stats_all_json()

struct ast_json* ast_rtp_instance_get_stats_all_json ( struct ast_rtp_instance instance)

Retrieve statistics about an RTP instance in json format.

Parameters
instance
Return values
jsonobject of stats

Definition at line 4020 of file rtp_engine.c.

4021 {
4022  struct ast_rtp_instance_stats stats = {0,};
4023 
4024  if(ast_rtp_instance_get_stats(instance, &stats, AST_RTP_INSTANCE_STAT_ALL)) {
4025  return NULL;
4026  }
4027 
4028  return ast_rtp_convert_stats_json(&stats);
4029 }
@ AST_RTP_INSTANCE_STAT_ALL
Definition: rtp_engine.h:182
struct ast_json * ast_rtp_convert_stats_json(const struct ast_rtp_instance_stats *stats)
Convert given stat instance into json format.
Definition: rtp_engine.c:3957
int ast_rtp_instance_get_stats(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat)
Retrieve statistics about an RTP instance.
Definition: rtp_engine.c:2446

References ast_rtp_convert_stats_json(), ast_rtp_instance_get_stats(), AST_RTP_INSTANCE_STAT_ALL, and NULL.

Referenced by ast_ari_channels_rtpstatistics().

◆ ast_rtp_rtcp_received_type()

struct stasis_message_type* ast_rtp_rtcp_received_type ( void  )

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

Since
12
Return values
Astasis message type

Referenced by ast_rtcp_interpret(), ast_rtp_engine_init(), load_module(), rtcp_report_to_ami(), rtcp_report_to_json(), rtp_engine_shutdown(), and rtp_topic_handler().

◆ ast_rtp_rtcp_sent_type()

struct stasis_message_type* ast_rtp_rtcp_sent_type ( void  )

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

Since
12
Return values
Astasis message type

Referenced by ast_rtcp_calculate_sr_rr_statistics(), ast_rtp_engine_init(), load_module(), rtp_engine_shutdown(), and rtp_topic_handler().

◆ ast_rtp_topic()

struct stasis_topic* ast_rtp_topic ( void  )

Stasis Message Bus API topic for RTP and RTCP related messages

Since
12
Return values
AStasis Message Bus API topic

Definition at line 3532 of file rtp_engine.c.

3533 {
3534  return rtp_topic;
3535 }
static struct stasis_topic * rtp_topic
Stasis Message Bus API topic for RTP related messages
Definition: rtp_engine.c:278

References rtp_topic.

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

◆ AST_VECTOR()

AST_VECTOR ( struct ast_rtp_payload_type )

Rx payload type mapping exceptions

◆ mwi_init()

int mwi_init ( void  )

Initialize the mwi core.

Return values
0Success
-1Failure
Since
13.27.0
16.4.0

Definition at line 502 of file mwi.c.

503 {
505 
507  return -1;
508  }
509 
511  return -1;
512  }
513 
515  if (!mwi_state_manager) {
516  return -1;
517  }
518 
520  if (!mwi_state_cache) {
521  return -1;
522  }
523 
525  if (!mwi_topic_cached) {
526  return -1;
527  }
528 
529  return 0;
530 }
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Definition: clicompat.c:19
struct stasis_message_type * ast_mwi_vm_app_type(void)
Get the Stasis Message Bus API message type for voicemail application specific messages.
struct stasis_topic * ast_mwi_topic_all(void)
Get the Stasis Message Bus API topic for MWI messages.
Definition: mwi.c:85
struct stasis_message_type * ast_mwi_state_type(void)
Get the Stasis Message Bus API message type for MWI messages.
static const char * mwi_state_get_id(struct stasis_message *message)
Definition: mwi.c:441
static void mwi_cleanup(void)
Definition: mwi.c:491
struct stasis_caching_topic * stasis_caching_topic_create(struct stasis_topic *original_topic, struct stasis_cache *cache)
Create a topic which monitors and caches messages from another topic.
Definition: stasis_cache.c:948
struct stasis_cache * stasis_cache_create(snapshot_get_id id_fn)
Create a cache.
Definition: stasis_cache.c:360
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
Definition: stasis.h:1495
struct stasis_state_manager * stasis_state_manager_create(const char *topic_name)
Create a stasis state manager.
Definition: stasis_state.c:325

References ast_mwi_state_type(), ast_mwi_topic_all(), ast_mwi_vm_app_type(), ast_register_cleanup(), mwi_cleanup(), mwi_state_cache, mwi_state_get_id(), mwi_state_manager, mwi_topic_cached, stasis_cache_create(), stasis_caching_topic_create(), STASIS_MESSAGE_TYPE_INIT, and stasis_state_manager_create().

Referenced by asterisk_daemon().

◆ stasis_cache_clear_type()

struct stasis_message_type* stasis_cache_clear_type ( void  )

Message type for clearing a message from a stasis cache.

Since
12

Referenced by caching_topic_exec(), stasis_cache_cleanup(), stasis_cache_clear_create(), stasis_cache_init(), and stasis_caching_accept_message_type().

◆ stasis_cache_update_type()

struct stasis_message_type* stasis_cache_update_type ( void  )

Message type for cache update messages.

Returns
Message type for cache update messages.
Since
12

Referenced by AST_TEST_DEFINE(), cache_update(), find_route(), load_module(), stasis_cache_cleanup(), stasis_cache_init(), stasis_message_router_add_cache_update(), sub_endpoint_update_handler(), and update_create().

◆ stasis_subscription_change_type()

struct stasis_message_type* stasis_subscription_change_type ( void  )

◆ stasis_test_message_create()

struct stasis_message* stasis_test_message_create ( void  )

Creates a test message.

Definition at line 236 of file res_stasis_test.c.

237 {
238  RAII_VAR(void *, data, NULL, ao2_cleanup);
239 
240  if (!stasis_test_message_type()) {
241  return NULL;
242  }
243 
244  /* We just need the unique pointer; don't care what's in it */
245  data = ao2_alloc(1, NULL);
246  if (!data) {
247  return NULL;
248  }
249 
251 }
struct stasis_message_type * stasis_test_message_type(void)
Gets the type of messages created by stasis_test_message_create().
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
Definition: utils.h:911

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

◆ stasis_test_message_type()

struct stasis_message_type* stasis_test_message_type ( void  )

Gets the type of messages created by stasis_test_message_create().

Referenced by stasis_test_message_create(), and unload_module().

Variable Documentation

◆ 

union { ... }

◆ __field_mgr

struct ast_string_field_mgr __field_mgr

Definition at line 460 of file mwi.h.

◆ __field_mgr_pool

struct ast_string_field_pool* __field_mgr_pool

< Unique identifier for this mailbox

Definition at line 460 of file mwi.h.

◆ activate

int(* activate) (struct ast_rtp_instance *instance)

Callback to indicate that packets will now flow

Definition at line 673 of file rtp_engine.h.

Referenced by ast_rtp_instance_activate().

◆ active

int(* active) (struct ast_rtp_instance *instance)

Get if the DTLS SRTP support is active or not

Definition at line 574 of file rtp_engine.h.

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

◆ add_remote_candidate

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

Callback for adding a remote candidate

Definition at line 489 of file rtp_engine.h.

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

◆ address

◆ allow_rtp_remote

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.

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.

Definition at line 735 of file rtp_engine.h.

Referenced by rtp_glue_data_get().

◆ allow_vrtp_remote

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.

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.

Definition at line 747 of file rtp_engine.h.

Referenced by rtp_glue_data_get().

◆ asterisk_format

int asterisk_format

◆ available_formats

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)

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

Definition at line 677 of file rtp_engine.h.

Referenced by ast_rtp_instance_available_formats().

◆ blob

struct ast_json* blob

JSON blob of data

Definition at line 475 of file mwi.h.

Referenced by ast_mwi_blob_create(), mwi_app_event_cb(), and mwi_blob_dtor().

◆ br_exp

unsigned int br_exp

Exponential scaling of the mantissa for the maximum total media bit rate value

Definition at line 351 of file rtp_engine.h.

Referenced by ast_rtcp_interpret(), AST_TEST_DEFINE(), remb_collect_report(), remb_hook_event_cb(), remb_send_report(), and rtp_write_rtcp_psfb().

◆ br_mantissa

unsigned int br_mantissa

The mantissa of the maximum total media bit rate

Definition at line 352 of file rtp_engine.h.

Referenced by ast_rtcp_interpret(), AST_TEST_DEFINE(), remb_collect_report(), remb_hook_event_cb(), remb_send_report(), and rtp_write_rtcp_psfb().

◆ bundle

int(* bundle) (struct ast_rtp_instance *child, struct ast_rtp_instance *parent)

Callback to bundle an RTP instance to another

Definition at line 685 of file rtp_engine.h.

Referenced by ast_rtp_instance_bundle().

◆ cafile

char* cafile

◆ capath

char* capath

◆ certfile

char* certfile

◆ change_components

void(* change_components) (struct ast_rtp_instance *instance, int num_components)

Callback to alter the number of ICE components on a session

Definition at line 509 of file rtp_engine.h.

Referenced by rtp_ice_wrap_change_components(), and set_ice_components().

◆ change_source

void(* change_source) (struct ast_rtp_instance *instance)

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

Definition at line 635 of file rtp_engine.h.

Referenced by ast_rtp_instance_change_source().

◆ channel_uniqueid

char channel_uniqueid[MAX_CHANNEL_ID]

The Asterisk channel's unique ID that owns this instance

Definition at line 426 of file rtp_engine.h.

Referenced by ast_rtp_convert_stats_json(), and ast_rtp_get_stat().

◆ cipher

char* cipher

◆ cname_get

const char*(* cname_get) (struct ast_rtp_instance *instance)

Callback to retrieve RTCP SDES CNAME

Definition at line 683 of file rtp_engine.h.

Referenced by ast_rtp_instance_get_cname().

◆ codecs_lock

ast_rwlock_t codecs_lock

RW lock that protects elements in this structure

Definition at line 707 of file rtp_engine.h.

Referenced by ast_rtp_codecs_payloads_copy(), and ast_rtp_codecs_payloads_xover().

◆ default_setup

enum ast_rtp_dtls_setup default_setup

Default setup type to use for outgoing

Definition at line 556 of file rtp_engine.h.

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

◆ destroy

int(* destroy) (struct ast_rtp_instance *instance)

Callback for destroying an RTP instance

Definition at line 622 of file rtp_engine.h.

Referenced by ast_rtp_engine_register2(), and instance_destructor().

◆ dlsr

unsigned int dlsr

◆ dtls

struct ast_rtp_engine_dtls* dtls

◆ dtmf_begin

int(* dtmf_begin) (struct ast_rtp_instance *instance, char digit)

Callback for starting RFC2833 DTMF transmission

Definition at line 628 of file rtp_engine.h.

Referenced by ast_rtp_instance_dtmf_begin().

◆ dtmf_compatible

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

Callback to see if two instances are compatible with DTMF

Definition at line 671 of file rtp_engine.h.

Referenced by native_rtp_bridge_compatible_check().

◆ dtmf_end

int(* dtmf_end) (struct ast_rtp_instance *instance, char digit)

Callback for stopping RFC2833 DTMF transmission

Definition at line 630 of file rtp_engine.h.

Referenced by ast_rtp_instance_dtmf_end().

◆ dtmf_end_with_duration

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

Definition at line 631 of file rtp_engine.h.

Referenced by ast_rtp_instance_dtmf_end_with_duration().

◆ dtmf_mode_get

enum ast_rtp_dtmf_mode(* dtmf_mode_get) (struct ast_rtp_instance *instance)

Callback for getting DTMF mode

Definition at line 647 of file rtp_engine.h.

◆ dtmf_mode_set

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

Callback for changing DTMF mode

Definition at line 647 of file rtp_engine.h.

Referenced by ast_rtp_instance_dtmf_mode_get().

◆ eid

struct ast_eid eid

The EID of the server where this message originated

Definition at line 464 of file mwi.h.

Referenced by ast_delete_mwi_state_full(), asterisk_publisher_mwistate_cb(), mwi_state_create_message(), mwi_to_event(), and xmpp_pubsub_mwi_cb().

◆ enabled

unsigned int enabled

◆ ephemeral_cert

unsigned int ephemeral_cert

Whether to not to generate an ephemeral certificate - defaults to 0 (off)

Definition at line 566 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), ast_rtp_dtls_cfg_parse(), ast_rtp_dtls_cfg_validate(), dtlsautogeneratecert_to_str(), and sip_endpoint_apply_handler().

◆ extended_prop_get

void*(* extended_prop_get) (struct ast_rtp_instance *instance, int property)

Callback for getting an extended RTP property

Definition at line 639 of file rtp_engine.h.

Referenced by ast_rtp_instance_get_extended_prop().

◆ extended_prop_set

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

Callback for setting an extended RTP property

Definition at line 637 of file rtp_engine.h.

Referenced by ast_rtp_instance_set_extended_prop().

◆ extension_enable

int(* extension_enable) (struct ast_rtp_instance *instance, enum ast_rtp_extension extension)

Callback to enable an RTP extension (returns non-zero if supported)

Definition at line 699 of file rtp_engine.h.

Referenced by ast_rtp_instance_extmap_enable().

◆ fd

int(* fd) (struct ast_rtp_instance *instance, int rtcp)

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

Definition at line 655 of file rtp_engine.h.

Referenced by ast_rtp_instance_fd().

◆ fmt

unsigned int fmt

◆ format

struct ast_format* format

If asterisk_format is set, this is the internal asterisk format represented by the payload

Definition at line 278 of file rtp_engine.h.

Referenced by ast_rtp_codecs_payloads_set_rtpmap_type_rate(), payload_mapping_rx_clear_primary(), payload_mapping_tx_is_present(), and set_next_mime_type().

◆ foundation

char* foundation

◆ fraction [1/2]

unsigned short fraction

◆ fraction [2/2]

unsigned short fraction

Definition at line 319 of file rtp_engine.h.

◆ framing

unsigned int framing

The framing for this media session

Definition at line 713 of file rtp_engine.h.

Referenced by ast_rtp_codecs_payloads_copy(), and ast_rtp_codecs_payloads_xover().

◆ get_codec

void(* get_codec) (struct ast_channel *chan, struct ast_format_cap *result_cap)

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

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.

Definition at line 761 of file rtp_engine.h.

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

◆ get_connection

enum ast_rtp_dtls_connection(* get_connection) (struct ast_rtp_instance *instance)

Get the current connection state

Definition at line 578 of file rtp_engine.h.

Referenced by add_crypto_to_stream(), and add_dtls_to_sdp().

◆ get_fingerprint

const char*(* get_fingerprint) (struct ast_rtp_instance *instance)

Get the local fingerprint

Definition at line 590 of file rtp_engine.h.

Referenced by add_crypto_to_stream(), add_dtls_to_sdp(), and rtp_dtls_wrap_get_fingerprint().

◆ get_fingerprint_hash

enum ast_rtp_dtls_hash(* get_fingerprint_hash) (struct ast_rtp_instance *instance)

Get the local fingerprint hash type

Definition at line 586 of file rtp_engine.h.

Referenced by add_crypto_to_stream(), and add_dtls_to_sdp().

◆ get_local_candidates

struct ao2_container*(* get_local_candidates) (struct ast_rtp_instance *instance)

◆ get_password

const char*(* get_password) (struct ast_rtp_instance *instance)

◆ get_rtp_info

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.

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

Definition at line 724 of file rtp_engine.h.

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

◆ get_setup

enum ast_rtp_dtls_setup(* get_setup) (struct ast_rtp_instance *instance)

Get the current setup state

Definition at line 578 of file rtp_engine.h.

Referenced by add_crypto_to_stream(), and add_dtls_to_sdp().

◆ get_stat

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

Callback for retrieving statistics

Definition at line 651 of file rtp_engine.h.

Referenced by ast_rtp_instance_get_stats().

◆ get_trtp_info

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.

Note
This function increases the reference count on the returned RTP instance.
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.

Definition at line 747 of file rtp_engine.h.

◆ get_ufrag

const char*(* get_ufrag) (struct ast_rtp_instance *instance)

◆ get_vrtp_info

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.

Note
This function increases the reference count on the returned RTP instance.
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.

Definition at line 735 of file rtp_engine.h.

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

◆ hash

enum ast_rtp_dtls_hash hash

Hash to use for fingerprint

Definition at line 556 of file rtp_engine.h.

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

◆ highest_seq_no

unsigned int highest_seq_no

◆ ia_jitter

unsigned int ia_jitter

◆ ice

struct ast_rtp_engine_ice* ice

◆ ice_lite

void(* ice_lite) (struct ast_rtp_instance *instance)

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

Definition at line 501 of file rtp_engine.h.

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

◆ id

◆ local_bridge

int(* local_bridge) (struct ast_rtp_instance *instance0, struct ast_rtp_instance *instance1)

Callback to locally bridge two RTP instances

Definition at line 663 of file rtp_engine.h.

Referenced by native_rtp_bridge_compatible_check(), native_rtp_bridge_start(), and native_rtp_bridge_stop().

◆ local_maxjitter

double local_maxjitter

Maximum jitter on local side

Definition at line 384 of file rtp_engine.h.

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

◆ local_maxrxploss

double local_maxrxploss

Maximum number of packets lost on local side

Definition at line 404 of file rtp_engine.h.

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

◆ local_minjitter

double local_minjitter

Minimum jitter on local side

Definition at line 386 of file rtp_engine.h.

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

◆ local_minrxploss

double local_minrxploss

Minimum number of packets lost on local side

Definition at line 406 of file rtp_engine.h.

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

◆ local_normdevjitter

double local_normdevjitter

Average jitter on local side

Definition at line 388 of file rtp_engine.h.

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

◆ local_normdevrxploss

double local_normdevrxploss

Average number of packets lost on local side

Definition at line 408 of file rtp_engine.h.

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

◆ local_ssrc

unsigned int local_ssrc

◆ local_stdevjitter

double local_stdevjitter

Standard deviation jitter on local side

Definition at line 390 of file rtp_engine.h.

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

◆ local_stdevrxploss

double local_stdevrxploss

Standard deviation packets lost on local side

Definition at line 410 of file rtp_engine.h.

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

◆ 

struct { ... } lost_count

◆ lsr

unsigned int lsr

◆ make_compatible

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

Callback to make two instances compatible

Definition at line 669 of file rtp_engine.h.

Referenced by ast_rtp_instance_make_compatible().

◆ maxrtt

double maxrtt

◆ minrtt

double minrtt

◆ mod [1/2]

struct ast_module* mod

Module this RTP engine came from, used for reference counting

Definition at line 618 of file rtp_engine.h.

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

◆ mod [2/2]

struct ast_module* mod

Module that the RTP glue came from

Definition at line 724 of file rtp_engine.h.

Referenced by ast_rtp_glue_register2().

◆ mwi_state

struct ast_mwi_state* mwi_state

MWI state

Definition at line 474 of file mwi.h.

Referenced by ast_mwi_blob_create(), mwi_app_event_cb(), and mwi_blob_dtor().

◆ name

const char* name

Name of the RTP engine, used when explicitly requested

Definition at line 616 of file rtp_engine.h.

Referenced by ast_rtp_engine_register2(), ast_rtp_engine_unregister(), ast_rtp_instance_new(), PathSegment::get_child(), Parameter::load(), Property::load(), and SwaggerType::load().

◆ new

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

Callback for setting up a new RTP instance

Definition at line 620 of file rtp_engine.h.

Referenced by ast_rtp_engine_register2(), and ast_rtp_instance_new().

◆ new_msgs

int new_msgs

◆ normdevrtt

double normdevrtt

◆ ntp_timestamp [1/2]

struct timeval ntp_timestamp

◆ ntp_timestamp [2/2]

struct timeval ntp_timestamp

Definition at line 344 of file rtp_engine.h.

◆ octet_count [1/2]

unsigned int octet_count

◆ octet_count [2/2]

unsigned int octet_count

Definition at line 339 of file rtp_engine.h.

◆ old_msgs

int old_msgs

◆ on_subscribe

void(* on_subscribe) (const char *mailbox, struct ast_mwi_subscriber *sub)

Raised when MWI is being subscribed.

Parameters
mailboxThe mailbox id subscribed
subThe subscriber subscribed

Definition at line 259 of file mwi.h.

◆ on_unsubscribe

void(* on_unsubscribe) (const char *mailbox, struct ast_mwi_subscriber *sub)

Raised when MWI is being unsubscribed.

Parameters
mailboxThe mailbox id being unsubscribed
subThe subscriber to unsubscribe

Definition at line 267 of file mwi.h.

◆ packet_count [1/2]

unsigned int packet_count

◆ packet_count [2/2]

unsigned int packet_count

Definition at line 338 of file rtp_engine.h.

◆ packets [1/2]

unsigned int packets

◆ packets [2/2]

unsigned int packets

Definition at line 320 of file rtp_engine.h.

◆ payload

int payload

◆ payload_set

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

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

Definition at line 643 of file rtp_engine.h.

Referenced by ast_rtp_codecs_get_stream_type(), ast_rtp_codecs_payloads_clear(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_codecs_payloads_xover(), rtp_codecs_payloads_copy_rx(), and rtp_codecs_payloads_copy_tx().

◆ primary_mapping

unsigned int primary_mapping

TRUE if this is the primary mapping to the format.

Definition at line 286 of file rtp_engine.h.

Referenced by payload_mapping_rx_clear_primary(), and rtp_payload_type_alloc().

◆ priority

int priority

Priority which is used if multiple candidates can be used

Definition at line 478 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().

◆ prop_set

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

Callback for setting an RTP property

Definition at line 641 of file rtp_engine.h.

Referenced by ast_rtp_instance_set_prop().

◆ pvtfile

char* pvtfile

◆ qos

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

Callback for setting QoS values

Definition at line 653 of file rtp_engine.h.

Referenced by ast_rtp_instance_set_qos().

◆ read

struct ast_frame*(* read) (struct ast_rtp_instance *instance, int rtcp)

Callback for reading a frame from the RTP engine

Definition at line 659 of file rtp_engine.h.

Referenced by ast_rtp_engine_register2(), and ast_rtp_instance_read().

◆ reception_report_count

unsigned short reception_report_count

◆ red_buffer

int(* red_buffer) (struct ast_rtp_instance *instance, struct ast_frame *frame)

Callback for buffering a frame using RED

Definition at line 659 of file rtp_engine.h.

Referenced by ast_rtp_red_buffer().

◆ red_init

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

Callback for initializing RED support

Definition at line 657 of file rtp_engine.h.

Referenced by ast_rtp_red_init().

◆ rekey

unsigned int rekey

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

Definition at line 556 of file rtp_engine.h.

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

◆ relay_address

struct ast_sockaddr relay_address

Relay address for the candidate

Definition at line 478 of file rtp_engine.h.

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

◆ remb [1/2]

◆ remb [2/2]

REMB feedback information

Definition at line 359 of file rtp_engine.h.

◆ remote_address_set

void(* remote_address_set) (struct ast_rtp_instance *instance, struct ast_sockaddr *sa)

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

Definition at line 645 of file rtp_engine.h.

Referenced by rtp_instance_set_incoming_source_address_nolock().

◆ remote_maxjitter

double remote_maxjitter

Maximum jitter on remote side

Definition at line 376 of file rtp_engine.h.

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

◆ remote_maxrxploss

double remote_maxrxploss

Maximum number of packets lost on remote side

Definition at line 396 of file rtp_engine.h.

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

◆ remote_minjitter

double remote_minjitter

Minimum jitter on remote side

Definition at line 378 of file rtp_engine.h.

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

◆ remote_minrxploss

double remote_minrxploss

Minimum number of packets lost on remote side

Definition at line 398 of file rtp_engine.h.

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

◆ remote_normdevjitter

double remote_normdevjitter

Average jitter on remote side

Definition at line 380 of file rtp_engine.h.

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

◆ remote_normdevrxploss

double remote_normdevrxploss

Average number of packets lost on remote side

Definition at line 400 of file rtp_engine.h.

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

◆ remote_ssrc

unsigned int remote_ssrc

◆ remote_stdevjitter

double remote_stdevjitter

Standard deviation jitter on remote side

Definition at line 382 of file rtp_engine.h.

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

◆ remote_stdevrxploss

double remote_stdevrxploss

Standard deviation packets lost on remote side

Definition at line 402 of file rtp_engine.h.

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

◆ report_block

struct ast_rtp_rtcp_report_block* report_block[0]

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

Definition at line 344 of file rtp_engine.h.

Referenced by ast_rtcp_calculate_sr_rr_statistics(), ast_rtcp_generate_report(), ast_rtcp_interpret(), lintospeex_feedback(), rtcp_report_to_ami(), rtcp_report_to_json(), and rtp_rtcp_report_dtor().

◆ reset

void(* reset) (struct ast_rtp_instance *instance)

Reset the connection and start fresh

Definition at line 578 of file rtp_engine.h.

Referenced by apply_dtls_attrib(), process_sdp_a_dtls(), and rtp_dtls_wrap_get_connection().

◆ rtp_code

int rtp_code

◆ rtp_timestamp [1/2]

unsigned int rtp_timestamp

Definition at line 337 of file rtp_engine.h.

◆ rtp_timestamp [2/2]

unsigned int rtp_timestamp

◆ rtt

double rtt

◆ rxcount

unsigned int rxcount

◆ rxjitter

double rxjitter

◆ rxoctetcount

unsigned int rxoctetcount

Number of octets received

Definition at line 430 of file rtp_engine.h.

Referenced by ast_rtp_convert_stats_json(), and ast_rtp_get_stat().

◆ rxploss

unsigned int rxploss

◆ sendcng

int(* sendcng) (struct ast_rtp_instance *instance, int level)

Callback to send CNG

Definition at line 679 of file rtp_engine.h.

Referenced by ast_rtp_instance_sendcng().

◆ 

struct { ... } sender_information

◆ set_authentication

void(* set_authentication) (struct ast_rtp_instance *instance, const char *ufrag, const char *password)

Callback for setting received authentication information

Definition at line 487 of file rtp_engine.h.

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

◆ set_configuration

int(* set_configuration) (struct ast_rtp_instance *instance, const struct ast_rtp_dtls_cfg *dtls_cfg)

Set the configuration of the DTLS support on the instance

Definition at line 572 of file rtp_engine.h.

Referenced by dialog_initialize_dtls_srtp(), rtp_dtls_wrap_set_configuration(), and setup_dtls_srtp().

◆ set_fingerprint

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

Set the remote fingerprint

Definition at line 586 of file rtp_engine.h.

Referenced by apply_dtls_attrib(), process_sdp_a_dtls(), and rtp_dtls_wrap_get_fingerprint_hash().

◆ set_read_format

int(* set_read_format) (struct ast_rtp_instance *instance, struct ast_format *format)

Callback to set the read format

Definition at line 665 of file rtp_engine.h.

Referenced by ast_rtp_instance_set_read_format(), and ast_rtp_instance_set_write_format().

◆ set_remote_ssrc

void(* set_remote_ssrc) (struct ast_rtp_instance *instance, unsigned int ssrc)

Callback to set remote SSRC information

Definition at line 687 of file rtp_engine.h.

Referenced by ast_rtp_instance_set_remote_ssrc().

◆ set_role

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

Callback for changing our role in negotiation

Definition at line 503 of file rtp_engine.h.

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

◆ set_setup

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

Set the remote setup state

Definition at line 584 of file rtp_engine.h.

Referenced by apply_dtls_attrib(), process_sdp_a_dtls(), and rtp_dtls_wrap_set_setup().

◆ set_stream_num

void(* set_stream_num) (struct ast_rtp_instance *instance, int stream_num)

Callback to set the stream identifier

Definition at line 689 of file rtp_engine.h.

Referenced by ast_rtp_instance_set_stream_num().

◆ set_write_format

int(* set_write_format) (struct ast_rtp_instance *instance, struct ast_format *format)

Callback to set the write format

Definition at line 667 of file rtp_engine.h.

Referenced by ast_rtp_instance_set_write_format().

◆ snapshot

struct ast_channel_snapshot* snapshot

If applicable, a snapshot of the channel that caused this MWI change

Definition at line 464 of file mwi.h.

Referenced by mwi_app_event_cb(), mwi_state_create_message(), mwi_state_dtor(), and mwi_update_cb().

◆ source_ssrc

unsigned int source_ssrc

◆ ssrc

unsigned int ssrc

◆ ssrc_get

unsigned int(* ssrc_get) (struct ast_rtp_instance *instance)

Callback to retrieve local SSRC

Definition at line 681 of file rtp_engine.h.

Referenced by ast_rtp_instance_get_ssrc().

◆ start

void(* start) (struct ast_rtp_instance *instance)

Callback for starting ICE negotiation

Definition at line 491 of file rtp_engine.h.

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

◆ stdevrtt

double stdevrtt

Standard deviation round trip time

Definition at line 420 of file rtp_engine.h.

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

◆ stop [1/3]

void(* stop) (struct ast_rtp_instance *instance)

◆ stop [2/3]

void(* stop) (struct ast_rtp_instance *instance)

Stop and terminate DTLS SRTP support

Definition at line 576 of file rtp_engine.h.

Referenced by process_crypto(), and rtp_dtls_wrap_stop().

◆ stop [3/3]

void(* stop) (struct ast_rtp_instance *instance)

Callback for stopping the RTP instance

Definition at line 626 of file rtp_engine.h.

Referenced by ast_rtp_instance_stop().

◆ stun_request

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

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

Definition at line 675 of file rtp_engine.h.

Referenced by ast_rtp_instance_stun_request().

◆ suite

enum ast_srtp_suite suite

Crypto suite in use

Definition at line 556 of file rtp_engine.h.

Referenced by ast_rtp_dtls_cfg_copy(), and build_peer().

◆ transport

char* transport

◆ turn_request

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)

Callback for requesting a TURN session

Definition at line 505 of file rtp_engine.h.

Referenced by rtp_ice_wrap_turn_request().

◆ txcount

unsigned int txcount

◆ txjitter

double txjitter

◆ txoctetcount

unsigned int txoctetcount

Number of octets transmitted

Definition at line 428 of file rtp_engine.h.

Referenced by ast_rtp_convert_stats_json(), and ast_rtp_get_stat().

◆ txploss

unsigned int txploss

◆ type [1/3]

unsigned int type

◆ type [2/3]

◆ type [3/3]

const char* type

Name of the channel driver that this glue is responsible for

Definition at line 722 of file rtp_engine.h.

Referenced by ast_rtp_glue_register2(), ast_rtp_glue_unregister(), ast_rtp_instance_get_glue(), ast_rtp_instance_make_compatible(), and Property::load().

◆ uniqueid

const ast_string_field uniqueid

◆ update_peer

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)

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

Definition at line 756 of file rtp_engine.h.

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

◆ update_source

void(* update_source) (struct ast_rtp_instance *instance)

Callback to indicate that we should update the marker bit

Definition at line 633 of file rtp_engine.h.

Referenced by ast_rtp_instance_update_source().

◆ urgent_msgs

int urgent_msgs

The current number of urgent messages for this mailbox

Definition at line 466 of file mwi.h.

Referenced by mwi_create_state(), mwi_retrieve_then_create_state(), poll_subscribed_mailbox(), and validate_data().

◆ verify

enum ast_rtp_dtls_verify verify

What should be verified

Definition at line 556 of file rtp_engine.h.

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

◆ when_retired

struct timeval when_retired

When the payload type became non-primary.

Definition at line 286 of file rtp_engine.h.

◆ write

int(* write) (struct ast_rtp_instance *instance, struct ast_frame *frame)

Callback for writing out a frame

Definition at line 624 of file rtp_engine.h.

Referenced by ast_rtp_engine_register2(), ast_rtp_instance_write(), and MultiOrderedConfigParser::write().