Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
Pluggable RTP Architecture. More...
#include "asterisk.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... | |
int | ast_rtp_codecs_get_preferred_dtmf_format_pt (struct ast_rtp_codecs *codecs) |
Retrieve rx preferred dtmf format payload type. More... | |
int | ast_rtp_codecs_get_preferred_dtmf_format_rate (struct ast_rtp_codecs *codecs) |
Retrieve rx preferred dtmf format sample rate. More... | |
struct ast_format * | ast_rtp_codecs_get_preferred_format (struct ast_rtp_codecs *codecs) |
Retrieve rx preferred format. 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_sample_rate (struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code, unsigned int sample_rate) |
Retrieve a rx mapped payload type based on whether it is an Asterisk format, the code and the sample rate. 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... | |
int | ast_rtp_codecs_payload_code_tx_sample_rate (struct ast_rtp_codecs *codecs, int asterisk_format, const struct ast_format *format, int code, unsigned int sample_rate) |
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... | |
int | ast_rtp_codecs_payload_set_rx_sample_rate (struct ast_rtp_codecs *codecs, int code, struct ast_format *format, unsigned int sample_rate) |
Set a payload code with sample rate 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... | |
int | ast_rtp_codecs_set_preferred_dtmf_format (struct ast_rtp_codecs *codecs, int pt, int rate) |
Set the preferred dtmf format pt and sample rate. More... | |
int | ast_rtp_codecs_set_preferred_format (struct ast_rtp_codecs *codecs, struct ast_format *format) |
Set the preferred format. 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... | |
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) |
Get the last RTP reception time. More... | |
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... | |
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... | |
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... | |
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... | |
struct ast_frame * | ast_rtp_instance_read (struct ast_rtp_instance *instance, int rtcp) |
Receive a frame over RTP. 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_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... | |
int | ast_rtp_payload_mapping_tx_is_present (struct ast_rtp_codecs *codecs, const struct ast_rtp_payload_type *to_match) |
Determine if a type of payload is already present in mappings. 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, unsigned int sample_rate) |
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_payload_set_rx (struct ast_rtp_codecs *codecs, int payload, struct ast_rtp_payload_type *new_type, int replace) |
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_atexit (void) |
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, unsigned int sample_rate) |
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_received_type,.to_ami=rtcp_report_to_ami,.to_json=rtcp_report_to_json,) | |
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... | |
Pluggable RTP Architecture.
Definition in file rtp_engine.c.
#define MAX_RTP_MIME_TYPES 128 |
Definition at line 246 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 287 of file rtp_engine.c.
|
static |
Definition at line 3383 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(), ast_rtp_payload_type::format, LOG_WARNING, NULL, ast_rtp_payload_type::payload, ast_rtp_payload_type::rtp_code, rtp_payload_type_alloc(), static_RTP_PT, static_RTP_PT_lock, and type.
Referenced by ast_rtp_engine_init(), and ast_rtp_engine_load_format().
uintmax_t ast_debug_category_dtls_id | ( | void | ) |
uintmax_t ast_debug_category_dtls_packet_id | ( | void | ) |
Definition at line 3778 of file rtp_engine.c.
References debug_category_dtls_packet_id.
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 | ) |
Definition at line 3764 of file rtp_engine.c.
References debug_category_rtcp_packet_id.
uintmax_t ast_debug_category_rtp_id | ( | void | ) |
uintmax_t ast_debug_category_rtp_packet_id | ( | void | ) |
Definition at line 3750 of file rtp_engine.c.
References debug_category_rtp_packet_id.
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 |
Example usage:
This looks for the numerical payload for ULAW in the codecs structure.
Definition at line 2151 of file rtp_engine.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, codecs, 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 |
Definition at line 1682 of file rtp_engine.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, and codecs.
Referenced by ast_rtp_write(), create_outgoing_sdp_stream(), multicast_rtp_write(), and native_rtp_bridge_compatible_check().
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 |
NULL | if payload does not exist. |
Example usage:
This looks up the information for payload '0' from the codecs structure.
Definition at line 1548 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, codecs, NULL, ast_rtp_payload_type::payload, static_RTP_PT, static_RTP_PT_lock, and type.
Referenced by ast_rtp_dtmf_begin(), 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 |
NULL | on failure |
Definition at line 1650 of file rtp_engine.c.
References ao2_bump, AST_RTP_MAX_PT, ast_rwlock_rdlock, ast_rwlock_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, codecs, NULL, and type.
Referenced by get_codecs().
int ast_rtp_codecs_get_preferred_dtmf_format_pt | ( | struct ast_rtp_codecs * | codecs | ) |
Retrieve rx preferred dtmf format payload type.
codecs | Codecs structure to look in |
-1 | if not set. |
Example usage:
This looks up the preferred dtmf format pt on the codec
Definition at line 1589 of file rtp_engine.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, and codecs.
Referenced by ast_rtp_dtmf_begin().
int ast_rtp_codecs_get_preferred_dtmf_format_rate | ( | struct ast_rtp_codecs * | codecs | ) |
Retrieve rx preferred dtmf format sample rate.
codecs | Codecs structure to look in |
-1 | if not set. |
Example usage:
This looks up the preferred dtmf format sample rate on the codec
Definition at line 1598 of file rtp_engine.c.
References ast_rwlock_rdlock, ast_rwlock_unlock, and codecs.
Referenced by ast_rtp_dtmf_begin().
struct ast_format * ast_rtp_codecs_get_preferred_format | ( | struct ast_rtp_codecs * | codecs | ) |
Retrieve rx preferred format.
codecs | Codecs structure to look in |
NULL | if format does not exist. |
Example usage:
This looks up the preferred format on the codec
Definition at line 1572 of file rtp_engine.c.
References ao2_bump, ast_rwlock_rdlock, ast_rwlock_unlock, and codecs.
Referenced by ast_rtp_dtmf_begin().
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 1529 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, codecs, 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.
-1 | if could not assign. |
Example usage:
This looks for the numerical payload for ULAW in the codecs structure.
Definition at line 2019 of file rtp_engine.c.
References ast_rtp_codecs_payload_code_sample_rate(), ast_rtp_payload_type::asterisk_format, codecs, and ast_rtp_payload_type::format.
Referenced by apply_cap_to_bundled(), create_outgoing_sdp_stream(), and jingle_add_payloads_to_description().
int ast_rtp_codecs_payload_code_sample_rate | ( | struct ast_rtp_codecs * | codecs, |
int | asterisk_format, | ||
struct ast_format * | format, | ||
int | code, | ||
unsigned int | sample_rate | ||
) |
Retrieve a rx mapped payload type based on whether it is an Asterisk format, the code and the sample rate.
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 |
sample_rate | Non-zero if we want to also match on sample rate. |
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.
-1 | if could not assign. |
Example usage:
This looks for the numerical payload for a DTMF type with a sample rate of 8kHz in the codecs structure.
Definition at line 2024 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, codecs, ast_rtp_payload_type::format, ast_rtp_payload_type::payload, rtp_codecs_assign_payload_code_rx(), ast_rtp_payload_type::sample_rate, static_RTP_PT_lock, and type.
Referenced by ast_rtp_codecs_payload_code(), and create_outgoing_sdp_stream().
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 |
-1 | if not found. |
Definition at line 2146 of file rtp_engine.c.
References ast_rtp_codecs_payload_code_tx_sample_rate(), ast_rtp_payload_type::asterisk_format, codecs, and ast_rtp_payload_type::format.
Referenced by ast_rtp_dtmf_begin(), ast_rtp_sendcng(), ast_rtp_write(), bridge_p2p_rtp_write(), multicast_rtp_write(), and send_start_rtp().
int ast_rtp_codecs_payload_code_tx_sample_rate | ( | struct ast_rtp_codecs * | codecs, |
int | asterisk_format, | ||
const struct ast_format * | format, | ||
int | code, | ||
unsigned int | sample_rate | ||
) |
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 |
sample_rate | The sample rate to look for, zero if we don't care |
-1 | if not found. |
Definition at line 2085 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, codecs, find_static_payload_type(), ast_rtp_payload_type::format, ast_rtp_payload_type::payload, ast_rtp_payload_type::sample_rate, static_RTP_PT_lock, and type.
Referenced by ast_rtp_codecs_payload_code_tx(), and ast_rtp_dtmf_begin().
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 1693 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, codecs, and type.
Referenced by jingle_interpret_description().
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 1616 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, codecs, ast_rtp_payload_type::format, ast_rtp_payload_type::payload, payload_mapping_tx_is_present(), and type.
Referenced by get_codecs().
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 2075 of file rtp_engine.c.
References codecs, ast_rtp_payload_type::format, and rtp_codecs_assign_payload_code_rx().
Referenced by apply_cap_to_bundled(), and create_outgoing_sdp_stream().
int ast_rtp_codecs_payload_set_rx_sample_rate | ( | struct ast_rtp_codecs * | codecs, |
int | code, | ||
struct ast_format * | format, | ||
unsigned int | sample_rate | ||
) |
Set a payload code with sample rate for use with a specific Asterisk format.
codecs | Codecs structure to manipulate |
code | The payload code |
format | Asterisk format |
sample_rate | Sample rate of the format, 0 to use the format's default |
0 | Payload was set to the given format |
-1 | Payload was in use or could not be set |
Definition at line 2080 of file rtp_engine.c.
References codecs, ast_rtp_payload_type::format, rtp_codecs_assign_payload_code_rx(), and ast_rtp_payload_type::sample_rate.
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 1019 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_rtp_codecs_payloads_destroy(), ast_rtp_codecs_payloads_initialize(), AST_RTP_MAX_PT, codecs, 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 1273 of file rtp_engine.c.
References ao2_replace, 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, ast_rtp_codecs::payload_mapping_tx, ast_rtp_codecs::preferred_dtmf_pt, ast_rtp_codecs::preferred_dtmf_rate, ast_rtp_codecs::preferred_format, rtp_codecs_payloads_copy_rx(), rtp_codecs_payloads_copy_tx(), and type.
Referenced by jingle_interpret_description(), 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 996 of file rtp_engine.c.
References ao2_t_cleanup, ast_rwlock_destroy, AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_SIZE, codecs, NULL, and type.
Referenced by ast_rtp_codecs_payloads_clear(), ast_stream_free(), ast_stream_set_rtp_codecs(), instance_destructor(), jingle_interpret_description(), 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 980 of file rtp_engine.c.
References AST_RTP_MAX_PT, ast_rwlock_init, AST_VECTOR_FREE, AST_VECTOR_INIT, and codecs.
Referenced by ast_rtp_codecs_payloads_clear(), ast_rtp_instance_new(), get_codecs(), and jingle_interpret_description().
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 1356 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, codecs, ast_rtp_instance::engine, 10aedae86a32_add_outgoing_enum_va::new_type, ast_rtp_payload_type::payload, payload_mapping_tx_is_present(), ast_rtp_engine::payload_set, static_RTP_PT, and static_RTP_PT_lock.
Referenced by get_codecs().
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 string 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 1484 of file rtp_engine.c.
References ast_rtp_codecs_payloads_set_rtpmap_type_rate(), codecs, options, and ast_rtp_payload_type::payload.
Referenced by configure_local_rtp(), jingle_interpret_description(), ooh323_set_write_format(), 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 1398 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, codecs, ast_rtp_instance::engine, ast_rtp_payload_type::format, mime_types_len, mime_types_lock, 10aedae86a32_add_outgoing_enum_va::new_type, options, payload_mapping_tx_is_present(), ast_rtp_engine::payload_set, ast_rtp_mime_type::payload_type, ast_rtp_payload_type::rtp_code, ast_rtp_payload_type::sample_rate, 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(), and jingle_interpret_description().
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 1489 of file rtp_engine.c.
References ao2_lock, ao2_ref, ao2_replace, ao2_unlock, ast_debug, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, AST_RTP_MAX_PT, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_REPLACE, AST_VECTOR_SIZE, codecs, ast_rtp_instance::engine, NULL, ast_rtp_payload_type::payload, ast_rtp_engine::payload_set, and type.
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 1309 of file rtp_engine.c.
References ao2_lock, ao2_replace, ao2_unlock, ast_assert, ast_debug, ast_rwlock_tryrdlock, ast_rwlock_unlock, ast_rwlock_wrlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_codecs::codecs_lock, ast_rtp_instance::engine, ast_rtp_codecs::framing, ast_rtp_codecs::payload_mapping_tx, ast_rtp_engine::payload_set, ast_rtp_codecs::preferred_dtmf_pt, ast_rtp_codecs::preferred_dtmf_rate, ast_rtp_codecs::preferred_format, rtp_codecs_payload_replace_rx(), and type.
Referenced by ast_rtp_instance_early_bridge_make_compatible(), 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 1671 of file rtp_engine.c.
References ast_rwlock_unlock, ast_rwlock_wrlock, and codecs.
Referenced by configure_local_rtp(), get_codecs(), jingle_enable_video(), and jingle_new().
int ast_rtp_codecs_set_preferred_dtmf_format | ( | struct ast_rtp_codecs * | codecs, |
int | pt, | ||
int | rate | ||
) |
Set the preferred dtmf format pt and sample rate.
codecs | Codecs structure to set the preferred format in |
pt | Preferred dtmf payload type to set. |
rate | Preferred dtmf payload rate to set. |
Example usage:
This sets the preferred dtmf_code and dtmf_rate on the codec.
Definition at line 1607 of file rtp_engine.c.
References ast_rwlock_unlock, ast_rwlock_wrlock, and codecs.
Referenced by get_codecs().
int ast_rtp_codecs_set_preferred_format | ( | struct ast_rtp_codecs * | codecs, |
struct ast_format * | format | ||
) |
Set the preferred format.
codecs | Codecs structure to set the preferred format in |
format | Preferred format to set. |
Example usage:
This sets the first joint format as the preferred format.
Definition at line 1581 of file rtp_engine.c.
References ao2_replace, ast_rwlock_unlock, ast_rwlock_wrlock, and codecs.
Referenced by set_caps().
struct ast_json * ast_rtp_convert_stats_json | ( | const struct ast_rtp_instance_stats * | stats | ) |
Convert given stat instance into json format.
stats |
Definition at line 4189 of file rtp_engine.c.
References ast_json_integer_create(), ast_json_object_create(), ast_json_object_set(), ast_json_real_create(), ast_json_string_create(), ast_json_unref(), ast_log, ast_rtp_instance_stats::channel_uniqueid, ast_rtp_instance_stats::local_maxjitter, ast_rtp_instance_stats::local_maxmes, ast_rtp_instance_stats::local_maxrxploss, ast_rtp_instance_stats::local_minjitter, ast_rtp_instance_stats::local_minmes, ast_rtp_instance_stats::local_minrxploss, ast_rtp_instance_stats::local_normdevjitter, ast_rtp_instance_stats::local_normdevmes, ast_rtp_instance_stats::local_normdevrxploss, ast_rtp_instance_stats::local_ssrc, ast_rtp_instance_stats::local_stdevjitter, ast_rtp_instance_stats::local_stdevmes, ast_rtp_instance_stats::local_stdevrxploss, LOG_WARNING, ast_rtp_instance_stats::maxrtt, ast_rtp_instance_stats::minrtt, ast_rtp_instance_stats::normdevrtt, NULL, ast_rtp_instance_stats::remote_maxjitter, ast_rtp_instance_stats::remote_maxmes, ast_rtp_instance_stats::remote_maxrxploss, ast_rtp_instance_stats::remote_minjitter, ast_rtp_instance_stats::remote_minmes, ast_rtp_instance_stats::remote_minrxploss, ast_rtp_instance_stats::remote_normdevjitter, ast_rtp_instance_stats::remote_normdevmes, ast_rtp_instance_stats::remote_normdevrxploss, ast_rtp_instance_stats::remote_ssrc, ast_rtp_instance_stats::remote_stdevjitter, ast_rtp_instance_stats::remote_stdevmes, 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::rxmes, ast_rtp_instance_stats::rxoctetcount, ast_rtp_instance_stats::rxploss, SET_AST_JSON_OBJ, ast_rtp_instance_stats::stdevrtt, ast_rtp_instance_stats::txcount, ast_rtp_instance_stats::txjitter, ast_rtp_instance_stats::txmes, ast_rtp_instance_stats::txoctetcount, and ast_rtp_instance_stats::txploss.
Referenced by ast_rtp_instance_get_stats_all_json().
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 3313 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.
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 3331 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(), and media_configuration_destroy().
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 3220 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, name, ast_rtp_dtls_cfg::pvtfile, ast_rtp_dtls_cfg::rekey, value, and ast_rtp_dtls_cfg::verify.
Referenced by dtls_handler(), and media_encryption_handler().
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 3294 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 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 |
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 3840 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_atexit(), 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, mime_types_lock, NULL, rtp_engine_atexit(), rtp_engine_shutdown(), rtp_topic, set_next_mime_type(), STASIS_MESSAGE_TYPE_INIT, stasis_topic_create(), and static_RTP_PT_lock.
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 3429 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, ast_rtp_payload_type::format, 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 2910 of file rtp_engine.c.
References policy_res, res_srtp, res_srtp_policy, and srtp_res.
Referenced by res_srtp_init().
int ast_rtp_engine_srtp_is_registered | ( | void | ) |
Definition at line 2931 of file rtp_engine.c.
References res_srtp, and res_srtp_policy.
Referenced by ast_sdp_srtp_alloc().
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 3445 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, ast_rtp_payload_type::format, mime_types_len, mime_types_lock, NULL, rtp_engine_mime_type_cleanup(), static_RTP_PT, and static_RTP_PT_lock.
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 load_module(), and unload_module().
void ast_rtp_engine_unregister_srtp | ( | void | ) |
Definition at line 2925 of file rtp_engine.c.
References NULL, res_srtp, and res_srtp_policy.
Referenced by res_srtp_shutdown().
int ast_rtp_get_rate | ( | const struct ast_format * | format | ) |
Retrieve the sample rate of a format according to RTP specifications.
format | The media format |
Definition at line 4276 of file rtp_engine.c.
References ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_g722, and ast_format_get_sample_rate().
Referenced by ast_rtcp_calculate_sr_rr_statistics(), ast_rtcp_interpret(), ast_rtp_dtmf_end_with_duration(), ast_rtp_interpret(), calc_rxstamp_and_jitter(), jitterbuffer_frame_get_ntp_timestamp(), process_dtmf_cisco(), process_dtmf_rfc2833(), rtp_raw_write(), and update_jitter_stats().
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 2847 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(), rtp_call(), and test_init_rtp_instances().
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 2936 of file rtp_engine.c.
References ast_srtp_res::add_stream, ao2_lock, ao2_unlock, ast_srtp_res::create, ast_srtp_res::replace, res_srtp, ast_rtp_instance::rtcp_srtp, and ast_rtp_instance::srtp.
Referenced by crypto_activate().
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 2833 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_format_cap_count(), ast_translate_available_formats(), ast_rtp_engine::available_formats, ast_rtp_instance::engine, and result.
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 4037 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 2336 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(), ooh323_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, ast_debug_rtp, ast_debug_rtp_is_allowed, ast_rtp_instance_get_quality(), AST_RTP_INSTANCE_STAT_FIELD_QUALITY_JITTER, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_LOSS, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_MES, AST_RTP_INSTANCE_STAT_FIELD_QUALITY_RTT, and ast_rtp_instance::channel_uniqueid.
Referenced by AST_TEST_DEFINE(), jingle_session_destructor(), multicast_rtp_request(), ooh323_destroy(), rtp_hangup(), stream_destroy(), 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 2257 of file rtp_engine.c.
References ao2_lock, ao2_unlock, digit, ast_rtp_engine::dtmf_begin, and ast_rtp_instance::engine.
Referenced by chan_pjsip_digit_begin(), jingle_digit_begin(), and ooh323_digit_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 2271 of file rtp_engine.c.
References ao2_lock, ao2_unlock, digit, ast_rtp_engine::dtmf_end, and ast_rtp_instance::engine.
Referenced by ooh323_digit_end().
int ast_rtp_instance_dtmf_end_with_duration | ( | struct ast_rtp_instance * | instance, |
char | digit, | ||
unsigned int | duration | ||
) |
Definition at line 2285 of file rtp_engine.c.
References ao2_lock, ao2_unlock, digit, ast_rtp_engine::dtmf_end_with_duration, and ast_rtp_instance::engine.
Referenced by chan_pjsip_digit_end(), and jingle_digit_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 |
Example usage:
This gets the DTMF mode set on the RTP instance pointed to by 'instance'.
Definition at line 2313 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 2299 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(), get_codecs(), and pjsip_acf_dtmf_mode_write().
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 2513 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 2427 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 884 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, rtp_extmap::extension, ast_rtp_instance::extmap_negotiated, and ast_rtp_instance::extmap_unique_ids.
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 921 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_VECTOR_SIZE, and ast_rtp_instance::extmap_unique_ids.
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 754 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, ast_rtp_engine::extension_enable, ast_rtp_instance::extmap_enabled, ast_rtp_instance::extmap_negotiated, and ast_rtp_instance::extmap_unique_ids.
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 |
Definition at line 952 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_RTP_EXTENSION_DIRECTION_NONE, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, rtp_extmap::direction, and ast_rtp_instance::extmap_unique_ids.
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 |
Definition at line 932 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_RTP_EXTENSION_UNSUPPORTED, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, rtp_extmap::extension, and ast_rtp_instance::extmap_unique_ids.
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 908 of file rtp_engine.c.
References ao2_lock, ao2_unlock, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_rtp_instance::extmap_negotiated, 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 |
Definition at line 968 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 840 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, ast_rtp_instance::extmap_enabled, ast_rtp_instance::extmap_negotiated, ast_rtp_instance::extmap_unique_ids, 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 2368 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(), jingle_enable_video(), jingle_new(), rtp_find_rtcp_fd_position(), start_rtp(), 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 |
Example:
This gets the RTP glue currently in use on the RTP instance pointed to by 'instance'.
Definition at line 2905 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 651 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 673 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 2410 of file rtp_engine.c.
References ao2_lock, ao2_unlock, and ast_rtp_instance::bridged.
Referenced by ast_rtp_interpret().
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 |
Empty | string if no channel owns this RTP instance |
Definition at line 570 of file rtp_engine.c.
References ast_rtp_instance::channel_uniqueid.
Referenced by __rtp_recvfrom(), ast_rtcp_interpret(), ast_rtp_get_stat(), ast_rtp_prop_set(), ast_rtp_stop(), ast_rtp_write(), calc_rxstamp_and_jitter(), rtp_check_timeout(), rtp_raw_write(), rtp_transport_wide_cc_feedback_produce(), update_local_mes_stats(), and update_reported_mes_stats().
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 4024 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 749 of file rtp_engine.c.
References ast_rtp_instance::codecs.
Referenced by apply_cap_to_bundled(), ast_rtp_dtmf_begin(), ast_rtp_interpret(), ast_rtp_read(), ast_rtp_sendcng(), ast_rtp_write(), bridge_p2p_rtp_write(), configure_local_rtp(), 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(), send_start_rtp(), set_caps(), set_incoming_call_offer_cap(), and setup_rtp_connection().
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 585 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_interpret(), ast_rtp_local_bridge(), 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(), multicast_rtp_activate(), multicast_rtp_destroy(), multicast_rtp_write(), process_cn_rfc3389(), process_dtmf_cisco(), process_dtmf_rfc2833(), red_write(), rtp_instance_parse_transport_wide_cc(), rtp_raw_write(), rtp_red_buffer(), rtp_red_init(), rtp_sendto(), and rtp_transport_wide_cc_feedback_produce().
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 |
NULL | if no DTLS support available |
Definition at line 3211 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_fingerprints_if_present(), apply_dtls_attrib(), ast_sdp_get_rtp_profile(), 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 |
Example usage:
This gets the RTP engine currently in use on the RTP instance pointed to by 'instance'.
Definition at line 2900 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 712 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 2382 of file rtp_engine.c.
References AST_RWLIST_RDLOCK, AST_RWLIST_TRAVERSE, AST_RWLIST_UNLOCK, NULL, type, 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 |
Example usage:
This gets the RTP hold timeout value for the RTP instance pointed to by 'instance'.
Definition at line 2890 of file rtp_engine.c.
References ast_rtp_instance::holdtimeout.
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 |
NULL | if no ICE support available |
Definition at line 3091 of file rtp_engine.c.
References ast_rtp_instance::engine, ast_rtp_engine::ice, NULL, and rtp_ice_wrappers.
Referenced by add_ice_to_stream(), check_ice_support(), create_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(), and set_ice_components().
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 687 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 |
Example usage:
This gets the RTP keepalive interval value for the RTP instance pointed to by 'instance'.
Definition at line 2895 of file rtp_engine.c.
References ast_rtp_instance::keepalive.
Referenced by send_keepalive().
time_t ast_rtp_instance_get_last_rx | ( | const struct ast_rtp_instance * | rtp | ) |
Get the last RTP reception time.
rtp | The instance from which to get the last reception time |
Definition at line 4001 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 3991 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 665 of file rtp_engine.c.
References ao2_lock, ao2_unlock, ast_sockaddr_copy(), and ast_rtp_instance::local_address.
Referenced by ast_rtp_prop_set(), ast_rtp_remote_address_set(), channel_read_rtp(), configure_local_rtp(), create_outgoing_sdp_stream(), multicast_send_control_packet(), send_start_rtp(), 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 |
Example usage:
This returns the current value of the NAT property on the instance pointed to by instance.
Definition at line 738 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 2640 of file rtp_engine.c.