Asterisk - The Open Source Telephony Project
18.5.0
|
Pluggable RTP Architecture. More...
#include "asterisk.h"
#include <math.h>
#include <sched.h>
#include <sys/time.h>
#include <time.h>
#include "asterisk/_private.h"
#include "asterisk/astobj2.h"
#include "asterisk/channel.h"
#include "asterisk/codec.h"
#include "asterisk/format.h"
#include "asterisk/format_cache.h"
#include "asterisk/format_cap.h"
#include "asterisk/json.h"
#include "asterisk/linkedlists.h"
#include "asterisk/lock.h"
#include "asterisk/logger.h"
#include "asterisk/manager.h"
#include "asterisk/module.h"
#include "asterisk/netsock2.h"
#include "asterisk/options.h"
#include "asterisk/pbx.h"
#include "asterisk/res_srtp.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/stasis.h"
#include "asterisk/stasis_channels.h"
#include "asterisk/strings.h"
#include "asterisk/translate.h"
#include "asterisk/utils.h"
#include "asterisk/vector.h"
Go to the source code of this file.
Data Structures | |
struct | ast_rtp_instance |
struct | ast_rtp_mime_type |
struct | engines |
struct | glues |
struct | rtcp_message_payload |
struct | rtp_extmap |
Macros | |
#define | MAX_RTP_MIME_TYPES 128 |
#define | SET_AST_JSON_OBJ(target, name, obj) |
Set given json object into target with name. More... | |
Functions | |
static void | add_static_payload (int payload, struct ast_format *format, int rtp_code) |
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) |
int | ast_rtp_codecs_find_payload_code (struct ast_rtp_codecs *codecs, int payload) |
Search for the tx payload type in the ast_rtp_codecs structure. More... | |
unsigned int | ast_rtp_codecs_get_framing (struct ast_rtp_codecs *codecs) |
Get the framing used for a set of codecs. More... | |
struct ast_rtp_payload_type * | ast_rtp_codecs_get_payload (struct ast_rtp_codecs *codecs, int payload) |
Retrieve rx payload mapped information by payload type. More... | |
struct ast_format * | ast_rtp_codecs_get_payload_format (struct ast_rtp_codecs *codecs, int payload) |
Retrieve the actual ast_format stored on the codecs structure for a specific tx payload type. More... | |
enum ast_media_type | ast_rtp_codecs_get_stream_type (struct ast_rtp_codecs *codecs) |
Determine the type of RTP stream media from the codecs mapped. More... | |
int | ast_rtp_codecs_payload_code (struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code) |
Retrieve a rx mapped payload type based on whether it is an Asterisk format and the code. More... | |
int | ast_rtp_codecs_payload_code_tx (struct ast_rtp_codecs *codecs, int asterisk_format, const struct ast_format *format, int code) |
Retrieve a tx mapped payload type based on whether it is an Asterisk format and the code. More... | |
void | ast_rtp_codecs_payload_formats (struct ast_rtp_codecs *codecs, struct ast_format_cap *astformats, int *nonastformats) |
Retrieve all formats that were found. More... | |
int | ast_rtp_codecs_payload_replace_format (struct ast_rtp_codecs *codecs, int payload, struct ast_format *format) |
Update the format associated with a tx payload type in a codecs structure. More... | |
int | ast_rtp_codecs_payload_set_rx (struct ast_rtp_codecs *codecs, int code, struct ast_format *format) |
Set a payload code for use with a specific Asterisk format. More... | |
void | ast_rtp_codecs_payloads_clear (struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance) |
Clear rx and tx payload mapping information from an RTP instance. More... | |
void | ast_rtp_codecs_payloads_copy (struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance) |
Copy payload information from one RTP instance to another. More... | |
void | ast_rtp_codecs_payloads_destroy (struct ast_rtp_codecs *codecs) |
Destroy the contents of an RTP codecs structure (but not the structure itself) More... | |
int | ast_rtp_codecs_payloads_initialize (struct ast_rtp_codecs *codecs) |
Initialize an RTP codecs structure. More... | |
void | ast_rtp_codecs_payloads_set_m_type (struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload) |
Record tx payload type information that was seen in an m= SDP line. More... | |
int | ast_rtp_codecs_payloads_set_rtpmap_type (struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload, char *mimetype, char *mimesubtype, enum ast_rtp_options options) |
Record tx payload type information that was seen in an a=rtpmap: SDP line. More... | |
int | ast_rtp_codecs_payloads_set_rtpmap_type_rate (struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int pt, char *mimetype, char *mimesubtype, enum ast_rtp_options options, unsigned int sample_rate) |
Set tx payload type to a known MIME media type for a codec with a specific sample rate. More... | |
void | ast_rtp_codecs_payloads_unset (struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload) |
Remove tx payload type mapped information. More... | |
void | ast_rtp_codecs_payloads_xover (struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance) |
Crossover copy the tx payload mapping of src to the rx payload mapping of dest. More... | |
void | ast_rtp_codecs_set_framing (struct ast_rtp_codecs *codecs, unsigned int framing) |
Set the framing used for a set of codecs. More... | |
struct ast_json * | ast_rtp_convert_stats_json (const struct ast_rtp_instance_stats *stats) |
Convert given stat instance into json format. More... | |
void | ast_rtp_dtls_cfg_copy (const struct ast_rtp_dtls_cfg *src_cfg, struct ast_rtp_dtls_cfg *dst_cfg) |
Copy contents of a DTLS configuration structure. More... | |
void | ast_rtp_dtls_cfg_free (struct ast_rtp_dtls_cfg *dtls_cfg) |
Free contents of a DTLS configuration structure. More... | |
int | ast_rtp_dtls_cfg_parse (struct ast_rtp_dtls_cfg *dtls_cfg, const char *name, const char *value) |
Parse DTLS related configuration options. More... | |
int | ast_rtp_dtls_cfg_validate (struct ast_rtp_dtls_cfg *dtls_cfg) |
Validates DTLS related configuration options. More... | |
struct ast_rtp_payload_type * | ast_rtp_engine_alloc_payload_type (void) |
Allocation routine for ast_rtp_payload_type. More... | |
int | ast_rtp_engine_init (void) |
initializes the rtp engine arrays More... | |
int | ast_rtp_engine_load_format (struct ast_format *format) |
Custom formats declared in codecs.conf at startup must be communicated to the rtp_engine so their mime type can payload number can be initialized. More... | |
int | ast_rtp_engine_register2 (struct ast_rtp_engine *engine, struct ast_module *module) |
Register an RTP engine. More... | |
int | ast_rtp_engine_register_srtp (struct ast_srtp_res *srtp_res, struct ast_srtp_policy_res *policy_res) |
int | ast_rtp_engine_srtp_is_registered (void) |
int | ast_rtp_engine_unload_format (struct ast_format *format) |
Formats requiring the use of a format attribute interface must have that interface registered in order for the rtp engine to handle it correctly. If an attribute interface is unloaded, this function must be called to notify the rtp_engine. More... | |
int | ast_rtp_engine_unregister (struct ast_rtp_engine *engine) |
Unregister an RTP engine. More... | |
void | ast_rtp_engine_unregister_srtp (void) |
int | ast_rtp_get_rate (const struct ast_format *format) |
Retrieve the sample rate of a format according to RTP specifications. More... | |
int | ast_rtp_glue_register2 (struct ast_rtp_glue *glue, struct ast_module *module) |
Register RTP glue. More... | |
int | ast_rtp_glue_unregister (struct ast_rtp_glue *glue) |
Unregister RTP glue. More... | |
int | ast_rtp_instance_activate (struct ast_rtp_instance *instance) |
Indicate to the RTP engine that packets are now expected to be sent/received on the RTP instance. More... | |
int | ast_rtp_instance_add_srtp_policy (struct ast_rtp_instance *instance, struct ast_srtp_policy *remote_policy, struct ast_srtp_policy *local_policy, int rtcp) |
Add or replace the SRTP policies for the given RTP instance. More... | |
void | ast_rtp_instance_available_formats (struct ast_rtp_instance *instance, struct ast_format_cap *to_endpoint, struct ast_format_cap *to_asterisk, struct ast_format_cap *result) |
Request the formats that can be transcoded. More... | |
int | ast_rtp_instance_bundle (struct ast_rtp_instance *child, struct ast_rtp_instance *parent) |
Request that an RTP instance be bundled with another. More... | |
void | ast_rtp_instance_change_source (struct ast_rtp_instance *instance) |
Indicate a new source of audio has dropped in and the ssrc should change. More... | |
int | ast_rtp_instance_destroy (struct ast_rtp_instance *instance) |
Destroy an RTP instance. More... | |
void | ast_rtp_instance_drop_packets (struct ast_rtp_instance *instance, int num) |
Set the number of packets to drop on RTP read. More... | |
int | ast_rtp_instance_dtmf_begin (struct ast_rtp_instance *instance, char digit) |
Begin sending a DTMF digit. More... | |
int | ast_rtp_instance_dtmf_end (struct ast_rtp_instance *instance, char digit) |
Stop sending a DTMF digit. More... | |
int | ast_rtp_instance_dtmf_end_with_duration (struct ast_rtp_instance *instance, char digit, unsigned int duration) |
enum ast_rtp_dtmf_mode | ast_rtp_instance_dtmf_mode_get (struct ast_rtp_instance *instance) |
Get the DTMF mode of an RTP instance. More... | |
int | ast_rtp_instance_dtmf_mode_set (struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode) |
Set the DTMF mode that should be used. More... | |
int | ast_rtp_instance_early_bridge (struct ast_channel *c0, struct ast_channel *c1) |
Early bridge two channels that use RTP instances. More... | |
void | ast_rtp_instance_early_bridge_make_compatible (struct ast_channel *c_dst, struct ast_channel *c_src) |
Make two channels compatible for early bridging. More... | |
void | ast_rtp_instance_extmap_clear (struct ast_rtp_instance *instance) |
Clear negotiated RTP extension information. More... | |
size_t | ast_rtp_instance_extmap_count (struct ast_rtp_instance *instance) |
Get the number of known unique identifiers. More... | |
int | ast_rtp_instance_extmap_enable (struct ast_rtp_instance *instance, int id, enum ast_rtp_extension extension, enum ast_rtp_extension_direction direction) |
Enable support for an RTP extension on an instance. More... | |
enum ast_rtp_extension_direction | ast_rtp_instance_extmap_get_direction (struct ast_rtp_instance *instance, int id) |
Retrieve the negotiated direction for an RTP extension id. More... | |
enum ast_rtp_extension | ast_rtp_instance_extmap_get_extension (struct ast_rtp_instance *instance, int id) |
Retrieve the extension for an RTP extension id. More... | |
int | ast_rtp_instance_extmap_get_id (struct ast_rtp_instance *instance, enum ast_rtp_extension extension) |
Retrieve the id for an RTP extension. More... | |
const char * | ast_rtp_instance_extmap_get_uri (struct ast_rtp_instance *instance, int id) |
Retrieve the URI for an RTP extension id. More... | |
int | ast_rtp_instance_extmap_negotiate (struct ast_rtp_instance *instance, int id, enum ast_rtp_extension_direction direction, const char *uri, const char *attributes) |
Negotiate received RTP extension information. More... | |
int | ast_rtp_instance_fd (struct ast_rtp_instance *instance, int rtcp) |
Get the file descriptor for an RTP session (or RTCP) More... | |
struct ast_rtp_glue * | ast_rtp_instance_get_active_glue (struct ast_rtp_instance *instance) |
Get the RTP glue in use on an RTP instance. More... | |
int | ast_rtp_instance_get_and_cmp_local_address (struct ast_rtp_instance *instance, struct ast_sockaddr *address) |
Get the address of the local endpoint that we are sending RTP to, comparing its address to another. More... | |
int | ast_rtp_instance_get_and_cmp_requested_target_address (struct ast_rtp_instance *instance, struct ast_sockaddr *address) |
Get the requested target address of the remote endpoint and compare it to the given address. More... | |
struct ast_rtp_instance * | ast_rtp_instance_get_bridged (struct ast_rtp_instance *instance) |
Get the other RTP instance that an instance is bridged to. More... | |
const char * | ast_rtp_instance_get_channel_id (struct ast_rtp_instance *instance) |
Get the unique ID of the channel that owns this RTP instance. More... | |
const char * | ast_rtp_instance_get_cname (struct ast_rtp_instance *rtp) |
Retrieve the CNAME used in RTCP SDES items. More... | |
struct ast_rtp_codecs * | ast_rtp_instance_get_codecs (struct ast_rtp_instance *instance) |
Get the codecs structure of an RTP instance. More... | |
void * | ast_rtp_instance_get_data (struct ast_rtp_instance *instance) |
Get the data portion of an RTP instance. More... | |
struct ast_rtp_engine_dtls * | ast_rtp_instance_get_dtls (struct ast_rtp_instance *instance) |
Obtain a pointer to the DTLS support present on an RTP instance. More... | |
struct ast_rtp_engine * | ast_rtp_instance_get_engine (struct ast_rtp_instance *instance) |
Get the RTP engine in use on an RTP instance. More... | |
void * | ast_rtp_instance_get_extended_prop (struct ast_rtp_instance *instance, int property) |
Get the value of an RTP instance extended property. More... | |
struct ast_rtp_glue * | ast_rtp_instance_get_glue (const char *type) |
Get the RTP glue that binds a channel to the RTP engine. More... | |
int | ast_rtp_instance_get_hold_timeout (struct ast_rtp_instance *instance) |
Get the RTP timeout value for when an RTP instance is on hold. More... | |
struct ast_rtp_engine_ice * | ast_rtp_instance_get_ice (struct ast_rtp_instance *instance) |
Obtain a pointer to the ICE support present on an RTP instance. More... | |
void | ast_rtp_instance_get_incoming_source_address (struct ast_rtp_instance *instance, struct ast_sockaddr *address) |
Get the incoming source address of the remote endpoint. More... | |
int | ast_rtp_instance_get_keepalive (struct ast_rtp_instance *instance) |
Get the RTP keepalive interval. More... | |
time_t | ast_rtp_instance_get_last_rx (const struct ast_rtp_instance *rtp) |
time_t | ast_rtp_instance_get_last_tx (const struct ast_rtp_instance *rtp) |
Get the last RTP transmission time. More... | |
void | ast_rtp_instance_get_local_address (struct ast_rtp_instance *instance, struct ast_sockaddr *address) |
Get the local address that we are expecting RTP on. More... | |
int | ast_rtp_instance_get_prop (struct ast_rtp_instance *instance, enum ast_rtp_property property) |
Get the value of an RTP instance property. More... | |
char * | ast_rtp_instance_get_quality (struct ast_rtp_instance *instance, enum ast_rtp_instance_stat_field field, char *buf, size_t size) |
Retrieve quality statistics about an RTP instance. More... | |
size_t | ast_rtp_instance_get_recv_buffer_count (struct ast_rtp_instance *instance) |
Get the current size of the receive buffer. More... | |
size_t | ast_rtp_instance_get_recv_buffer_max (struct ast_rtp_instance *instance) |
Get the maximum size of the receive buffer. More... | |
void | ast_rtp_instance_get_requested_target_address (struct ast_rtp_instance *instance, struct ast_sockaddr *address) |
Get the requested target address of the remote endpoint. More... | |
int | ast_rtp_instance_get_sdes_received (struct ast_rtp_instance *instance) |
Get the value of sdes_received on the test engine. More... | |
size_t | ast_rtp_instance_get_send_buffer_count (struct ast_rtp_instance *instance) |
Get the current size of the send buffer. More... | |
struct ast_srtp * | ast_rtp_instance_get_srtp (struct ast_rtp_instance *instance, int rtcp) |
Obtain the SRTP instance associated with an RTP instance. More... | |
unsigned int | ast_rtp_instance_get_ssrc (struct ast_rtp_instance *rtp) |
Retrieve the local SSRC value that we will be using. More... | |
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. More... | |
struct ast_json * | ast_rtp_instance_get_stats_all_json (struct ast_rtp_instance *instance) |
Retrieve statistics about an RTP instance in json format. More... | |
struct ast_rtp_engine_test * | ast_rtp_instance_get_test (struct ast_rtp_instance *instance) |
Obtain a pointer to the test callbacks on an RTP instance. More... | |
int | ast_rtp_instance_get_timeout (struct ast_rtp_instance *instance) |
Get the RTP timeout value. More... | |
int | ast_rtp_instance_make_compatible (struct ast_channel *chan, struct ast_rtp_instance *instance, struct ast_channel *peer) |
Request that the underlying RTP engine make two RTP instances compatible with eachother. More... | |
struct ast_rtp_instance * | ast_rtp_instance_new (const char *engine_name, struct ast_sched_context *sched, const struct ast_sockaddr *sa, void *data) |
Create a new RTP instance. More... | |
void | ast_rtp_instance_queue_report (struct ast_rtp_instance *instance) |
Sends a SR/RR report the next time RTP would be sent. More... | |
struct ast_frame * | ast_rtp_instance_read (struct ast_rtp_instance *instance, int rtcp) |
Receive a frame over RTP. More... | |
void | ast_rtp_instance_reset_test_engine (struct ast_rtp_instance *instance) |
Resets all the fields to default values for the test engine. More... | |
int | ast_rtp_instance_sendcng (struct ast_rtp_instance *instance, int level) |
Send a comfort noise packet to the RTP instance. More... | |
void | ast_rtp_instance_set_bridged (struct ast_rtp_instance *instance, struct ast_rtp_instance *bridged) |
Set the other RTP instance that an instance is bridged to. More... | |
void | ast_rtp_instance_set_channel_id (struct ast_rtp_instance *instance, const char *uniqueid) |
Set the channel that owns this RTP instance. More... | |
void | ast_rtp_instance_set_data (struct ast_rtp_instance *instance, void *data) |
Set the data portion of an RTP instance. More... | |
void | ast_rtp_instance_set_extended_prop (struct ast_rtp_instance *instance, int property, void *value) |
Set the value of an RTP instance extended property. More... | |
void | ast_rtp_instance_set_hold_timeout (struct ast_rtp_instance *instance, int timeout) |
Set the RTP timeout value for when the instance is on hold. More... | |
int | ast_rtp_instance_set_incoming_source_address (struct ast_rtp_instance *instance, const struct ast_sockaddr *address) |
Set the incoming source address of the remote endpoint that we are sending RTP to. More... | |
void | ast_rtp_instance_set_keepalive (struct ast_rtp_instance *instance, int interval) |
Set the RTP keepalive interval. More... | |
void | ast_rtp_instance_set_last_rx (struct ast_rtp_instance *rtp, time_t time) |
Set the last RTP reception time. More... | |
void | ast_rtp_instance_set_last_tx (struct ast_rtp_instance *rtp, time_t time) |
Set the last RTP transmission time. More... | |
int | ast_rtp_instance_set_local_address (struct ast_rtp_instance *instance, const struct ast_sockaddr *address) |
Set the address that we are expecting to receive RTP on. More... | |
void | ast_rtp_instance_set_prop (struct ast_rtp_instance *instance, enum ast_rtp_property property, int value) |
Set the value of an RTP instance property. More... | |
int | ast_rtp_instance_set_qos (struct ast_rtp_instance *instance, int tos, int cos, const char *desc) |
Set QoS parameters on an RTP session. More... | |
int | ast_rtp_instance_set_read_format (struct ast_rtp_instance *instance, struct ast_format *format) |
Request that the underlying RTP engine provide audio frames in a specific format. More... | |
void | ast_rtp_instance_set_remote_ssrc (struct ast_rtp_instance *rtp, unsigned int ssrc) |
Set the remote SSRC for an RTP instance. More... | |
int | ast_rtp_instance_set_requested_target_address (struct ast_rtp_instance *instance, const struct ast_sockaddr *address) |
Set the requested target address of the remote endpoint. More... | |
void | ast_rtp_instance_set_schedid (struct ast_rtp_instance *instance, int id) |
Set the schedid for RTCP. More... | |
void | ast_rtp_instance_set_stats_vars (struct ast_channel *chan, struct ast_rtp_instance *instance) |
Set standard statistics from an RTP instance on a channel. More... | |
void | ast_rtp_instance_set_stream_num (struct ast_rtp_instance *rtp, int stream_num) |
Set the stream number for an RTP instance. More... | |
void | ast_rtp_instance_set_timeout (struct ast_rtp_instance *instance, int timeout) |
Set the RTP timeout value. More... | |
int | ast_rtp_instance_set_write_format (struct ast_rtp_instance *instance, struct ast_format *format) |
Tell underlying RTP engine that audio frames will be provided in a specific format. More... | |
void | ast_rtp_instance_stop (struct ast_rtp_instance *instance) |
Stop an RTP instance. More... | |
void | ast_rtp_instance_stun_request (struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username) |
Request that the underlying RTP engine send a STUN BIND request. More... | |
void | ast_rtp_instance_update_source (struct ast_rtp_instance *instance) |
Indicate that the RTP marker bit should be set on an RTP stream. More... | |
int | ast_rtp_instance_write (struct ast_rtp_instance *instance, struct ast_frame *frame) |
Send a frame out over RTP. More... | |
char * | ast_rtp_lookup_mime_multiple2 (struct ast_str *buf, struct ast_format_cap *ast_format_capability, int rtp_capability, const int asterisk_format, enum ast_rtp_options options) |
Convert formats into a string and put them into a buffer. More... | |
const char * | ast_rtp_lookup_mime_subtype2 (const int asterisk_format, const struct ast_format *format, int code, enum ast_rtp_options options) |
Retrieve mime subtype information on a payload. More... | |
unsigned int | ast_rtp_lookup_sample_rate2 (int asterisk_format, const struct ast_format *format, int code) |
Get the sample rate associated with known RTP payload types. More... | |
void | ast_rtp_publish_rtcp_message (struct ast_rtp_instance *rtp, struct stasis_message_type *message_type, struct ast_rtp_rtcp_report *report, struct ast_json *blob) |
Publish an RTCP message to Stasis Message Bus API. More... | |
int | ast_rtp_red_buffer (struct ast_rtp_instance *instance, struct ast_frame *frame) |
Buffer a frame in an RTP instance for RED. More... | |
int | ast_rtp_red_init (struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations) |
Initialize RED support on an RTP instance. More... | |
struct ast_rtp_rtcp_report * | ast_rtp_rtcp_report_alloc (unsigned int report_blocks) |
Allocate an ao2 ref counted instance of ast_rtp_rtcp_report. More... | |
struct stasis_topic * | ast_rtp_topic (void) |
Stasis Message Bus API topic for RTP and RTCP related messages More... | |
static int | find_static_payload_type (int asterisk_format, const struct ast_format *format, int code) |
static int | find_unused_payload (const struct ast_rtp_codecs *codecs) |
static int | find_unused_payload_in_range (const struct ast_rtp_codecs *codecs, int start, int end, struct ast_rtp_payload_type *ignore[]) |
static void | instance_destructor (void *obj) |
static void | payload_mapping_rx_clear_primary (struct ast_rtp_codecs *codecs, struct ast_rtp_payload_type *to_match) |
static int | payload_mapping_tx_is_present (const struct ast_rtp_codecs *codecs, const struct ast_rtp_payload_type *to_match) |
static void | rtcp_message_payload_dtor (void *obj) |
static struct ast_manager_event_blob * | rtcp_report_to_ami (struct stasis_message *msg) |
static struct ast_json * | rtcp_report_to_json (struct stasis_message *msg, const struct stasis_message_sanitizer *sanitize) |
static int | rtp_codecs_assign_payload_code_rx (struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code, int explicit) |
static int | rtp_codecs_find_non_primary_dynamic_rx (struct ast_rtp_codecs *codecs) |
static void | rtp_codecs_payload_replace_rx (struct ast_rtp_codecs *codecs, int payload, struct ast_rtp_payload_type *new_type) |
static void | rtp_codecs_payloads_copy_rx (struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance) |
static void | rtp_codecs_payloads_copy_tx (struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance) |
static int | rtp_dtls_wrap_active (struct ast_rtp_instance *instance) |
static enum ast_rtp_dtls_connection | rtp_dtls_wrap_get_connection (struct ast_rtp_instance *instance) |
static const char * | rtp_dtls_wrap_get_fingerprint (struct ast_rtp_instance *instance) |
static enum ast_rtp_dtls_hash | rtp_dtls_wrap_get_fingerprint_hash (struct ast_rtp_instance *instance) |
static enum ast_rtp_dtls_setup | rtp_dtls_wrap_get_setup (struct ast_rtp_instance *instance) |
static void | rtp_dtls_wrap_reset (struct ast_rtp_instance *instance) |
static int | rtp_dtls_wrap_set_configuration (struct ast_rtp_instance *instance, const struct ast_rtp_dtls_cfg *dtls_cfg) |
static void | rtp_dtls_wrap_set_fingerprint (struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint) |
static void | rtp_dtls_wrap_set_setup (struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup) |
static void | rtp_dtls_wrap_stop (struct ast_rtp_instance *instance) |
static void | rtp_engine_mime_type_cleanup (int i) |
static void | rtp_engine_shutdown (void) |
static enum ast_rtp_extension_direction | rtp_extmap_negotiate_direction (enum ast_rtp_extension_direction ours, enum ast_rtp_extension_direction theirs) |
Helper function which negotiates two RTP extension directions to get our current direction. More... | |
static void | rtp_ice_wrap_add_remote_candidate (struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate) |
static void | rtp_ice_wrap_change_components (struct ast_rtp_instance *instance, int num_components) |
static struct ao2_container * | rtp_ice_wrap_get_local_candidates (struct ast_rtp_instance *instance) |
static const char * | rtp_ice_wrap_get_password (struct ast_rtp_instance *instance) |
static const char * | rtp_ice_wrap_get_ufrag (struct ast_rtp_instance *instance) |
static void | rtp_ice_wrap_ice_lite (struct ast_rtp_instance *instance) |
static void | rtp_ice_wrap_set_authentication (struct ast_rtp_instance *instance, const char *ufrag, const char *password) |
static void | rtp_ice_wrap_set_role (struct ast_rtp_instance *instance, enum ast_rtp_ice_role role) |
static void | rtp_ice_wrap_start (struct ast_rtp_instance *instance) |
static void | rtp_ice_wrap_stop (struct ast_rtp_instance *instance) |
static void | rtp_ice_wrap_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) |
static void | rtp_instance_set_incoming_source_address_nolock (struct ast_rtp_instance *instance, const struct ast_sockaddr *address) |
static struct ast_rtp_payload_type * | rtp_payload_type_alloc (struct ast_format *format, int payload, int rtp_code, int primary_mapping) |
static void | rtp_payload_type_dtor (void *obj) |
static void | rtp_rtcp_report_dtor (void *obj) |
static void | set_next_mime_type (struct ast_format *format, int rtp_code, const char *type, const char *subtype, unsigned int sample_rate) |
static void | unref_instance_cond (struct ast_rtp_instance **instance) |
Conditionally unref an rtp instance. More... | |
STASIS_MESSAGE_TYPE_DEFN (ast_rtp_rtcp_sent_type,.to_ami=rtcp_report_to_ami,.to_json=rtcp_report_to_json,) | |
Define RTCP/RTP message types. More... | |
STASIS_MESSAGE_TYPE_DEFN (ast_rtp_rtcp_received_type,.to_ami=rtcp_report_to_ami,.to_json=rtcp_report_to_json,) | |
Pluggable RTP Architecture.
Definition in file rtp_engine.c.
#define MAX_RTP_MIME_TYPES 128 |
Definition at line 247 of file rtp_engine.c.
#define SET_AST_JSON_OBJ | ( | target, | |
name, | |||
obj | |||
) |
Set given json object into target with name.
target | Target json. |
name | key of given object. |
obj | Json value will be set. |
Definition at line 288 of file rtp_engine.c.
Referenced by ast_rtp_convert_stats_json().
|
static |
Definition at line 3183 of file rtp_engine.c.
References ao2_cleanup, ARRAY_LEN, ast_assert, ast_format_get_name(), ast_log, ast_option_rtpusedynamic, ast_rwlock_unlock, ast_rwlock_wrlock, find_unused_payload(), LOG_WARNING, NULL, ast_rtp_payload_type::payload, rtp_payload_type_alloc(), and type.
Referenced by ast_rtp_engine_init(), and ast_rtp_engine_load_format().
int ast_rtp_codecs_find_payload_code | ( | struct ast_rtp_codecs * | codecs, |
int | payload | ||
) |
Search for the tx payload type in the ast_rtp_codecs structure.
codecs | Codecs structure to look in |
payload | The payload type format to look for |
Numerical | payload type or -1 if unable to find payload in codecs |
Example usage:
This looks for the numerical payload for ULAW in the codecs structure.
Definition at line 1975 of file rtp_engine.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_codecs::codecs_lock, ast_rtp_payload_type::payload, and type.
Referenced by bridge_p2p_rtp_write().
unsigned int ast_rtp_codecs_get_framing | ( | struct ast_rtp_codecs * | codecs | ) |
Get the framing used for a set of codecs.
codecs | Codecs structure to get the framing from |
The | framing to be used for the media stream associated with these codecs |
Definition at line 1569 of file rtp_engine.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, ast_rtp_codecs::codecs_lock, and ast_rtp_codecs::framing.
Referenced by ast_rtp_write(), create_outgoing_sdp_stream(), multicast_rtp_write(), native_rtp_bridge_compatible_check(), and process_sdp().
struct ast_rtp_payload_type* ast_rtp_codecs_get_payload | ( | struct ast_rtp_codecs * | codecs, |
int | payload | ||
) |
Retrieve rx payload mapped information by payload type.
codecs | Codecs structure to look in |
payload | Numerical payload to look up |
Payload | information. |
NULL | if payload does not exist. |
Example usage:
This looks up the information for payload '0' from the codecs structure.
Definition at line 1479 of file rtp_engine.c.
References ao2_bump, AST_RTP_MAX_PT, AST_RTP_PT_LAST_STATIC, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_codecs::codecs_lock, NULL, and type.
Referenced by ast_rtp_interpret(), and bridge_p2p_rtp_write().
struct ast_format* ast_rtp_codecs_get_payload_format | ( | struct ast_rtp_codecs * | codecs, |
int | payload | ||
) |
Retrieve the actual ast_format stored on the codecs structure for a specific tx payload type.
codecs | Codecs structure to look in |
payload | Numerical payload type to look up |
pointer | to format structure on success |
NULL | on failure |
Definition at line 1537 of file rtp_engine.c.
References ao2_bump, AST_RTP_MAX_PT, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, format, ast_rtp_payload_type::format, NULL, and type.
Referenced by get_codecs(), process_sdp_a_audio(), and process_sdp_a_video().
enum ast_media_type ast_rtp_codecs_get_stream_type | ( | struct ast_rtp_codecs * | codecs | ) |
Determine the type of RTP stream media from the codecs mapped.
codecs | Codecs structure to look in |
Definition at line 1460 of file rtp_engine.c.
References ast_format_get_type(), AST_MEDIA_TYPE_UNKNOWN, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, ast_rtp_payload_type::format, ast_rtp_payload_type::payload, and type.
Referenced by ast_rtp_read().
int ast_rtp_codecs_payload_code | ( | struct ast_rtp_codecs * | codecs, |
int | asterisk_format, | ||
struct ast_format * | format, | ||
int | code | ||
) |
Retrieve a rx mapped payload type based on whether it is an Asterisk format and the code.
codecs | Codecs structure to look in |
asterisk_format | Non-zero if the given Asterisk format is present |
format | Asterisk format to look for |
code | The format to look for |
Find the currently assigned rx mapped payload type based on whether it is an Asterisk format or non-format code. If one is currently not assigned then create a rx payload type mapping.
Numerical | payload type |
-1 | if could not assign. |
Example usage:
This looks for the numerical payload for ULAW in the codecs structure.
Definition at line 1873 of file rtp_engine.c.
References ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, ast_rtp_payload_type::format, ast_rtp_payload_type::payload, ast_rtp_payload_type::primary_mapping, ast_rtp_payload_type::rtp_code, rtp_codecs_assign_payload_code_rx(), and type.
Referenced by add_codec_to_sdp(), add_noncodec_to_sdp(), add_sdp(), add_tcodec_to_sdp(), add_vcodec_to_sdp(), apply_cap_to_bundled(), create_outgoing_sdp_stream(), and jingle_add_payloads_to_description().
int ast_rtp_codecs_payload_code_tx | ( | struct ast_rtp_codecs * | codecs, |
int | asterisk_format, | ||
const struct ast_format * | format, | ||
int | code | ||
) |
Retrieve a tx mapped payload type based on whether it is an Asterisk format and the code.
codecs | Codecs structure to look in |
asterisk_format | Non-zero if the given Asterisk format is present |
format | Asterisk format to look for |
code | The format to look for |
Numerical | payload type |
-1 | if not found. |
Definition at line 1928 of file rtp_engine.c.
References ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, find_static_payload_type(), ast_rtp_payload_type::format, ast_rtp_payload_type::payload, ast_rtp_payload_type::rtp_code, and type.
Referenced by ast_rtp_dtmf_begin(), ast_rtp_sendcng(), ast_rtp_write(), bridge_p2p_rtp_write(), multicast_rtp_write(), and send_start_rtp().
void ast_rtp_codecs_payload_formats | ( | struct ast_rtp_codecs * | codecs, |
struct ast_format_cap * | astformats, | ||
int * | nonastformats | ||
) |
Retrieve all formats that were found.
codecs | Codecs structure to look in |
astformats | A capabilities structure to put the Asterisk formats in. |
nonastformats | An integer to put the non-Asterisk formats in |
Example usage:
This retrieves all the formats known about in the codecs structure and puts the Asterisk ones in the integer pointed to by astformats and the non-Asterisk ones in the integer pointed to by nonastformats.
Definition at line 1580 of file rtp_engine.c.
References ast_format_cap_append, ast_format_cap_remove_by_type(), ast_format_cap_set_framing(), AST_MEDIA_TYPE_UNKNOWN, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, ast_rtp_payload_type::format, ast_rtp_codecs::framing, ast_rtp_payload_type::rtp_code, and type.
Referenced by jingle_interpret_description(), process_sdp(), set_caps(), and set_incoming_call_offer_cap().
int ast_rtp_codecs_payload_replace_format | ( | struct ast_rtp_codecs * | codecs, |
int | payload, | ||
struct ast_format * | format | ||
) |
Update the format associated with a tx payload type in a codecs structure.
codecs | Codecs structure to operate on |
payload | Numerical payload type to look up |
format | The format to replace the existing one |
0 | success |
-1 | failure |
Definition at line 1503 of file rtp_engine.c.
References ao2_cleanup, ao2_ref, ast_rtp_engine_alloc_payload_type(), AST_RTP_MAX_PT, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, format, ast_rtp_payload_type::format, ast_rtp_payload_type::payload, payload_mapping_tx_is_present(), ast_rtp_payload_type::primary_mapping, and type.
Referenced by get_codecs(), process_sdp_a_audio(), and process_sdp_a_video().
int ast_rtp_codecs_payload_set_rx | ( | struct ast_rtp_codecs * | codecs, |
int | code, | ||
struct ast_format * | format | ||
) |
Set a payload code for use with a specific Asterisk format.
codecs | Codecs structure to manipulate |
code | The payload code |
format | Asterisk format |
0 | Payload was set to the given format |
-1 | Payload was in use or could not be set |
Definition at line 1923 of file rtp_engine.c.
References rtp_codecs_assign_payload_code_rx().
Referenced by apply_cap_to_bundled(), and create_outgoing_sdp_stream().
void ast_rtp_codecs_payloads_clear | ( | struct ast_rtp_codecs * | codecs, |
struct ast_rtp_instance * | instance | ||
) |
Clear rx and tx payload mapping information from an RTP instance.
codecs | The codecs structure that payloads will be cleared from |
instance | Optionally the instance that the codecs structure belongs to |
Example usage:
This clears the codecs structure and puts it into a pristine state.
Definition at line 994 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_codecs_payloads_destroy(), ast_rtp_codecs_payloads_initialize(), AST_RTP_MAX_PT, ast_rtp_instance::engine, NULL, and ast_rtp_engine::payload_set.
void ast_rtp_codecs_payloads_copy | ( | struct ast_rtp_codecs * | src, |
struct ast_rtp_codecs * | dest, | ||
struct ast_rtp_instance * | instance | ||
) |
Copy payload information from one RTP instance to another.
src | The source codecs structure |
dest | The destination codecs structure that the values from src will be copied to |
instance | Optionally the instance that the dst codecs structure belongs to |
Example usage:
This copies the payloads from the codecs0 structure to the codecs1 structure, overwriting any current values.
Definition at line 1224 of file rtp_engine.c.
References ao2_t_cleanup, ast_rwlock_tryrdlock, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_rtp_codecs::codecs_lock, ast_rtp_codecs::framing, NULL, rtp_codecs_payloads_copy_rx(), rtp_codecs_payloads_copy_tx(), and type.
Referenced by jingle_interpret_description(), process_sdp(), set_caps(), and set_incoming_call_offer_cap().
void ast_rtp_codecs_payloads_destroy | ( | struct ast_rtp_codecs * | codecs | ) |
Destroy the contents of an RTP codecs structure (but not the structure itself)
codecs | The codecs structure to destroy the contents of |
Example usage:
Definition at line 974 of file rtp_engine.c.
References ao2_t_cleanup, ast_rwlock_destroy, AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_codecs::codecs_lock, and type.
Referenced by ast_rtp_codecs_payloads_clear(), ast_stream_free(), ast_stream_set_rtp_codecs(), instance_destructor(), jingle_interpret_description(), process_sdp(), set_caps(), and set_incoming_call_offer_cap().
int ast_rtp_codecs_payloads_initialize | ( | struct ast_rtp_codecs * | codecs | ) |
Initialize an RTP codecs structure.
codecs | The codecs structure to initialize |
0 | success |
-1 | failure |
Example usage:
Definition at line 958 of file rtp_engine.c.
References AST_RTP_MAX_PT, ast_rwlock_init, AST_VECTOR_FREE, AST_VECTOR_INIT, ast_rtp_codecs::codecs_lock, and ast_rtp_codecs::framing.
Referenced by ast_rtp_codecs_payloads_clear(), ast_rtp_instance_new(), get_codecs(), jingle_interpret_description(), and process_sdp().
void ast_rtp_codecs_payloads_set_m_type | ( | struct ast_rtp_codecs * | codecs, |
struct ast_rtp_instance * | instance, | ||
int | payload | ||
) |
Record tx payload type information that was seen in an m= SDP line.
codecs | The codecs structure to muck with |
instance | Optionally the instance that the codecs structure belongs to |
payload | Numerical payload that was seen in the m= SDP line |
Example usage:
This records that the numerical payload '0' was seen in the codecs structure.
Definition at line 1301 of file rtp_engine.c.
References ao2_bump, ao2_lock, ao2_ref, ao2_t_cleanup, ao2_unlock, ast_debug, AST_RTP_MAX_PT, AST_RTP_PT_LAST_STATIC, ast_rwlock_rdlock, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, ast_rtp_instance::engine, ast_rtp_payload_type::format, 10aedae86a32_add_outgoing_enum_va::new_type, payload_mapping_tx_is_present(), ast_rtp_engine::payload_set, and ast_rtp_payload_type::rtp_code.
Referenced by get_codecs(), and process_sdp().
int ast_rtp_codecs_payloads_set_rtpmap_type | ( | struct ast_rtp_codecs * | codecs, |
struct ast_rtp_instance * | instance, | ||
int | payload, | ||
char * | mimetype, | ||
char * | mimesubtype, | ||
enum ast_rtp_options | options | ||
) |
Record tx payload type information that was seen in an a=rtpmap: SDP line.
codecs | The codecs structure to muck with |
instance | Optionally the instance that the codecs structure belongs to |
payload | Numerical payload that was seen in the a=rtpmap: SDP line |
mimetype | The string mime type that was seen |
mimesubtype | The strin mime sub type that was seen |
options | Optional options that may change the behavior of this specific payload |
0 | success |
-1 | failure, invalid payload numbe |
-2 | failure, unknown mimetype |
Example usage:
This records that the numerical payload '0' was seen with mime type 'audio' and sub mime type 'PCMU' in the codecs structure.
Definition at line 1428 of file rtp_engine.c.
References ast_rtp_codecs_payloads_set_rtpmap_type_rate().
Referenced by configure_local_rtp(), jingle_interpret_description(), ooh323_set_write_format(), process_sdp(), and setup_rtp_connection().
int ast_rtp_codecs_payloads_set_rtpmap_type_rate | ( | struct ast_rtp_codecs * | codecs, |
struct ast_rtp_instance * | instance, | ||
int | pt, | ||
char * | mimetype, | ||
char * | mimesubtype, | ||
enum ast_rtp_options | options, | ||
unsigned int | sample_rate | ||
) |
Set tx payload type to a known MIME media type for a codec with a specific sample rate.
codecs | RTP structure to modify |
instance | Optionally the instance that the codecs structure belongs to |
pt | Payload type entry to modify |
mimetype | top-level MIME type of media stream (typically "audio", "video", "text", etc.) |
mimesubtype | MIME subtype of media stream (typically a codec name) |
options | Zero or more flags from the ast_rtp_options enum |
sample_rate | The sample rate of the media stream |
This function 'fills in' an entry in the list of possible formats for a media stream associated with an RTP structure.
0 | on success |
-1 | if the payload type is out of range |
-2 | if the mimeType/mimeSubtype combination was not found |
Definition at line 1343 of file rtp_engine.c.
References ao2_lock, ao2_ref, ao2_t_cleanup, ao2_unlock, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_g726, ast_format_g726_aal2, ast_format_parse_sdp_fmtp(), ast_rtp_engine_alloc_payload_type(), AST_RTP_MAX_PT, ast_rtp_mime_types, AST_RTP_OPT_G726_NONSTANDARD, ast_rwlock_rdlock, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, ast_rtp_instance::engine, ast_rtp_payload_type::format, mime_types_len, 10aedae86a32_add_outgoing_enum_va::new_type, ast_rtp_payload_type::payload, payload_mapping_tx_is_present(), ast_rtp_engine::payload_set, ast_rtp_mime_type::payload_type, ast_rtp_payload_type::primary_mapping, ast_rtp_payload_type::rtp_code, ast_rtp_mime_type::sample_rate, ast_rtp_mime_type::subtype, and ast_rtp_mime_type::type.
Referenced by ast_rtp_codecs_payloads_set_rtpmap_type(), get_codecs(), jingle_interpret_description(), process_sdp_a_audio(), process_sdp_a_text(), and process_sdp_a_video().
void ast_rtp_codecs_payloads_unset | ( | struct ast_rtp_codecs * | codecs, |
struct ast_rtp_instance * | instance, | ||
int | payload | ||
) |
Remove tx payload type mapped information.
codecs | The codecs structure to muck with |
instance | Optionally the instance that the codecs structure belongs to |
payload | Numerical payload to unset |
Example usage:
This clears the payload '0' from the codecs structure. It will be as if it was never set.
Definition at line 1433 of file rtp_engine.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_debug, AST_RTP_MAX_PT, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_rtp_codecs::codecs_lock, ast_rtp_instance::engine, NULL, ast_rtp_engine::payload_set, and type.
Referenced by process_sdp_a_audio(), and process_sdp_a_video().
void ast_rtp_codecs_payloads_xover | ( | struct ast_rtp_codecs * | src, |
struct ast_rtp_codecs * | dest, | ||
struct ast_rtp_instance * | instance | ||
) |
Crossover copy the tx payload mapping of src to the rx payload mapping of dest.
src | The source codecs structure |
dest | The destination codecs structure that the values from src will be copied to |
instance | Optionally the instance that the dst codecs structure belongs to |
Definition at line 1257 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_assert, ast_debug, ast_rwlock_tryrdlock, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_codecs::codecs_lock, ast_rtp_instance::engine, ast_rtp_payload_type::format, ast_rtp_codecs::framing, ast_rtp_engine::payload_set, ast_rtp_payload_type::primary_mapping, ast_rtp_payload_type::rtp_code, rtp_codecs_payload_replace_rx(), and type.
Referenced by ast_rtp_instance_early_bridge_make_compatible(), process_sdp(), set_caps(), and set_incoming_call_offer_cap().
void ast_rtp_codecs_set_framing | ( | struct ast_rtp_codecs * | codecs, |
unsigned int | framing | ||
) |
Set the framing used for a set of codecs.
codecs | Codecs structure to set framing on |
framing | The framing value to set on the codecs |
Definition at line 1558 of file rtp_engine.c.
References ast_rwlock_unlock, ast_rwlock_wrlock, ast_rtp_codecs::codecs_lock, and ast_rtp_codecs::framing.
Referenced by add_sdp(), check_peer_ok(), configure_local_rtp(), create_addr_from_peer(), get_codecs(), jingle_enable_video(), jingle_new(), process_sdp(), process_sdp_a_audio(), and start_rtp().
void ast_rtp_dtls_cfg_copy | ( | const struct ast_rtp_dtls_cfg * | src_cfg, |
struct ast_rtp_dtls_cfg * | dst_cfg | ||
) |
Copy contents of a DTLS configuration structure.
src_cfg | source DTLS configuration structure |
dst_cfg | destination DTLS configuration structure |
Definition at line 3113 of file rtp_engine.c.
References ast_rtp_dtls_cfg_free(), ast_strdup, ast_rtp_dtls_cfg::cafile, ast_rtp_dtls_cfg::capath, ast_rtp_dtls_cfg::certfile, ast_rtp_dtls_cfg::cipher, ast_rtp_dtls_cfg::default_setup, ast_rtp_dtls_cfg::enabled, ast_rtp_dtls_cfg::ephemeral_cert, ast_rtp_dtls_cfg::hash, ast_rtp_dtls_cfg::pvtfile, ast_rtp_dtls_cfg::rekey, ast_rtp_dtls_cfg::suite, and ast_rtp_dtls_cfg::verify.
Referenced by build_peer(), check_peer_ok(), and create_addr_from_peer().
void ast_rtp_dtls_cfg_free | ( | struct ast_rtp_dtls_cfg * | dtls_cfg | ) |
Free contents of a DTLS configuration structure.
dtls_cfg | a DTLS configuration structure |
Definition at line 3131 of file rtp_engine.c.
References ast_free, ast_rtp_dtls_cfg::cafile, ast_rtp_dtls_cfg::capath, ast_rtp_dtls_cfg::certfile, ast_rtp_dtls_cfg::cipher, NULL, and ast_rtp_dtls_cfg::pvtfile.
Referenced by ast_rtp_dtls_cfg_copy(), build_peer(), media_configuration_destroy(), reload_config(), sip_destroy_peer(), sip_pvt_dtor(), and unload_module().
int ast_rtp_dtls_cfg_parse | ( | struct ast_rtp_dtls_cfg * | dtls_cfg, |
const char * | name, | ||
const char * | value | ||
) |
Parse DTLS related configuration options.
dtls_cfg | a DTLS configuration structure |
name | name of the configuration option |
value | value of the configuration option |
0 | if handled |
-1 | if not handled |
Definition at line 3020 of file rtp_engine.c.
References ast_file_is_readable(), ast_free, ast_log, AST_RTP_DTLS_HASH_SHA1, AST_RTP_DTLS_HASH_SHA256, AST_RTP_DTLS_SETUP_ACTIVE, AST_RTP_DTLS_SETUP_ACTPASS, AST_RTP_DTLS_SETUP_PASSIVE, AST_RTP_DTLS_VERIFY_CERTIFICATE, AST_RTP_DTLS_VERIFY_FINGERPRINT, AST_RTP_DTLS_VERIFY_NONE, ast_strdup, ast_strlen_zero, ast_true(), ast_rtp_dtls_cfg::cafile, ast_rtp_dtls_cfg::capath, ast_rtp_dtls_cfg::certfile, ast_rtp_dtls_cfg::cipher, ast_rtp_dtls_cfg::default_setup, ast_rtp_dtls_cfg::enabled, ast_rtp_dtls_cfg::ephemeral_cert, ast_rtp_dtls_cfg::hash, LOG_ERROR, ast_rtp_dtls_cfg::pvtfile, ast_rtp_dtls_cfg::rekey, and ast_rtp_dtls_cfg::verify.
Referenced by build_peer(), dtls_handler(), media_encryption_handler(), and reload_config().
int ast_rtp_dtls_cfg_validate | ( | struct ast_rtp_dtls_cfg * | dtls_cfg | ) |
Validates DTLS related configuration options.
dtls_cfg | a DTLS configuration structure |
0 | if valid |
-1 | if invalid |
Definition at line 3094 of file rtp_engine.c.
References ast_log, ast_strlen_zero, ast_rtp_dtls_cfg::cafile, ast_rtp_dtls_cfg::capath, ast_rtp_dtls_cfg::certfile, ast_rtp_dtls_cfg::ephemeral_cert, LOG_ERROR, LOG_NOTICE, and ast_rtp_dtls_cfg::pvtfile.
Referenced by build_peer(), reload_config(), and sip_endpoint_apply_handler().
struct ast_rtp_payload_type* ast_rtp_engine_alloc_payload_type | ( | void | ) |
Allocation routine for ast_rtp_payload_type.
NULL | on error |
An | ao2 ref counted ast_rtp_payload_type on success. |
ast_rtp_payload_type
returned by this function is an ao2 ref counted object. Definition at line 325 of file rtp_engine.c.
References NULL, and rtp_payload_type_alloc().
Referenced by ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), and payload_mapping_rx_clear_primary().
int ast_rtp_engine_init | ( | void | ) |
initializes the rtp engine arrays
Definition at line 3622 of file rtp_engine.c.
References add_static_payload(), ast_debug_category_register(), ast_format_adpcm, ast_format_alaw, ast_format_g719, ast_format_g722, ast_format_g723, ast_format_g726, ast_format_g726_aal2, ast_format_g729, ast_format_gsm, ast_format_h261, ast_format_h263, ast_format_h263p, ast_format_h264, ast_format_h265, ast_format_ilbc, ast_format_jpeg, ast_format_lpc10, ast_format_mp4, ast_format_opus, ast_format_png, ast_format_siren14, ast_format_siren7, ast_format_slin, ast_format_slin12, ast_format_slin16, ast_format_slin192, ast_format_slin24, ast_format_slin32, ast_format_slin44, ast_format_slin48, ast_format_slin96, ast_format_speex, ast_format_speex16, ast_format_speex32, ast_format_t140, ast_format_t140_red, ast_format_ulaw, ast_format_vp8, ast_format_vp9, AST_LOG_CATEGORY_DTLS, AST_LOG_CATEGORY_DTLS_PACKET, AST_LOG_CATEGORY_ICE, AST_LOG_CATEGORY_RTCP, AST_LOG_CATEGORY_RTCP_PACKET, AST_LOG_CATEGORY_RTP, AST_LOG_CATEGORY_RTP_PACKET, ast_register_cleanup(), AST_RTP_CISCO_DTMF, AST_RTP_CN, AST_RTP_DTMF, ast_rtp_rtcp_received_type(), ast_rtp_rtcp_sent_type(), ast_rwlock_init, debug_category_dtls_id, debug_category_dtls_packet_id, debug_category_ice_id, debug_category_rtcp_id, debug_category_rtcp_packet_id, debug_category_rtp_id, debug_category_rtp_packet_id, NULL, rtp_engine_shutdown(), set_next_mime_type(), STASIS_MESSAGE_TYPE_INIT, and stasis_topic_create().
Referenced by asterisk_daemon().
int ast_rtp_engine_load_format | ( | struct ast_format * | format | ) |
Custom formats declared in codecs.conf at startup must be communicated to the rtp_engine so their mime type can payload number can be initialized.
Definition at line 3229 of file rtp_engine.c.
References add_static_payload(), ast_codec_media_type2str(), ast_format_get_codec_name(), ast_format_get_sample_rate(), ast_format_get_type(), ast_str_to_upper(), ast_strdupa, and set_next_mime_type().
Referenced by load_module().
int ast_rtp_engine_register2 | ( | struct ast_rtp_engine * | engine, |
struct ast_module * | module | ||
) |
Register an RTP engine.
engine | Structure of the RTP engine to register |
module | Module that the RTP engine is part of |
0 | success |
-1 | failure |
Example usage:
This registers the RTP engine declared as example_rtp_engine with the RTP engine core, but does not associate a module with it.
Definition at line 330 of file rtp_engine.c.
References ast_log, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strlen_zero, ast_verb, ast_rtp_engine::destroy, LOG_WARNING, ast_rtp_engine::mod, ast_rtp_engine::name, ast_rtp_engine::new, ast_rtp_engine::read, and ast_rtp_engine::write.
int ast_rtp_engine_register_srtp | ( | struct ast_srtp_res * | srtp_res, |
struct ast_srtp_policy_res * | policy_res | ||
) |
Definition at line 2710 of file rtp_engine.c.
References policy_res, and srtp_res.
Referenced by res_srtp_init().
int ast_rtp_engine_srtp_is_registered | ( | void | ) |
Definition at line 2731 of file rtp_engine.c.
References res_srtp_policy.
Referenced by ast_sdp_srtp_alloc(), and dialog_initialize_dtls_srtp().
int ast_rtp_engine_unload_format | ( | struct ast_format * | format | ) |
Formats requiring the use of a format attribute interface must have that interface registered in order for the rtp engine to handle it correctly. If an attribute interface is unloaded, this function must be called to notify the rtp_engine.
Definition at line 3245 of file rtp_engine.c.
References ao2_ref, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, AST_RTP_MAX_PT, ast_rtp_mime_types, ast_rwlock_unlock, ast_rwlock_wrlock, mime_types_len, NULL, and rtp_engine_mime_type_cleanup().
Referenced by unload_module().
int ast_rtp_engine_unregister | ( | struct ast_rtp_engine * | engine | ) |
Unregister an RTP engine.
engine | Structure of the RTP engine to unregister |
0 | success |
-1 | failure |
Example usage:
This unregisters the RTP engine declared as example_rtp_engine from the RTP engine core. If a module reference was provided when it was registered then this will only be called once the RTP engine is no longer in use.
Definition at line 364 of file rtp_engine.c.
References AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, ast_rtp_engine::name, and NULL.
Referenced by AST_TEST_DEFINE(), load_module(), and unload_module().
void ast_rtp_engine_unregister_srtp | ( | void | ) |
int ast_rtp_glue_register2 | ( | struct ast_rtp_glue * | glue, |
struct ast_module * | module | ||
) |
Register RTP glue.
glue | The glue to register |
module | Module that the RTP glue is part of |
0 | success |
-1 | failure |
Example usage:
This registers the RTP glue declared as example_rtp_glue with the RTP engine core, but does not associate a module with it.
Definition at line 379 of file rtp_engine.c.
References ast_log, AST_RWLIST_INSERT_TAIL, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_strlen_zero, ast_verb, LOG_WARNING, ast_rtp_glue::mod, NULL, and ast_rtp_glue::type.
int ast_rtp_glue_unregister | ( | struct ast_rtp_glue * | glue | ) |
Unregister RTP glue.
glue | The glue to unregister |
0 | success |
-1 | failure |
Example usage:
This unregisters the RTP glue declared as example_rtp_gkue from the RTP engine core. If a module reference was provided when it was registered then this will only be called once the RTP engine is no longer in use.
Definition at line 408 of file rtp_engine.c.
References AST_RWLIST_REMOVE, AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_verb, NULL, and ast_rtp_glue::type.
Referenced by load_module(), and unload_module().
int ast_rtp_instance_activate | ( | struct ast_rtp_instance * | instance | ) |
Indicate to the RTP engine that packets are now expected to be sent/received on the RTP instance.
instance | The RTP instance |
0 | success |
-1 | failure |
Example usage:
This tells the underlying RTP engine of instance that packets will now flow.
Definition at line 2647 of file rtp_engine.c.
References ast_rtp_engine::activate, ao2_lock, ao2_unlock, and ast_rtp_instance::engine.
Referenced by apply_negotiated_sdp_stream(), handle_response_invite(), rtp_call(), test_init_rtp_instances(), and transmit_response_with_sdp().
int ast_rtp_instance_add_srtp_policy | ( | struct ast_rtp_instance * | instance, |
struct ast_srtp_policy * | remote_policy, | ||
struct ast_srtp_policy * | local_policy, | ||
int | rtcp | ||
) |
Add or replace the SRTP policies for the given RTP instance.
instance | the RTP instance |
remote_policy | the remote endpoint's policy |
local_policy | our policy for this RTP instance's remote endpoint |
rtcp | 1 for dedicated RTCP policies |
0 | Success |
non-zero | Failure |
Definition at line 2736 of file rtp_engine.c.
References ast_srtp_res::add_stream, ao2_lock, ao2_unlock, ast_srtp_res::create, ast_srtp_res::replace, ast_rtp_instance::rtcp_srtp, and ast_rtp_instance::srtp.
Referenced by crypto_activate(), and rtcp_debug_test_addr().
void ast_rtp_instance_available_formats | ( | struct ast_rtp_instance * | instance, |
struct ast_format_cap * | to_endpoint, | ||
struct ast_format_cap * | to_asterisk, | ||
struct ast_format_cap * | result | ||
) |
Request the formats that can be transcoded.
instance | The RTP instance |
to_endpoint | Formats being sent/received towards the endpoint |
to_asterisk | Formats being sent/received towards Asterisk |
result | capabilities structure to store and return supported formats in. |
Example usage:
This sees if it is possible to have ulaw communicated to the endpoint but signed linear received into Asterisk.
Definition at line 2633 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_format_cap_count(), ast_translate_available_formats(), ast_rtp_engine::available_formats, and ast_rtp_instance::engine.
Referenced by sip_call().
int ast_rtp_instance_bundle | ( | struct ast_rtp_instance * | child, |
struct ast_rtp_instance * | parent | ||
) |
Request that an RTP instance be bundled with another.
child | The child RTP instance |
parent | The parent RTP instance the child should be bundled with |
0 | success |
-1 | failure |
Definition at line 3804 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::bundle, and ast_rtp_instance::engine.
Referenced by apply_negotiated_sdp_stream(), and negotiate_incoming_sdp_stream().
void ast_rtp_instance_change_source | ( | struct ast_rtp_instance * | instance | ) |
Indicate a new source of audio has dropped in and the ssrc should change.
instance | Instance that the new media source is feeding into |
Example usage:
This indicates that the source of media that is feeding the instance pointed to by instance has changed and that the marker bit should be set and the SSRC updated.
Definition at line 2160 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::change_source, and ast_rtp_instance::engine.
Referenced by create_outgoing_sdp_stream(), jingle_indicate(), mgcp_indicate(), ooh323_indicate(), sip_indicate(), skinny_indicate(), and unistim_indicate().
int ast_rtp_instance_destroy | ( | struct ast_rtp_instance * | instance | ) |
Destroy an RTP instance.
instance | The RTP instance to destroy |
0 | success |
-1 | failure |
Example usage:
This destroys the RTP instance pointed to by instance. Once this function returns instance no longer points to valid memory and may not be used again.
Definition at line 458 of file rtp_engine.c.
References ao2_cleanup.
Referenced by AST_TEST_DEFINE(), destroy_endpoint(), destroy_rtp(), dialog_clean_rtp(), jingle_session_destructor(), mgcp_hangup(), multicast_rtp_request(), ooh323_destroy(), rtp_hangup(), sip_new(), start_rtp(), stream_destroy(), unalloc_sub(), unicast_rtp_request(), and unistim_hangup_clean().
int ast_rtp_instance_dtmf_begin | ( | struct ast_rtp_instance * | instance, |
char | digit | ||
) |
Begin sending a DTMF digit.
instance | The RTP instance to send the DTMF on |
digit | What DTMF digit to send |
0 | success |
-1 | failure |
Example usage:
This starts sending the DTMF '1' on the RTP instance pointed to by instance. It will continue being sent until it is ended.
Definition at line 2081 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtmf_begin, and ast_rtp_instance::engine.
Referenced by chan_pjsip_digit_begin(), jingle_digit_begin(), mgcp_senddigit_begin(), ooh323_digit_begin(), and sip_senddigit_begin().
int ast_rtp_instance_dtmf_end | ( | struct ast_rtp_instance * | instance, |
char | digit | ||
) |
Stop sending a DTMF digit.
instance | The RTP instance to stop the DTMF on |
digit | What DTMF digit to stop |
0 | success |
-1 | failure |
Example usage:
This stops sending the DTMF '1' on the RTP instance pointed to by instance.
Definition at line 2095 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtmf_end, and ast_rtp_instance::engine.
Referenced by mgcp_senddigit_end(), and ooh323_digit_end().
int ast_rtp_instance_dtmf_end_with_duration | ( | struct ast_rtp_instance * | instance, |
char | digit, | ||
unsigned int | duration | ||
) |
Definition at line 2109 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtmf_end_with_duration, and ast_rtp_instance::engine.
Referenced by chan_pjsip_digit_end(), jingle_digit_end(), and sip_senddigit_end().
enum ast_rtp_dtmf_mode ast_rtp_instance_dtmf_mode_get | ( | struct ast_rtp_instance * | instance | ) |
Get the DTMF mode of an RTP instance.
instance | The RTP instance to get the DTMF mode of |
DTMF | mode |
Example usage:
This gets the DTMF mode set on the RTP instance pointed to by 'instance'.
Definition at line 2137 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtmf_mode_get, and ast_rtp_instance::engine.
Referenced by chan_pjsip_digit_begin(), chan_pjsip_digit_end(), native_rtp_bridge_compatible_check(), pjsip_acf_dtmf_mode_write(), and set_caps().
int ast_rtp_instance_dtmf_mode_set | ( | struct ast_rtp_instance * | instance, |
enum ast_rtp_dtmf_mode | dtmf_mode | ||
) |
Set the DTMF mode that should be used.
instance | the RTP instance to set DTMF mode on |
dtmf_mode | The DTMF mode that is in use |
0 | success |
-1 | failure |
Example usage:
This sets the RTP instance to use RFC2833 for DTMF transmission and receiving.
Definition at line 2123 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtmf_mode_set, and ast_rtp_instance::engine.
Referenced by create_rtp(), enable_dsp_detect(), get_codecs(), pjsip_acf_dtmf_mode_write(), and sip_new().
int ast_rtp_instance_early_bridge | ( | struct ast_channel * | c0, |
struct ast_channel * | c1 | ||
) |
Early bridge two channels that use RTP instances.
c0 | First channel part of the bridge |
c1 | Second channel part of the bridge |
0 | success |
-1 | failure |
Definition at line 2337 of file rtp_engine.c.
References ao2_cleanup, ast_channel_lock_both, ast_channel_name(), ast_channel_tech(), ast_channel_unlock, ast_debug, ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_iscompatible(), ast_log, AST_RTP_GLUE_RESULT_FORBID, AST_RTP_GLUE_RESULT_REMOTE, ast_rtp_instance_get_glue(), done, ast_rtp_glue::get_codec, ast_rtp_glue::get_rtp_info, ast_rtp_glue::get_vrtp_info, LOG_WARNING, NULL, type, unref_instance_cond(), and ast_rtp_glue::update_peer.
void ast_rtp_instance_early_bridge_make_compatible | ( | struct ast_channel * | c_dst, |
struct ast_channel * | c_src | ||
) |
Make two channels compatible for early bridging.
c_dst | Destination channel to copy to |
c_src | Source channel to copy from |
Definition at line 2251 of file rtp_engine.c.
References ao2_cleanup, ast_channel_lock_both, ast_channel_name(), ast_channel_tech(), ast_channel_unlock, ast_debug, ast_format_cap_alloc, AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_iscompatible(), ast_log, ast_rtp_codecs_payloads_xover(), AST_RTP_GLUE_RESULT_FORBID, AST_RTP_GLUE_RESULT_REMOTE, ast_rtp_instance_get_glue(), ast_rtp_instance::codecs, done, ast_rtp_glue::get_codec, ast_rtp_glue::get_rtp_info, ast_rtp_glue::get_vrtp_info, LOG_WARNING, NULL, type, unref_instance_cond(), and ast_rtp_glue::update_peer.
Referenced by dial_exec_full(), and do_forward().
void ast_rtp_instance_extmap_clear | ( | struct ast_rtp_instance * | instance | ) |
Clear negotiated RTP extension information.
instance | The RTP instance to clear negotiated extension information on |
Definition at line 862 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_RTP_EXTENSION_DIRECTION_NONE, AST_RTP_EXTENSION_UNSUPPORTED, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, and rtp_extmap::extension.
Referenced by process_extmap_attributes().
size_t ast_rtp_instance_extmap_count | ( | struct ast_rtp_instance * | instance | ) |
Get the number of known unique identifiers.
instance | The RTP instance to retrieve the count from |
Definition at line 899 of file rtp_engine.c.
References ao2_lock, ao2_unlock, and AST_VECTOR_SIZE.
Referenced by add_extmap_to_stream(), and enable_rtp_extension().
int ast_rtp_instance_extmap_enable | ( | struct ast_rtp_instance * | instance, |
int | id, | ||
enum ast_rtp_extension | extension, | ||
enum ast_rtp_extension_direction | direction | ||
) |
Enable support for an RTP extension on an instance.
instance | The RTP instance to enable the extension on |
id | The unique local identifier to use for this extension (-1 to have one auto selected) |
extension | The RTP extension |
direction | The initial direction that the RTP extension should be used in |
0 | success |
-1 | failure |
Definition at line 732 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_RTP_EXTENSION_DIRECTION_NONE, AST_RTP_EXTENSION_UNSUPPORTED, AST_VECTOR_APPEND, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, rtp_extmap::direction, ast_rtp_instance::engine, rtp_extmap::extension, and ast_rtp_engine::extension_enable.
Referenced by enable_rtp_extension().
enum ast_rtp_extension_direction ast_rtp_instance_extmap_get_direction | ( | struct ast_rtp_instance * | instance, |
int | id | ||
) |
Retrieve the negotiated direction for an RTP extension id.
instance | The RTP instance to retrieve the direction from |
id | The negotiated RTP extension id |
direction | the direction that has been negotiated |
Definition at line 930 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_RTP_EXTENSION_DIRECTION_NONE, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, and rtp_extmap::direction.
Referenced by add_extmap_to_stream().
enum ast_rtp_extension ast_rtp_instance_extmap_get_extension | ( | struct ast_rtp_instance * | instance, |
int | id | ||
) |
Retrieve the extension for an RTP extension id.
instance | The RTP instance to retrieve the extension from |
id | The negotiated RTP extension id |
extension | the extension that maps to the id |
Definition at line 910 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_RTP_EXTENSION_UNSUPPORTED, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, and rtp_extmap::extension.
Referenced by add_extmap_to_stream(), and ast_rtp_instance_extmap_get_uri().
int ast_rtp_instance_extmap_get_id | ( | struct ast_rtp_instance * | instance, |
enum ast_rtp_extension | extension | ||
) |
Retrieve the id for an RTP extension.
instance | The RTP instance to retrieve the id from |
extension | The RTP extension |
-1 | not negotiated |
id | if negotiated |
Definition at line 886 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, and id.
Referenced by ast_rtp_rtcp_handle_nack(), enable_rtp_extension(), rtp_instance_parse_extmap_extensions(), and rtp_raw_write().
const char* ast_rtp_instance_extmap_get_uri | ( | struct ast_rtp_instance * | instance, |
int | id | ||
) |
Retrieve the URI for an RTP extension id.
instance | The RTP instance to retrieve the direction from |
id | The negotiated RTP extension id |
uri | The URI for the RTP extension |
Definition at line 946 of file rtp_engine.c.
References ARRAY_LEN, AST_RTP_EXTENSION_UNSUPPORTED, ast_rtp_instance_extmap_get_extension(), rtp_extmap::extension, NULL, and rtp_extension_uris.
Referenced by add_extmap_to_stream().
int ast_rtp_instance_extmap_negotiate | ( | struct ast_rtp_instance * | instance, |
int | id, | ||
enum ast_rtp_extension_direction | direction, | ||
const char * | uri, | ||
const char * | attributes | ||
) |
Negotiate received RTP extension information.
instance | The RTP instance to set the extension on |
id | The local identifier for the extension |
direction | The direction that the extension should be used in |
uri | The unique URI for the extension |
attributes | Attributes specific to this extension (if NULL or empty then no attributes) |
0 | success |
-1 | failure |
Definition at line 818 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ARRAY_LEN, AST_RTP_EXTENSION_DIRECTION_NONE, AST_RTP_EXTENSION_UNSUPPORTED, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, rtp_extmap::direction, rtp_extmap::extension, rtp_extension_uris, and rtp_extmap_negotiate_direction().
Referenced by process_extmap_attributes().
int ast_rtp_instance_fd | ( | struct ast_rtp_instance * | instance, |
int | rtcp | ||
) |
Get the file descriptor for an RTP session (or RTCP)
instance | Instance to get the file descriptor for |
rtcp | Whether to retrieve the file descriptor for RTCP or not |
fd | success |
-1 | failure |
Example usage:
This retrieves the file descriptor for the socket carrying media on the instance pointed to by instance.
Definition at line 2192 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::fd.
Referenced by apply_negotiated_sdp_stream(), check_for_rtp_changes(), configure_local_rtp(), configure_rtcp(), jingle_enable_video(), jingle_new(), mgcp_new(), rtp_find_rtcp_fd_position(), sip_new(), sip_set_rtp_peer(), skinny_new(), start_rtp(), transmit_reinvite_with_sdp(), unicast_rtp_request(), and unistim_new().
struct ast_rtp_glue* ast_rtp_instance_get_active_glue | ( | struct ast_rtp_instance * | instance | ) |
Get the RTP glue in use on an RTP instance.
instance | The RTP instance |
pointer | to the glue |
Example:
This gets the RTP glue currently in use on the RTP instance pointed to by 'instance'.
Definition at line 2705 of file rtp_engine.c.
References ast_rtp_instance::glue.
int ast_rtp_instance_get_and_cmp_local_address | ( | struct ast_rtp_instance * | instance, |
struct ast_sockaddr * | address | ||
) |
Get the address of the local endpoint that we are sending RTP to, comparing its address to another.
instance | The instance that we want to get the local address for |
address | An initialized address that may be overwritten if the local address is different |
0 | address was not changed |
1 | address was changed Example usage: |
This retrieves the current local address set on the instance pointed to by instance and puts the value into the address structure.
Definition at line 629 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_cmp(), ast_sockaddr_copy(), and ast_rtp_instance::local_address.
int ast_rtp_instance_get_and_cmp_requested_target_address | ( | struct ast_rtp_instance * | instance, |
struct ast_sockaddr * | address | ||
) |
Get the requested target address of the remote endpoint and compare it to the given address.
instance | The instance that we want to get the remote address for |
address | An initialized address that may be overwritten addresses differ |
0 | address was not changed |
1 | address was changed |
Definition at line 651 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_cmp(), ast_sockaddr_copy(), and ast_rtp_instance::requested_target_address.
struct ast_rtp_instance* ast_rtp_instance_get_bridged | ( | struct ast_rtp_instance * | instance | ) |
Get the other RTP instance that an instance is bridged to.
instance | The RTP instance that we want |
non-NULL | success |
NULL | failure |
Example usage:
This gets the RTP instance that instance0 is bridged to.
Definition at line 2234 of file rtp_engine.c.
References ao2_lock, ao2_unlock, and ast_rtp_instance::bridged.
Referenced by ast_rtp_interpret(), and dialog_needdestroy().
const char* ast_rtp_instance_get_channel_id | ( | struct ast_rtp_instance * | instance | ) |
Get the unique ID of the channel that owns this RTP instance.
Note that this should remain valid for the lifetime of the RTP instance.
instance | The RTP instance |
The | unique ID of the channel |
Empty | string if no channel owns this RTP instance |
Definition at line 548 of file rtp_engine.c.
References ast_rtp_instance::channel_uniqueid.
Referenced by ast_rtp_get_stat(), rtp_check_timeout(), and rtp_transport_wide_cc_feedback_produce().
const char* ast_rtp_instance_get_cname | ( | struct ast_rtp_instance * | rtp | ) |
Retrieve the CNAME used in RTCP SDES items.
This is a pointer directly into the RTP struct, not a copy.
rtp | The RTP instance |
Definition at line 3791 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::cname_get, and ast_rtp_instance::engine.
Referenced by add_ssrc_to_stream().
struct ast_rtp_codecs* ast_rtp_instance_get_codecs | ( | struct ast_rtp_instance * | instance | ) |
Get the codecs structure of an RTP instance.
instance | The RTP instance to get the codecs structure from |
Example usage:
This gets the codecs structure on the RTP instance pointed to by 'instance'.
Definition at line 727 of file rtp_engine.c.
References ast_rtp_instance::codecs.
Referenced by add_codec_to_sdp(), add_noncodec_to_sdp(), add_sdp(), add_tcodec_to_sdp(), add_vcodec_to_sdp(), apply_cap_to_bundled(), ast_rtp_dtmf_begin(), ast_rtp_interpret(), ast_rtp_read(), ast_rtp_sendcng(), ast_rtp_write(), bridge_p2p_rtp_write(), check_peer_ok(), configure_local_rtp(), create_addr_from_peer(), create_outgoing_sdp_stream(), jingle_add_payloads_to_description(), jingle_enable_video(), jingle_interpret_description(), jingle_new(), multicast_rtp_write(), native_rtp_bridge_compatible_check(), ooh323_set_write_format(), process_sdp(), send_start_rtp(), set_caps(), set_incoming_call_offer_cap(), setup_rtp_connection(), and start_rtp().
void* ast_rtp_instance_get_data | ( | struct ast_rtp_instance * | instance | ) |
Get the data portion of an RTP instance.
instance | The RTP instance we want the data portion from |
Example usage:
This gets the data pointer on the RTP instance pointed to by 'instance'.
Definition at line 563 of file rtp_engine.c.
References ast_rtp_instance::data.
Referenced by __rtp_recvfrom(), __rtp_sendto(), ast_rtcp_calculate_sr_rr_statistics(), ast_rtcp_generate_nack(), ast_rtcp_generate_report(), ast_rtcp_generate_sdes(), ast_rtcp_interpret(), ast_rtcp_read(), ast_rtcp_write(), ast_rtp_bundle(), ast_rtp_change_source(), ast_rtp_destroy(), ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), ast_rtp_dtmf_end_with_duration(), ast_rtp_dtmf_mode_get(), ast_rtp_dtmf_mode_set(), ast_rtp_fd(), ast_rtp_get_cname(), ast_rtp_get_ssrc(), ast_rtp_get_stat(), ast_rtp_ice_add_remote_candidate(), ast_rtp_ice_change_components(), ast_rtp_ice_get_local_candidates(), ast_rtp_ice_get_password(), ast_rtp_ice_get_ufrag(), ast_rtp_ice_lite(), ast_rtp_ice_set_authentication(), ast_rtp_ice_set_role(), ast_rtp_ice_start(), ast_rtp_ice_start_media(), ast_rtp_ice_stop(), ast_rtp_ice_turn_request(), ast_rtp_interpret(), ast_rtp_local_bridge(), ast_rtp_on_ice_rx_data(), ast_rtp_on_ice_tx_pkt(), ast_rtp_on_turn_rtcp_state(), ast_rtp_on_turn_rtp_state(), ast_rtp_on_turn_rx_rtcp_data(), ast_rtp_on_turn_rx_rtp_data(), ast_rtp_prop_set(), ast_rtp_qos_set(), ast_rtp_read(), ast_rtp_remote_address_set(), ast_rtp_rtcp_handle_nack(), ast_rtp_sendcng(), ast_rtp_set_remote_ssrc(), ast_rtp_set_stream_num(), ast_rtp_stop(), ast_rtp_stun_request(), ast_rtp_update_source(), ast_rtp_write(), bridge_p2p_rtp_write(), create_dtmf_frame(), get_recv_buffer_count(), get_recv_buffer_max(), get_send_buffer_count(), ice_create(), ice_reset_session(), multicast_rtp_activate(), multicast_rtp_destroy(), multicast_rtp_write(), process_cn_rfc3389(), process_dtmf_cisco(), process_dtmf_rfc2833(), red_write(), rtcp_debug_test_addr(), rtp_instance_parse_transport_wide_cc(), rtp_raw_write(), rtp_red_buffer(), rtp_red_init(), rtp_sendto(), rtp_transport_wide_cc_feedback_produce(), set_rtp_rtcp_schedid(), and test_sip_rtpqos_1_get_stat().
struct ast_rtp_engine_dtls* ast_rtp_instance_get_dtls | ( | struct ast_rtp_instance * | instance | ) |
Obtain a pointer to the DTLS support present on an RTP instance.
instance | the RTP instance |
DTLS | support if present |
NULL | if no DTLS support available |
Definition at line 3011 of file rtp_engine.c.
References ast_rtp_engine::dtls, ast_rtp_instance::engine, NULL, and rtp_dtls_wrappers.
Referenced by add_crypto_to_stream(), add_dtls_to_sdp(), apply_dtls_attrib(), ast_sdp_get_rtp_profile(), dialog_initialize_dtls_srtp(), process_crypto(), process_sdp(), process_sdp_a_dtls(), and setup_dtls_srtp().
struct ast_rtp_engine* ast_rtp_instance_get_engine | ( | struct ast_rtp_instance * | instance | ) |
Get the RTP engine in use on an RTP instance.
instance | The RTP instance |
pointer | to the engine |
Example usage:
This gets the RTP engine currently in use on the RTP instance pointed to by 'instance'.
Definition at line 2700 of file rtp_engine.c.
References ast_rtp_instance::engine.
Referenced by native_rtp_bridge_compatible_check(), native_rtp_bridge_start(), and native_rtp_bridge_stop().
void* ast_rtp_instance_get_extended_prop | ( | struct ast_rtp_instance * | instance, |
int | property | ||
) |
Get the value of an RTP instance extended property.
instance | The RTP instance to get the extended property on |
property | The extended property to get |
Definition at line 690 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::extended_prop_get, and NULL.
struct ast_rtp_glue* ast_rtp_instance_get_glue | ( | const char * | type | ) |
Get the RTP glue that binds a channel to the RTP engine.
type | Name of the glue we want |
non-NULL | success |
NULL | failure |
Example usage:
This retrieves the RTP glue that has the name 'Example'.
Definition at line 2206 of file rtp_engine.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, NULL, and ast_rtp_glue::type.
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().
int ast_rtp_instance_get_hold_timeout | ( | struct ast_rtp_instance * | instance | ) |
Get the RTP timeout value for when an RTP instance is on hold.
instance | The RTP instance |
timeout | value |
Example usage:
This gets the RTP hold timeout value for the RTP instance pointed to by 'instance'.
Definition at line 2690 of file rtp_engine.c.
References ast_rtp_instance::holdtimeout.
Referenced by check_rtp_timeout().
struct ast_rtp_engine_ice* ast_rtp_instance_get_ice | ( | struct ast_rtp_instance * | instance | ) |
Obtain a pointer to the ICE support present on an RTP instance.
instance | the RTP instance |
ICE | support if present |
NULL | if no ICE support available |
Definition at line 2891 of file rtp_engine.c.
References ast_rtp_instance::engine, ast_rtp_engine::ice, NULL, and rtp_ice_wrappers.
Referenced by add_ice_to_sdp(), add_ice_to_stream(), check_ice_support(), create_rtp(), dialog_initialize_rtp(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_enable_video(), jingle_interpret_google_transport(), jingle_interpret_ice_udp_transport(), jingle_new(), jingle_outgoing_hook(), jingle_request(), process_ice_attributes(), process_ice_auth_attrb(), process_sdp_a_ice(), set_ice_components(), and start_ice().
void ast_rtp_instance_get_incoming_source_address | ( | struct ast_rtp_instance * | instance, |
struct ast_sockaddr * | address | ||
) |
Get the incoming source address of the remote endpoint.
This returns the remote address the engine is sending RTP to. Usually this will be the same as the requested target address, however in the case where the engine "learns" the address (for instance, symmetric RTP enabled) this will then contain the learned address.
instance | The instance that we want to get the incoming source address for |
address | A structure to put the address into |
Definition at line 665 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_copy(), and ast_rtp_instance::incoming_source_address.
int ast_rtp_instance_get_keepalive | ( | struct ast_rtp_instance * | instance | ) |
Get the RTP keepalive interval.
instance | The RTP instance |
period | Keepalive interval value |
Example usage:
This gets the RTP keepalive interval value for the RTP instance pointed to by 'instance'.
Definition at line 2695 of file rtp_engine.c.
References ast_rtp_instance::keepalive.
Referenced by check_rtp_timeout(), and send_keepalive().
time_t ast_rtp_instance_get_last_rx | ( | const struct ast_rtp_instance * | rtp | ) |
Definition at line 3768 of file rtp_engine.c.
References ast_rtp_instance::last_rx.
Referenced by rtp_check_timeout().
time_t ast_rtp_instance_get_last_tx | ( | const struct ast_rtp_instance * | rtp | ) |
Get the last RTP transmission time.
rtp | The instance from which to get the last transmission time |
Definition at line 3758 of file rtp_engine.c.
References ast_rtp_instance::last_tx.
Referenced by send_keepalive().
void ast_rtp_instance_get_local_address | ( | struct ast_rtp_instance * | instance, |
struct ast_sockaddr * | address | ||
) |
Get the local address that we are expecting RTP on.
instance | The RTP instance to get the address from |
address | The variable to store the address in |
Example usage:
This gets the local address that we are expecting RTP on and stores it in the 'address' structure.
Definition at line 643 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_copy(), and ast_rtp_instance::local_address.
Referenced by add_sdp(), ast_rtp_ice_turn_request(), ast_rtp_prop_set(), ast_rtp_remote_address_set(), channel_read_rtp(), configure_local_rtp(), create_outgoing_sdp_stream(), get_our_media_address(), handle_open_receive_channel_ack_message(), multicast_send_control_packet(), send_start_rtp(), sip_acf_channel_read(), sip_allow_anyrtp_remote(), skinny_set_rtp_peer(), test_init_rtp_instances(), unicast_rtp_request(), and unistim_set_rtp_peer().
int ast_rtp_instance_get_prop | ( | struct ast_rtp_instance * | instance, |
enum ast_rtp_property | property | ||
) |
Get the value of an RTP instance property.
instance | The RTP instance to get the property from |
property | The property to get |
Current | value of the property |
Example usage:
This returns the current value of the NAT property on the instance pointed to by instance.
Definition at line 716 of file rtp_engine.c.
References ao2_lock, ao2_unlock, and ast_rtp_instance::properties.
Referenced by ast_rtcp_interpret(), ast_rtp_dtmf_compatible(), ast_rtp_read(), bridge_p2p_rtp_write(), process_dtmf_cisco(), process_dtmf_rfc2833(), rtp_raw_write(), and rtp_write_rtcp_psfb().
char* ast_rtp_instance_get_quality | ( | struct ast_rtp_instance * | instance, |
enum ast_rtp_instance_stat_field | field, | ||
char * | buf, | ||
size_t | size | ||
) |
Retrieve quality statistics about an RTP instance.
instance | Instance to get statistics on |
field | What quality statistic to retrieve |
buf | What buffer to put the result into |
size | Size of the above buffer |
non-NULL | success |
NULL | failure |
Example usage:
This retrieves general quality statistics and places a text representation into the buf pointed to by buf.
Definition at line 2460 of file rtp_engine.c.
References ast_rtp_instance_get_stats(), AST_RTP_INSTANCE_STAT_ALL, AST_RTP_INSTANCE_STAT_COMBINED_JITTER, AST_RTP_INSTANCE_STAT_COMBINED_LOSS, AST_RTP_INSTANCE_STAT_COMBINED_RTT, AST_RTP_INSTANCE_STAT_FIELD_QUALITY, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_JITTER, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_LOSS, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_RTT, buf, 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, 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::rxploss, ast_rtp_instance_stats::stdevrtt, ast_rtp_instance_stats::txcount, ast_rtp_instance_stats::txjitter, and ast_rtp_instance_stats::txploss.
Referenced by ast_rtp_instance_set_stats_vars(), channel_read_rtcp(), handle_request_bye(), sip_acf_channel_read(), and sip_hangup().
void ast_rtp_instance_get_requested_target_address | ( | struct ast_rtp_instance * | instance, |
struct ast_sockaddr * | address | ||
) |
Get the requested target address of the remote endpoint.
This returns the explicitly set address of a remote endpoint. Meaning this won't change unless specifically told to change. In most cases this should be the same as the incoming source address, except in cases where the engine "learns" the address in which case this and the incoming source address might differ.
instance | The instance that we want to get the requested target address for |
address | A structure to put the address into |
Definition at line 673 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_copy(), and ast_rtp_instance::requested_target_address.
Referenced by ast_rtp_read(), handle_response_invite(), and sip_allow_anyrtp_remote().
struct ast_srtp* ast_rtp_instance_get_srtp | ( | struct ast_rtp_instance * | instance, |
int | rtcp | ||
) |
Obtain the SRTP instance associated with an RTP instance.
instance | the RTP instance |
rtcp | 1 to request instance for RTCP |
the | SRTP instance on success |
NULL | if no SRTP instance exists |
Definition at line 2763 of file rtp_engine.c.
References ast_rtp_instance::rtcp_srtp, and ast_rtp_instance::srtp.
Referenced by __rtp_sendto(), ast_rtcp_read(), ast_rtp_change_source(), and ast_rtp_read().
unsigned int ast_rtp_instance_get_ssrc | ( | struct ast_rtp_instance * | rtp | ) |
Retrieve the local SSRC value that we will be using.
rtp | The RTP instance |
Definition at line 3778 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::ssrc_get.
Referenced by add_ssrc_to_stream(), ast_srtp_unprotect(), create_outgoing_sdp_stream(), and rtcp_debug_test_addr().
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.
instance | Instance to get statistics on |
stats | Structure to put results into |
stat | What statistic(s) to retrieve |
0 | success |
-1 | failure |
Example usage:
This retrieves all statistics the underlying RTP engine supports and puts the values into the stats structure.
Definition at line 2446 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::get_stat.
Referenced by ast_rtp_instance_get_quality(), ast_rtp_instance_get_stats_all_json(), ast_sip_session_media_stats_save(), ast_srtp_unprotect(), AST_TEST_DEFINE(), channel_read_rtcp(), cli_channelstats_print_body(), crypto_activate(), process_ssrc_attributes(), show_chanstats_cb(), and sip_acf_channel_read().
struct ast_rtp_engine_test* ast_rtp_instance_get_test | ( | struct ast_rtp_instance * | instance | ) |
Obtain a pointer to the test callbacks on an RTP instance.
instance | the RTP instance |
test | callbacks if present |
NULL | if not present |
Definition at line 2901 of file rtp_engine.c.
References ast_rtp_instance::engine, and ast_rtp_engine::test.
Referenced by __rtp_recvfrom(), ast_rtcp_interpret(), ast_rtp_instance_drop_packets(), ast_rtp_instance_get_recv_buffer_count(), ast_rtp_instance_get_recv_buffer_max(), ast_rtp_instance_get_sdes_received(), ast_rtp_instance_get_send_buffer_count(), ast_rtp_instance_queue_report(), ast_rtp_instance_reset_test_engine(), ast_rtp_instance_set_schedid(), and rtp_raw_write().
int ast_rtp_instance_get_timeout | ( | struct ast_rtp_instance * | instance | ) |
Get the RTP timeout value.
instance | The RTP instance |
timeout | value |
Example usage:
This gets the RTP timeout value for the RTP instance pointed to by 'instance'.
Definition at line 2685 of file rtp_engine.c.
References ast_rtp_instance::timeout.
Referenced by apply_negotiated_sdp_stream(), check_rtp_timeout(), and rtp_check_timeout().
int ast_rtp_instance_make_compatible | ( | struct ast_channel * | chan, |
struct ast_rtp_instance * | instance, | ||
struct ast_channel * | peer | ||
) |
Request that the underlying RTP engine make two RTP instances compatible with eachother.
chan | Our own Asterisk channel |
instance | The first RTP instance |
peer | The peer Asterisk channel |
0 | success |
-1 | failure |
Example usage:
This makes the RTP instance for 'peer' compatible with 'instance' and vice versa.
Definition at line 2589 of file rtp_engine.c.
References ao2_ref, ast_channel_lock, ast_channel_tech(), ast_channel_unlock, ast_log, ast_rtp_instance_get_glue(), ast_rtp_instance::engine, ast_rtp_glue::get_rtp_info, LOG_ERROR, ast_rtp_engine::make_compatible, NULL, type, and ast_rtp_glue::type.
struct ast_rtp_instance* ast_rtp_instance_new | ( | const char * | engine_name, |
struct ast_sched_context * | sched, | ||
const struct ast_sockaddr * | sa, | ||
void * | data | ||
) |
Create a new RTP instance.
engine_name | Name of the engine to use for the RTP instance |
sched | Scheduler context that the RTP engine may want to use |
sa | Address we want to bind to |
data | Unique data for the engine |
non-NULL | success |
NULL | failure |
Example usage:
This creates a new RTP instance using the default engine and asks the RTP engine to bind to the address given in the address structure.
Definition at line 465 of file rtp_engine.c.
References ao2_alloc, ao2_lock, ao2_ref, ao2_unlock, ast_debug, ast_log, ast_module_running_ref, ast_module_unref, ast_rtp_codecs_payloads_initialize(), AST_RWLIST_FIRST, AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, ast_sockaddr_copy(), ast_strlen_zero, AST_VECTOR_INIT, ast_rtp_instance::codecs, ast_rtp_instance::engine, instance_destructor(), ast_rtp_instance::local_address, LOG_ERROR, ast_rtp_engine::mod, ast_rtp_engine::name, ast_rtp_engine::new, and NULL.
Referenced by AST_TEST_DEFINE(), configure_local_rtp(), create_rtp(), dialog_initialize_rtp(), jingle_alloc(), jingle_enable_video(), multicast_rtp_request(), start_rtp(), test_init_rtp_instances(), and unicast_rtp_request().
struct ast_frame* ast_rtp_instance_read | ( | struct ast_rtp_instance * | instance, |
int | rtcp | ||
) |
Receive a frame over RTP.
instance | The RTP instance to receive frame on |
rtcp | Whether to read in RTCP or not |
non-NULL | success |
NULL | failure |
Example usage:
This asks the RTP engine to read in RTP from the instance and return it as an Asterisk frame.
Definition at line 578 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::read.
Referenced by AST_TEST_DEFINE(), jingle_read(), media_session_rtcp_read_callback(), media_session_rtp_read_callback(), mgcp_rtp_read(), ooh323_rtp_read(), rtp_read(), sip_rtp_read(), skinny_rtp_read(), test_read_frames(), and unistim_rtp_read().
int ast_rtp_instance_sendcng | ( | struct ast_rtp_instance * | instance, |
int | level | ||
) |
Send a comfort noise packet to the RTP instance.
instance | The RTP instance |
level | Magnitude of the noise level |
0 | Success |
non-zero | Failure |
Definition at line 2772 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::sendcng.
Referenced by check_rtp_timeout(), do_monitor(), and send_keepalive().
void ast_rtp_instance_set_bridged | ( | struct ast_rtp_instance * | instance, |
struct ast_rtp_instance * | bridged | ||
) |
Set the other RTP instance that an instance is bridged to.
instance | The RTP instance that we want to set the bridged value on |
bridged | The RTP instance they are bridged to |
Definition at line 2244 of file rtp_engine.c.
References ao2_lock, ao2_unlock, and ast_rtp_instance::bridged.
Referenced by native_rtp_bridge_start(), and native_rtp_bridge_stop().
void ast_rtp_instance_set_channel_id | ( | struct ast_rtp_instance * | instance, |
const char * | uniqueid | ||
) |
Set the channel that owns this RTP instance.
instance | The RTP instance |
uniqueid | The uniqueid of the channel |
Definition at line 553 of file rtp_engine.c.
References ast_copy_string(), and ast_rtp_instance::channel_uniqueid.
Referenced by apply_negotiated_sdp_stream(), jingle_enable_video(), jingle_set_owner(), mgcp_set_owner(), multicast_rtp_request(), set_channel_on_rtp_instance(), sip_set_owner(), skinny_set_owner(), start_rtp(), unicast_rtp_request(), and unistim_set_owner().
void ast_rtp_instance_set_data | ( | struct ast_rtp_instance * | instance, |
void * | data | ||
) |
Set the data portion of an RTP instance.
instance | The RTP instance to manipulate |
data | Pointer to data |
Example usage:
This sets the data pointer on the RTP instance pointed to by 'instance' to blob.
Definition at line 558 of file rtp_engine.c.
References ast_rtp_instance::data.
Referenced by ast_rtp_new(), multicast_rtp_new(), and test_sip_rtpqos_1_new().
void ast_rtp_instance_set_extended_prop | ( | struct ast_rtp_instance * | instance, |
int | property, | ||
void * | value | ||
) |
Set the value of an RTP instance extended property.
instance | The RTP instance to set the extended property on |
property | The extended property to set |
value | The value to set the extended property to |
Definition at line 681 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::extended_prop_set.
void ast_rtp_instance_set_hold_timeout | ( | struct ast_rtp_instance * | instance, |
int | timeout | ||
) |
Set the RTP timeout value for when the instance is on hold.
instance | The RTP instance |
timeout | Value to set the timeout to |
Example usage:
This sets the RTP hold timeout value on 'instance' to be 5000.
Definition at line 2675 of file rtp_engine.c.
References ast_rtp_instance::holdtimeout, and timeout.
Referenced by check_rtp_timeout(), and dialog_initialize_rtp().
int ast_rtp_instance_set_incoming_source_address | ( | struct ast_rtp_instance * | instance, |
const struct ast_sockaddr * | address | ||
) |
Set the incoming source address of the remote endpoint that we are sending RTP to.
This sets the incoming source address the engine is sending RTP to. Usually this will be the same as the requested target address, however in the case where the engine "learns" the address (for instance, symmetric RTP enabled) this will then contain the learned address.
instance | The RTP instance to change the address on |
address | Address to set it to |
0 | success |
-1 | failure |
Definition at line 606 of file rtp_engine.c.
References ao2_lock, ao2_unlock, and rtp_instance_set_incoming_source_address_nolock().
Referenced by ast_rtp_read().
void ast_rtp_instance_set_keepalive | ( | struct ast_rtp_instance * | instance, |
int | timeout | ||
) |
Set the RTP keepalive interval.
instance | The RTP instance |
timeout | Value to set the keepalive interval to |
Example usage:
This sets the RTP keepalive interval on 'instance' to be 5000.
Definition at line 2680 of file rtp_engine.c.
References ast_rtp_instance::keepalive.
Referenced by apply_negotiated_sdp_stream(), and dialog_initialize_rtp().
void ast_rtp_instance_set_last_rx | ( | struct ast_rtp_instance * | rtp, |
time_t | time | ||
) |
Set the last RTP reception time.
rtp | The instance on which to set the last reception time |
time | The last reception time |
Definition at line 3773 of file rtp_engine.c.
References ast_rtp_instance::last_rx.
Referenced by check_for_rtp_changes(), create_rtp(), media_session_rtcp_read_callback(), and media_session_rtp_read_callback().
void ast_rtp_instance_set_last_tx | ( | struct ast_rtp_instance * | rtp, |
time_t | time | ||
) |
Set the last RTP transmission time.
rtp | The instance on which to set the last transmission time |
time | The last transmission time |
Definition at line 3763 of file rtp_engine.c.
References ast_rtp_instance::last_tx.
Referenced by __rtp_sendto().
int ast_rtp_instance_set_local_address | ( | struct ast_rtp_instance * | instance, |
const struct ast_sockaddr * | address | ||
) |
Set the address that we are expecting to receive RTP on.
instance | The RTP instance to change the address on |
address | Address to set it to |
0 | success |
-1 | failure |
Example usage:
This changes the local address that RTP is expected on to the address given in the sin structure.
Definition at line 588 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_copy(), and ast_rtp_instance::local_address.
Referenced by ast_rtp_remote_address_set(), and rtp_allocate_transport().
void ast_rtp_instance_set_prop | ( | struct ast_rtp_instance * | instance, |
enum ast_rtp_property | property, | ||
int | value | ||
) |
Set the value of an RTP instance property.
instance | The RTP instance to set the property on |
property | The property to modify |
value | The value to set the property to |
Example usage:
This enables the AST_RTP_PROPERTY_NAT property on the instance pointed to by instance.
Definition at line 705 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::prop_set, ast_rtp_instance::properties, and value.
Referenced by ast_rtp_ice_start_media(), check_for_rtp_changes(), configure_local_rtp(), configure_rtcp(), create_addr_from_peer(), create_rtp(), dialog_initialize_rtp(), do_setnat(), enable_rtcp(), get_codecs(), handle_request_invite(), jingle_alloc(), jingle_enable_video(), pjsip_acf_dtmf_mode_write(), process_sdp(), sip_dtmfmode(), sip_set_rtp_peer(), start_rtp(), test_init_rtp_instances(), and transmit_reinvite_with_sdp().
int ast_rtp_instance_set_qos | ( | struct ast_rtp_instance * | instance, |
int | tos, | ||
int | cos, | ||
const char * | desc | ||
) |
Set QoS parameters on an RTP session.
instance | Instance to set the QoS parameters on |
tos | Terms of service value |
cos | Class of service value |
desc | What is setting the QoS values |
0 | success |
-1 | failure |
Example usage:
This sets the TOS and COS values to 0 on the instance pointed to by instance.
Definition at line 2169 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::qos.
Referenced by configure_local_rtp(), create_rtp(), dialog_initialize_rtp(), and start_rtp().
int ast_rtp_instance_set_read_format | ( | struct ast_rtp_instance * | instance, |
struct ast_format * | format | ||
) |
Request that the underlying RTP engine provide audio frames in a specific format.
instance | The RTP instance to change read format on |
format | Format that frames are wanted in |
0 | success |
-1 | failure |
Example usage:
This requests that the RTP engine provide audio frames in the ULAW format.
Definition at line 2560 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::set_read_format.
Referenced by sip_new(), and sip_setoption().
void ast_rtp_instance_set_remote_ssrc | ( | struct ast_rtp_instance * | rtp, |
unsigned int | ssrc | ||
) |
Set the remote SSRC for an RTP instance.
rtp | The RTP instance |
ssrc | The remote SSRC |
Definition at line 3821 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::set_remote_ssrc.
Referenced by process_ssrc_attributes().
int ast_rtp_instance_set_requested_target_address | ( | struct ast_rtp_instance * | instance, |
const struct ast_sockaddr * | address | ||
) |
Set the requested target address of the remote endpoint.
This should always be the address of the remote endpoint. Consequently, this can differ from the address the engine is sending RTP to. However, usually they will be the same except in some circumstances (for instance when the engine "learns" the address if symmetric RTP is enabled).
instance | The RTP instance to change the address on |
address | Address to set it to |
0 | success |
-1 | failure |
Definition at line 616 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_copy(), ast_rtp_instance::requested_target_address, and rtp_instance_set_incoming_source_address_nolock().
void ast_rtp_instance_set_stats_vars | ( | struct ast_channel * | chan, |
struct ast_rtp_instance * | instance | ||
) |
Set standard statistics from an RTP instance on a channel.
chan | Channel to set the statistics on |
instance | The RTP instance that statistics will be retrieved from |
Example usage:
This retrieves standard statistics from the RTP instance rtp and sets it on the channel pointed to by chan.
Definition at line 2500 of file rtp_engine.c.
References ast_channel_bridge_peer(), ast_channel_lock, ast_channel_lock_both, ast_channel_stage_snapshot(), ast_channel_stage_snapshot_done(), ast_channel_unlock, ast_channel_unref, AST_MAX_USER_FIELD, ast_rtp_instance_get_quality(), AST_RTP_INSTANCE_STAT_FIELD_QUALITY, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_JITTER, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_LOSS, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_RTT, pbx_builtin_setvar_helper(), and quality.
Referenced by handle_request_bye(), and sip_hangup().
void ast_rtp_instance_set_stream_num | ( | struct ast_rtp_instance * | instance, |
int | stream_num | ||
) |
Set the stream number for an RTP instance.
rtp | The RTP instance |
stream_num | The stream identifier number |
Definition at line 3830 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::set_stream_num.
Referenced by apply_negotiated_sdp_stream().
void ast_rtp_instance_set_timeout | ( | struct ast_rtp_instance * | instance, |
int | timeout | ||
) |
Set the RTP timeout value.
instance | The RTP instance |
timeout | Value to set the timeout to |
Example usage:
This sets the RTP timeout value on 'instance' to be 5000.
Definition at line 2670 of file rtp_engine.c.
References timeout, and ast_rtp_instance::timeout.
Referenced by apply_negotiated_sdp_stream(), check_rtp_timeout(), configure_local_rtp(), and dialog_initialize_rtp().
int ast_rtp_instance_set_write_format | ( | struct ast_rtp_instance * | instance, |
struct ast_format * | format | ||
) |
Tell underlying RTP engine that audio frames will be provided in a specific format.
instance | The RTP instance to change write format on |
format | Format that frames will be provided in |
0 | success |
-1 | failure |
Example usage:
This tells the underlying RTP engine that audio frames will be provided to it in ULAW format.
Definition at line 2574 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::set_read_format, and ast_rtp_engine::set_write_format.
Referenced by sip_new(), and sip_setoption().
void ast_rtp_instance_stop | ( | struct ast_rtp_instance * | instance | ) |
Stop an RTP instance.
instance | Instance that media is no longer going to at this time |
Example usage:
This tells the RTP engine being used for the instance pointed to by instance that media is no longer going to it at this time, but may in the future.
Definition at line 2183 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::stop.
Referenced by apply_negotiated_sdp_stream(), close_rtp_connection(), destroy_rtp(), jingle_session_destructor(), ooh323_destroy(), process_sdp(), stop_media_flows(), stream_stop(), and unistim_hangup_clean().
void ast_rtp_instance_stun_request | ( | struct ast_rtp_instance * | instance, |
struct ast_sockaddr * | suggestion, | ||
const char * | username | ||
) |
Request that the underlying RTP engine send a STUN BIND request.
instance | The RTP instance |
suggestion | The suggested destination |
username | Optionally a username for the request |
Example usage:
This requests that the RTP engine send a STUN BIND request on the session pointed to by 'instance'.
Definition at line 2661 of file rtp_engine.c.
References ast_rtp_instance::engine, and ast_rtp_engine::stun_request.
Referenced by jingle_interpret_google_transport().
void ast_rtp_instance_update_source | ( | struct ast_rtp_instance * | instance | ) |
Indicate that the RTP marker bit should be set on an RTP stream.
instance | Instance that the new media source is feeding into |
Example usage:
This indicates that the source of media that is feeding the instance pointed to by instance has been updated and that the marker bit should be set.
Definition at line 2151 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::update_source.
Referenced by jingle_indicate(), mgcp_indicate(), ooh323_indicate(), sip_answer(), sip_indicate(), sip_write(), and skinny_indicate().
int ast_rtp_instance_write | ( | struct ast_rtp_instance * | instance, |
struct ast_frame * | frame | ||
) |
Send a frame out over RTP.
instance | The RTP instance to send frame out on |
frame | the frame to send out |
0 | success |
-1 | failure |
Example usage:
This gives the frame pointed to by frame to the RTP engine being used for the instance and asks that it be transmitted to the current remote address set on the RTP instance.
Definition at line 568 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::write.
Referenced by AST_TEST_DEFINE(), chan_pjsip_indicate(), jingle_write(), media_session_rtp_write_callback(), mgcp_write(), ooh323_write(), rtp_write(), sip_indicate(), sip_write(), skinny_write(), test_write_frames(), and unistim_write().
char* ast_rtp_lookup_mime_multiple2 | ( | struct ast_str * | buf, |
struct ast_format_cap * | ast_format_capability, | ||
int | rtp_capability, | ||
const int | asterisk_format, | ||
enum ast_rtp_options | options | ||
) |
Convert formats into a string and put them into a buffer.
buf | Buffer to put the mime output into |
ast_format_capability | Asterisk Formats we are looking up. |
rtp_capability | RTP codes that we are looking up |
asterisk_format | Non-zero if the ast_format_capability structure is to be used, 0 if rtp_capability is to be used |
options | Additional options that may change the result |
non-NULL | success |
NULL | failure |
Example usage:
This returns the mime values for ULAW and ALAW in the buffer pointed to by buf.
Definition at line 2045 of file rtp_engine.c.
References ao2_ref, ast_format_cap_count(), ast_format_cap_get_format(), ast_rtp_lookup_mime_subtype2(), AST_RTP_MAX, ast_str_append(), ast_str_buffer(), name, and NULL.
Referenced by process_sdp().
const char* ast_rtp_lookup_mime_subtype2 | ( | const int | asterisk_format, |
const struct ast_format * | format, | ||
int | code, | ||
enum ast_rtp_options | options | ||
) |
Retrieve mime subtype information on a payload.
asterisk_format | Non-zero to look up using Asterisk format |
format | Asterisk format to look up |
code | RTP code to look up |
options | Additional options that may change the result |
Mime | subtype success |
NULL | failure |
Example usage:
This looks up the mime subtype for the ULAW format.
Definition at line 1992 of file rtp_engine.c.
References ast_format_cmp(), AST_FORMAT_CMP_EQUAL, AST_FORMAT_CMP_NOT_EQUAL, ast_format_g726_aal2, ast_rtp_mime_types, AST_RTP_OPT_G726_NONSTANDARD, ast_rwlock_rdlock, ast_rwlock_unlock, mime_types_len, ast_rtp_mime_type::payload_type, ast_rtp_payload_type::rtp_code, and ast_rtp_mime_type::subtype.
Referenced by add_codec_to_sdp(), add_noncodec_to_sdp(), add_sdp(), add_tcodec_to_sdp(), add_vcodec_to_sdp(), ast_rtp_lookup_mime_multiple2(), generate_rtpmap_attr(), jingle_add_payloads_to_description(), transmit_connect(), transmit_connect_with_sdp(), transmit_modify_request(), and transmit_modify_with_sdp().
unsigned int ast_rtp_lookup_sample_rate2 | ( | int | asterisk_format, |
const struct ast_format * | format, | ||
int | code | ||
) |
Get the sample rate associated with known RTP payload types.
asterisk_format | True if the value in format is to be used. |
format | An asterisk format |
code | from AST_RTP list |
Definition at line 2022 of file rtp_engine.c.
References ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_rtp_mime_types, ast_rwlock_rdlock, ast_rwlock_unlock, mime_types_len, ast_rtp_mime_type::payload_type, ast_rtp_payload_type::rtp_code, and ast_rtp_mime_type::sample_rate.
Referenced by add_codec_to_sdp(), add_noncodec_to_sdp(), add_tcodec_to_sdp(), add_vcodec_to_sdp(), generate_rtpmap_attr(), and jingle_add_payloads_to_description().
void ast_rtp_publish_rtcp_message | ( | struct ast_rtp_instance * | rtp, |
struct stasis_message_type * | message_type, | ||
struct ast_rtp_rtcp_report * | report, | ||
struct ast_json * | blob | ||
) |
Publish an RTCP message to Stasis Message Bus API.
rtp | The rtp instance object |
message_type | The RTP message type to publish |
report | The RTCP report object to publish. This should be an ao2 ref counted object. This routine will increase the reference count of the object. |
blob | Additional JSON objects to publish along with the RTCP information |
Definition at line 3485 of file rtp_engine.c.
References ao2_alloc, ao2_cleanup, ao2_ref, ast_channel_snapshot_get_latest(), ast_json_ref(), ast_rtp_rtcp_received_type(), ast_rtp_rtcp_sent_type(), ast_rtp_topic(), ast_strlen_zero, ast_rtp_instance::channel_uniqueid, NULL, RAII_VAR, rtcp_message_payload_dtor(), rtcp_report_to_ami(), rtcp_report_to_json(), stasis_message_create(), STASIS_MESSAGE_TYPE_DEFN(), stasis_publish(), and to_ami().
Referenced by ast_rtcp_calculate_sr_rr_statistics(), and ast_rtcp_interpret().
int ast_rtp_red_buffer | ( | struct ast_rtp_instance * | instance, |
struct ast_frame * | frame | ||
) |
Buffer a frame in an RTP instance for RED.
instance | The instance to buffer the frame on |
frame | Frame that we want to buffer |
0 | success |
-1 | failure |
Definition at line 2432 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::red_buffer.
Referenced by sip_write().
int ast_rtp_red_init | ( | struct ast_rtp_instance * | instance, |
int | buffer_time, | ||
int * | payloads, | ||
int | generations | ||
) |
Initialize RED support on an RTP instance.
instance | The instance to initialize RED support on |
buffer_time | How long to buffer before sending |
payloads | Payload values |
generations | Number of generations |
0 | success |
-1 | failure |
Definition at line 2418 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::red_init.
Referenced by process_sdp().
struct ast_rtp_rtcp_report* ast_rtp_rtcp_report_alloc | ( | unsigned int | report_blocks | ) |
Allocate an ao2 ref counted instance of ast_rtp_rtcp_report.
report_blocks | The number of report blocks to allocate |
An | ao2 ref counted ast_rtp_rtcp_report object on success |
NULL | on error |
Definition at line 3474 of file rtp_engine.c.
References ao2_alloc, and rtp_rtcp_report_dtor().
Referenced by ast_rtcp_interpret(), ast_rtcp_write(), ast_rtp_read(), rtp_write_rtcp_fir(), and rtp_write_rtcp_psfb().
|
static |
Definition at line 1624 of file rtp_engine.c.
References ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, AST_RTP_MAX_PT, ast_rtp_payload_type::payload, and ast_rtp_payload_type::rtp_code.
Referenced by ast_rtp_codecs_payload_code_tx(), and rtp_codecs_assign_payload_code_rx().
|
static |
Definition at line 1701 of file rtp_engine.c.
References ast_option_rtpptdynamic, ast_option_rtpusedynamic, AST_RTP_MAX_PT, AST_RTP_PT_FIRST_DYNAMIC, AST_RTP_PT_LAST_REASSIGN, AST_RTP_PT_LAST_STATIC, find_unused_payload_in_range(), sip_to_pjsip::ignore(), and MAX.
Referenced by add_static_payload(), and rtp_codecs_assign_payload_code_rx().
|
static |
Definition at line 1667 of file rtp_engine.c.
References AST_VECTOR_GET, AST_VECTOR_SIZE, end, and type.
Referenced by find_unused_payload().
|
static |
Definition at line 423 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_debug, ast_module_unref, ast_rtp_codecs_payloads_destroy(), AST_VECTOR_FREE, ast_rtp_instance::codecs, ast_rtp_instance::data, ast_srtp_res::destroy, ast_rtp_engine::destroy, ast_rtp_instance::engine, ast_rtp_engine::mod, ast_rtp_instance::rtcp_srtp, and ast_rtp_instance::srtp.
Referenced by ast_rtp_instance_new().
|
static |
Definition at line 1022 of file rtp_engine.c.
References ao2_bump, ao2_ref, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_rtp_engine_alloc_payload_type(), ast_tvnow(), AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_payload_type::format, 10aedae86a32_add_outgoing_enum_va::new_type, ast_rtp_payload_type::primary_mapping, ast_rtp_payload_type::rtp_code, and ast_rtp_payload_type::when_retired.
Referenced by rtp_codecs_payload_replace_rx().
|
static |
Definition at line 1144 of file rtp_engine.c.
References ast_format_get_codec_id(), AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_payload_type::format, ast_rtp_payload_type::payload, and ast_rtp_payload_type::rtp_code.
Referenced by ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_set_m_type(), and ast_rtp_codecs_payloads_set_rtpmap_type_rate().
|
static |
Definition at line 3288 of file rtp_engine.c.
References ao2_cleanup, ast_json_unref(), rtcp_message_payload::blob, rtcp_message_payload::report, and rtcp_message_payload::snapshot.
Referenced by ast_rtp_publish_rtcp_message().
|
static |
Definition at line 3297 of file rtp_engine.c.
References AS_OR, ast_free, ast_json_object_get(), ast_json_real_get(), ast_json_string_get(), ast_manager_build_channel_state_string(), ast_manager_event_blob_create(), ast_rtp_rtcp_received_type(), AST_RTP_RTCP_SR, ast_str_append(), ast_str_buffer(), ast_str_create, rtcp_message_payload::blob, ast_rtp_rtcp_report_block::dlsr, EVENT_FLAG_REPORTING, ast_rtp_rtcp_report_block::fraction, ast_rtp_rtcp_report_block::highest_seq_no, ast_rtp_rtcp_report_block::ia_jitter, ast_rtp_rtcp_report_block::lost_count, ast_rtp_rtcp_report_block::lsr, ast_rtp_rtcp_report::ntp_timestamp, NULL, ast_rtp_rtcp_report::octet_count, ast_rtp_rtcp_report::packet_count, ast_rtp_rtcp_report_block::packets, RAII_VAR, ast_rtp_rtcp_report::reception_report_count, rtcp_message_payload::report, ast_rtp_rtcp_report::report_block, ast_rtp_rtcp_report::rtp_timestamp, ast_rtp_rtcp_report::sender_information, rtcp_message_payload::snapshot, ast_rtp_rtcp_report_block::source_ssrc, ast_rtp_rtcp_report::ssrc, stasis_message_data(), stasis_message_type(), type, and ast_rtp_rtcp_report::type.
Referenced by ast_rtp_publish_rtcp_message().
|
static |
Definition at line 3387 of file rtp_engine.c.
References ast_channel_snapshot_to_json(), ast_json_array_append(), ast_json_array_create(), ast_json_null(), ast_json_pack(), ast_json_unref(), AST_RTP_RTCP_SR, rtcp_message_payload::blob, ast_rtp_rtcp_report_block::dlsr, ast_rtp_rtcp_report_block::fraction, ast_rtp_rtcp_report_block::highest_seq_no, ast_rtp_rtcp_report_block::ia_jitter, ast_rtp_rtcp_report_block::lost_count, ast_rtp_rtcp_report_block::lsr, ast_rtp_rtcp_report::ntp_timestamp, NULL, ast_rtp_rtcp_report::octet_count, ast_rtp_rtcp_report::packet_count, ast_rtp_rtcp_report_block::packets, ast_rtp_rtcp_report::reception_report_count, rtcp_message_payload::report, ast_rtp_rtcp_report::report_block, ast_rtp_rtcp_report::rtp_timestamp, ast_rtp_rtcp_report::sender_information, rtcp_message_payload::snapshot, ast_rtp_rtcp_report_block::source_ssrc, ast_rtp_rtcp_report::ssrc, stasis_message_data(), and ast_rtp_rtcp_report::type.
Referenced by ast_rtp_publish_rtcp_message().
|
static |
Definition at line 1815 of file rtp_engine.c.
References ao2_ref, ast_format_get_name(), ast_log, ast_option_rtpusedynamic, AST_RTP_PT_FIRST_DYNAMIC, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_codecs::codecs_lock, find_static_payload_type(), find_unused_payload(), LOG_WARNING, 10aedae86a32_add_outgoing_enum_va::new_type, ast_rtp_payload_type::payload, rtp_codecs_find_non_primary_dynamic_rx(), rtp_codecs_payload_replace_rx(), and rtp_payload_type_alloc().
Referenced by ast_rtp_codecs_payload_code(), and ast_rtp_codecs_payload_set_rx().
|
static |
Definition at line 1778 of file rtp_engine.c.
References AST_RTP_PT_FIRST_DYNAMIC, ast_tvdiff_ms(), AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::primary_mapping, type, and ast_rtp_payload_type::when_retired.
Referenced by rtp_codecs_assign_payload_code_rx().
|
static |
Definition at line 1079 of file rtp_engine.c.
References ao2_ref, ao2_t_cleanup, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, and payload_mapping_rx_clear_primary().
Referenced by ast_rtp_codecs_payloads_xover(), rtp_codecs_assign_payload_code_rx(), and rtp_codecs_payloads_copy_rx().
|
static |
Definition at line 1108 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_debug, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_instance::engine, ast_rtp_payload_type::format, ast_rtp_engine::payload_set, ast_rtp_payload_type::rtp_code, rtp_codecs_payload_replace_rx(), and type.
Referenced by ast_rtp_codecs_payloads_copy().
|
static |
Definition at line 1193 of file rtp_engine.c.
References ao2_lock, ao2_ref, ao2_t_cleanup, ao2_unlock, ast_debug, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, ast_rtp_payload_type::asterisk_format, ast_rtp_instance::engine, ast_rtp_payload_type::format, ast_rtp_engine::payload_set, ast_rtp_payload_type::rtp_code, and type.
Referenced by ast_rtp_codecs_payloads_copy().
|
static |
Definition at line 2918 of file rtp_engine.c.
References ast_rtp_engine_dtls::active, ao2_lock, ao2_unlock, ast_rtp_engine::dtls, and ast_rtp_instance::engine.
|
static |
Definition at line 2942 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::get_connection.
|
static |
Definition at line 2988 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::get_fingerprint.
|
static |
Definition at line 2978 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::get_fingerprint_hash.
|
static |
Definition at line 2952 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::get_setup.
|
static |
Definition at line 2935 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::reset.
|
static |
Definition at line 2907 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::set_configuration.
|
static |
Definition at line 2970 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::set_fingerprint.
|
static |
Definition at line 2962 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::set_setup.
|
static |
Definition at line 2928 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine::dtls, ast_rtp_instance::engine, and ast_rtp_engine_dtls::stop.
|
static |
Definition at line 3149 of file rtp_engine.c.
References ao2_cleanup, and ast_rtp_mime_types.
Referenced by ast_rtp_engine_unload_format(), and rtp_engine_shutdown().
|
static |
Definition at line 3585 of file rtp_engine.c.
References ao2_cleanup, ast_debug_category_unregister(), AST_LOG_CATEGORY_DTLS, AST_LOG_CATEGORY_DTLS_PACKET, AST_LOG_CATEGORY_ICE, AST_LOG_CATEGORY_RTCP, AST_LOG_CATEGORY_RTCP_PACKET, AST_LOG_CATEGORY_RTP, AST_LOG_CATEGORY_RTP_PACKET, AST_RTP_MAX_PT, ast_rtp_mime_types, ast_rtp_rtcp_received_type(), ast_rtp_rtcp_sent_type(), ast_rwlock_unlock, ast_rwlock_wrlock, mime_types_len, NULL, rtp_engine_mime_type_cleanup(), and STASIS_MESSAGE_TYPE_CLEANUP.
Referenced by ast_rtp_engine_init().
|
static |
Helper function which negotiates two RTP extension directions to get our current direction.
Definition at line 790 of file rtp_engine.c.
References AST_RTP_EXTENSION_DIRECTION_INACTIVE, AST_RTP_EXTENSION_DIRECTION_NONE, AST_RTP_EXTENSION_DIRECTION_RECVONLY, AST_RTP_EXTENSION_DIRECTION_SENDONLY, and AST_RTP_EXTENSION_DIRECTION_SENDRECV.
Referenced by ast_rtp_instance_extmap_negotiate().
|
static |
Definition at line 2793 of file rtp_engine.c.
References ast_rtp_engine_ice::add_remote_candidate, ao2_lock, ao2_unlock, ast_rtp_instance::engine, and ast_rtp_engine::ice.
|
static |
Definition at line 2869 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_engine_ice::change_components, ast_rtp_instance::engine, and ast_rtp_engine::ice.
|
static |
Definition at line 2834 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine_ice::get_local_candidates, and ast_rtp_engine::ice.
|
static |
Definition at line 2824 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine_ice::get_password, ast_rtp_engine::ice, and password.
|
static |
Definition at line 2814 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine_ice::get_ufrag, and ast_rtp_engine::ice.
|
static |
Definition at line 2844 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::ice, and ast_rtp_engine_ice::ice_lite.
|
static |
Definition at line 2786 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::ice, and ast_rtp_engine_ice::set_authentication.
|
static |
Definition at line 2851 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::ice, and ast_rtp_engine_ice::set_role.
|
static |
Definition at line 2800 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::ice, and ast_rtp_engine_ice::start.
|
static |
Definition at line 2807 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::ice, and ast_rtp_engine_ice::stop.
|
static |
Definition at line 2859 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_instance::engine, ast_rtp_engine::ice, and ast_rtp_engine_ice::turn_request.
|
static |
Definition at line 597 of file rtp_engine.c.
References ast_sockaddr_copy(), ast_rtp_instance::engine, ast_rtp_instance::incoming_source_address, and ast_rtp_engine::remote_address_set.
Referenced by ast_rtp_instance_set_incoming_source_address(), and ast_rtp_instance_set_requested_target_address().
|
static |
Definition at line 306 of file rtp_engine.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ast_rtp_payload_type::asterisk_format, ast_rtp_payload_type::format, NULL, ast_rtp_payload_type::payload, ast_rtp_payload_type::primary_mapping, ast_rtp_payload_type::rtp_code, rtp_payload_type_dtor(), and type.
Referenced by add_static_payload(), ast_rtp_engine_alloc_payload_type(), and rtp_codecs_assign_payload_code_rx().
|
static |
Definition at line 299 of file rtp_engine.c.
References ao2_cleanup, ast_rtp_payload_type::format, and ast_rtp_payload_type::payload.
Referenced by rtp_payload_type_alloc().
|
static |
Definition at line 3464 of file rtp_engine.c.
References ast_free, ast_rtp_rtcp_report::reception_report_count, and ast_rtp_rtcp_report::report_block.
Referenced by ast_rtp_rtcp_report_alloc().
|
static |
Definition at line 3155 of file rtp_engine.c.
References ao2_bump, ARRAY_LEN, ast_copy_string(), ast_rtp_mime_types, ast_rwlock_unlock, ast_rwlock_wrlock, ast_rtp_payload_type::asterisk_format, ast_rtp_payload_type::format, mime_types_len, ast_rtp_mime_type::payload_type, ast_rtp_payload_type::rtp_code, and ast_rtp_mime_type::sample_rate.
Referenced by ast_rtp_engine_init(), and ast_rtp_engine_load_format().
STASIS_MESSAGE_TYPE_DEFN | ( | ast_rtp_rtcp_sent_type | , |
. | to_ami = rtcp_report_to_ami , |
||
. | to_json = rtcp_report_to_json |
||
) |
Define RTCP/RTP message types.
Referenced by ast_rtp_publish_rtcp_message().
STASIS_MESSAGE_TYPE_DEFN | ( | ast_rtp_rtcp_received_type | , |
. | to_ami = rtcp_report_to_ami , |
||
. | to_json = rtcp_report_to_json |
||
) |
|
static |
Conditionally unref an rtp instance.
Definition at line 2226 of file rtp_engine.c.
Referenced by ast_rtp_instance_early_bridge(), and ast_rtp_instance_early_bridge_make_compatible().
|
static |
|
static |
Definition at line 3564 of file rtp_engine.c.
Referenced by ast_debug_category_dtls_id(), and ast_rtp_engine_init().
|
static |
Definition at line 3571 of file rtp_engine.c.
Referenced by ast_debug_category_dtls_packet_id(), and ast_rtp_engine_init().
|
static |
Definition at line 3578 of file rtp_engine.c.
Referenced by ast_debug_category_ice_id(), and ast_rtp_engine_init().
|
static |
Definition at line 3550 of file rtp_engine.c.
Referenced by ast_debug_category_rtcp_id(), and ast_rtp_engine_init().
|
static |
Definition at line 3557 of file rtp_engine.c.
Referenced by ast_debug_category_rtcp_packet_id(), and ast_rtp_engine_init().
|
static |
Definition at line 3536 of file rtp_engine.c.
Referenced by ast_debug_category_rtp_id(), and ast_rtp_engine_init().
|
static |
Definition at line 3543 of file rtp_engine.c.
Referenced by ast_debug_category_rtp_packet_id(), and ast_rtp_engine_init().
|
static |
|
static |
|
static |
Definition at line 262 of file rtp_engine.c.
Referenced by ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_engine_unload_format(), ast_rtp_lookup_mime_subtype2(), ast_rtp_lookup_sample_rate2(), rtp_engine_shutdown(), and set_next_mime_type().
|
static |
Definition at line 261 of file rtp_engine.c.
struct ast_srtp_res* res_srtp = NULL |
Definition at line 177 of file rtp_engine.c.
struct ast_srtp_policy_res* res_srtp_policy = NULL |
Definition at line 178 of file rtp_engine.c.
Referenced by ast_rtp_engine_srtp_is_registered().
|
static |
Definition at line 2998 of file rtp_engine.c.
Referenced by ast_rtp_instance_get_dtls().
|
static |
URIs for known RTP extensions.
Definition at line 235 of file rtp_engine.c.
Referenced by ast_rtp_instance_extmap_get_uri(), and ast_rtp_instance_extmap_negotiate().
|
static |
Definition at line 2877 of file rtp_engine.c.
Referenced by ast_rtp_instance_get_ice().
|
static |
Stasis Message Bus API topic for RTP related messages
Definition at line 278 of file rtp_engine.c.
Referenced by ast_rtp_topic().
|
static |
Mapping between Asterisk codecs and rtp payload types.
Static (i.e., well-known) RTP payload types for our "AST_FORMAT..."s: also, our own choices for dynamic payload types. This is our master table for transmission
See http://www.iana.org/assignments/rtp-parameters for a list of assigned values
Definition at line 274 of file rtp_engine.c.
|
static |
Definition at line 275 of file rtp_engine.c.