Asterisk - The Open Source Telephony Project
18.5.0
|
Pluggable RTP Architecture. More...
#include "asterisk/astobj2.h"
#include "asterisk/frame.h"
#include "asterisk/format_cap.h"
#include "asterisk/netsock2.h"
#include "asterisk/sched.h"
#include "asterisk/res_srtp.h"
#include "asterisk/stasis.h"
#include "asterisk/vector.h"
#include "asterisk/logger_category.h"
Go to the source code of this file.
Data Structures | |
struct | ast_rtp_codecs |
struct | ast_rtp_dtls_cfg |
DTLS configuration structure. More... | |
struct | ast_rtp_engine |
struct | ast_rtp_engine_dtls |
Structure that represents the optional DTLS SRTP support within an RTP engine. More... | |
struct | ast_rtp_engine_ice |
Structure that represents the optional ICE support within an RTP engine. More... | |
struct | ast_rtp_engine_ice_candidate |
Structure for an ICE candidate. More... | |
struct | ast_rtp_engine_test |
Structure that represents the test functionality for res_rtp_asterisk unit tests. More... | |
struct | ast_rtp_glue |
struct | ast_rtp_instance_stats |
struct | ast_rtp_payload_type |
struct | ast_rtp_rtcp_feedback |
An object that represents data received in a feedback report. More... | |
struct | ast_rtp_rtcp_feedback_remb |
A REMB feedback message (see draft-alvestrand-rmcat-remb-03 for details) More... | |
struct | ast_rtp_rtcp_report |
An object that represents data sent during a SR/RR RTCP report. More... | |
struct | ast_rtp_rtcp_report_block |
A report block within a SR/RR report. More... | |
Functions | |
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_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 timeout) |
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 *instance, 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 stasis_message_type * | ast_rtp_rtcp_received_type (void) |
Message type for an RTCP message received from some external source. 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_message_type * | ast_rtp_rtcp_sent_type (void) |
Message type for an RTCP message sent from this Asterisk instance. More... | |
struct stasis_topic * | ast_rtp_topic (void) |
Stasis Message Bus API topic for RTP and RTCP related messages More... | |
Pluggable RTP Architecture.
Definition in file rtp_engine.h.
#define AST_RED_MAX_GENERATION 5 |
Maximum number of generations
Definition at line 98 of file rtp_engine.h.
Referenced by process_sdp_a_text().
#define AST_RTP_CISCO_DTMF (1 << 2) |
DTMF (Cisco Proprietary)
Definition at line 270 of file rtp_engine.h.
Referenced by ast_rtp_engine_init(), and ast_rtp_interpret().
#define AST_RTP_CN (1 << 1) |
'Comfort Noise' (RFC3389)
Definition at line 268 of file rtp_engine.h.
Referenced by ast_rtp_engine_init(), ast_rtp_interpret(), and ast_rtp_sendcng().
#define AST_RTP_CODECS_NULL_INIT { .codecs_lock = AST_RWLOCK_INIT_VALUE, .payload_mapping_rx = { 0, }, .payload_mapping_tx = { 0, }, .framing = 0, } |
Definition at line 716 of file rtp_engine.h.
Referenced by process_sdp(), set_caps(), and set_incoming_call_offer_cap().
#define AST_RTP_DTMF (1 << 0) |
DTMF (RFC2833)
Definition at line 266 of file rtp_engine.h.
Referenced by __sip_alloc(), add_noncodec_to_sdp(), add_sdp(), ast_rtp_dtmf_begin(), ast_rtp_engine_init(), ast_rtp_interpret(), check_peer_ok(), create_addr_from_peer(), create_outgoing_sdp_stream(), process_sdp(), and sip_dtmfmode().
#define ast_rtp_engine_register | ( | engine | ) | ast_rtp_engine_register2(engine, AST_MODULE_SELF) |
Definition at line 794 of file rtp_engine.h.
Referenced by AST_TEST_DEFINE(), and load_module().
#define ast_rtp_glue_register | ( | glue | ) | ast_rtp_glue_register2(glue, AST_MODULE_SELF) |
Definition at line 847 of file rtp_engine.h.
Referenced by load_module().
#define ast_rtp_instance_get_and_cmp_remote_address | ( | instance, | |
address | |||
) | ast_rtp_instance_get_and_cmp_requested_target_address((instance), (address)) |
Get the address of the remote endpoint that we are sending RTP to, comparing its address to another.
instance | The instance that we want to get the remote address for |
address | An initialized address that may be overwritten if the remote address is different |
0 | address was not changed |
1 | address was changed Example usage: |
This retrieves the current remote address set on the instance pointed to by instance and puts the value into the address structure.
Definition at line 1228 of file rtp_engine.h.
Referenced by check_for_rtp_changes(), ooh323_set_rtp_peer(), and sip_set_rtp_peer().
#define ast_rtp_instance_get_remote_address | ( | instance, | |
address | |||
) | ast_rtp_instance_get_incoming_source_address((instance), (address)) |
Get the address of the remote endpoint that we are sending RTP to.
instance | The instance that we want to get the remote address for |
address | A structure to put the address into |
Example usage:
This retrieves the current remote address set on the instance pointed to by instance and puts the value into the address structure.
Definition at line 1192 of file rtp_engine.h.
Referenced by __rtp_recvfrom(), add_sdp(), ast_rtcp_write(), ast_rtp_bundle(), ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), ast_rtp_dtmf_end_with_duration(), ast_rtp_prop_set(), ast_rtp_read(), ast_rtp_rtcp_handle_nack(), ast_rtp_sendcng(), ast_rtp_write(), bridge_p2p_rtp_write(), channel_read_rtp(), create_dtmf_frame(), find_rtp_port(), jingle_interpret_ice_udp_transport(), multicast_send_control_packet(), ooh323_get_rtp_peer(), process_cn_rfc3389(), process_dtmf_rfc2833(), process_sdp(), rtp_raw_write(), send_start_rtp(), sip_acf_channel_read(), skinny_set_rtp_peer(), transmit_modify_with_sdp(), and unistim_set_rtp_peer().
#define ast_rtp_instance_set_remote_address | ( | instance, | |
address | |||
) | ast_rtp_instance_set_requested_target_address((instance), (address)) |
Set the address of the remote endpoint that we are sending RTP to.
instance | The RTP instance to change the address on |
address | Address to set it to |
0 | success |
-1 | failure |
Example usage:
This changes the remote address that RTP will be sent to on instance to the address given in the sin structure.
Definition at line 1080 of file rtp_engine.h.
Referenced by __rtp_recvfrom(), apply_negotiated_sdp_stream(), ast_rtp_bundle(), ast_rtp_ice_start_media(), ast_rtp_read(), ast_rtp_remote_address_set(), ast_rtp_stop(), AST_TEST_DEFINE(), handle_open_receive_channel_ack_message(), jingle_interpret_ice_udp_transport(), multicast_rtp_request(), process_sdp(), setup_rtp_connection(), setup_rtp_remote(), start_rtp(), test_init_rtp_instances(), and unicast_rtp_request().
#define AST_RTP_MAX AST_RTP_CISCO_DTMF |
Maximum RTP-specific code
Definition at line 272 of file rtp_engine.h.
Referenced by add_sdp(), ast_rtp_lookup_mime_multiple2(), and create_outgoing_sdp_stream().
#define AST_RTP_MAX_PT 128 |
Maximum number of payload types RTP can support.
Definition at line 83 of file rtp_engine.h.
Referenced by ast_rtp_codecs_get_payload(), ast_rtp_codecs_get_payload_format(), ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_clear(), ast_rtp_codecs_payloads_initialize(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_codecs_payloads_unset(), ast_rtp_engine_unload_format(), find_static_payload_type(), find_unused_payload(), handle_show_settings(), and rtp_engine_shutdown().
#define AST_RTP_PT_FIRST_DYNAMIC 96 |
First dynamic RTP payload type
Definition at line 92 of file rtp_engine.h.
Referenced by find_unused_payload(), handle_show_settings(), load_asterisk_conf(), rtp_codecs_assign_payload_code_rx(), and rtp_codecs_find_non_primary_dynamic_rx().
#define AST_RTP_PT_LAST_REASSIGN 63 |
Last reassignable RTP payload type
Definition at line 95 of file rtp_engine.h.
Referenced by find_unused_payload(), and handle_show_settings().
#define AST_RTP_PT_LAST_STATIC 34 |
Last RTP payload type statically assigned, see http://www.iana.org/assignments/rtp-parameters
Definition at line 89 of file rtp_engine.h.
Referenced by add_codec_to_sdp(), ast_rtp_codecs_get_payload(), ast_rtp_codecs_payloads_set_m_type(), find_unused_payload(), and generate_rtpmap_attr().
#define AST_RTP_RTCP_FMT_FIR 4 |
Full INTRA-frame Request (From RFC5104)
Definition at line 307 of file rtp_engine.h.
Referenced by ast_rtcp_interpret().
#define AST_RTP_RTCP_FMT_NACK 1 |
Generic NACK (From RFC4585 also RFC5104)
Definition at line 303 of file rtp_engine.h.
Referenced by ast_rtcp_generate_nack(), ast_rtcp_interpret(), and rtcp_payload_subtype2str().
#define AST_RTP_RTCP_FMT_PLI 1 |
Picture loss indication (From RFC4585)
Definition at line 305 of file rtp_engine.h.
Referenced by ast_rtcp_interpret().
#define AST_RTP_RTCP_FMT_REMB 15 |
REMB Information (From draft-alvestrand-rmcat-remb-03)
Definition at line 309 of file rtp_engine.h.
Referenced by ast_rtcp_interpret(), AST_TEST_DEFINE(), remb_collector_alloc(), remb_hook_event_cb(), rtcp_payload_subtype2str(), rtp_write_rtcp_psfb(), and softmix_bridge_write_rtcp().
#define AST_RTP_RTCP_FMT_TRANSPORT_WIDE_CC 15 |
Transport-wide congestion control feedback (From draft-holmer-rmcat-transport-wide-cc-extensions-01)
Definition at line 311 of file rtp_engine.h.
Referenced by rtp_transport_wide_cc_feedback_produce().
#define AST_RTP_RTCP_PSFB 206 |
Payload Specific Feed Back (From RFC4585 also RFC5104)
Definition at line 299 of file rtp_engine.h.
Referenced by ast_rtp_write(), AST_TEST_DEFINE(), chan_pjsip_write_stream(), remb_collector_alloc(), remb_hook_event_cb(), and softmix_bridge_write_rtcp().
#define AST_RTP_RTCP_RR 201 |
Receiver Report
Definition at line 295 of file rtp_engine.h.
Referenced by AST_TEST_DEFINE(), and lintospeex_feedback().
#define AST_RTP_RTCP_RTPFB 205 |
Transport Layer Feed Back (From RFC4585 also RFC5104)
Definition at line 297 of file rtp_engine.h.
Referenced by ast_rtcp_generate_nack(), ast_rtcp_interpret(), rtcp_payload_subtype2str(), and rtp_transport_wide_cc_feedback_produce().
#define AST_RTP_RTCP_SR 200 |
Sender Report
Definition at line 293 of file rtp_engine.h.
Referenced by AST_TEST_DEFINE(), hook_event_cb(), lintospeex_feedback(), rtcp_report_to_ami(), and rtcp_report_to_json().
#define AST_RTP_STAT_SET | ( | current_stat, | |
combined, | |||
placement, | |||
value | |||
) |
Definition at line 433 of file rtp_engine.h.
Referenced by ast_rtp_get_stat().
#define AST_RTP_STAT_STRCPY | ( | current_stat, | |
combined, | |||
placement, | |||
value | |||
) |
Definition at line 441 of file rtp_engine.h.
Referenced by ast_rtp_get_stat().
#define AST_RTP_STAT_TERMINATOR | ( | combined | ) |
Definition at line 449 of file rtp_engine.h.
Referenced by ast_rtp_get_stat().
#define MAX_CHANNEL_ID 152 |
Maximum size of an internal Asterisk channel unique ID.
Definition at line 107 of file rtp_engine.h.
DTLS connection states.
Enumerator | |
---|---|
AST_RTP_DTLS_CONNECTION_NEW | Endpoint wants to use a new connection |
AST_RTP_DTLS_CONNECTION_EXISTING | Endpoint wishes to use existing connection |
Definition at line 521 of file rtp_engine.h.
enum ast_rtp_dtls_hash |
DTLS fingerprint hashes.
Enumerator | |
---|---|
AST_RTP_DTLS_HASH_SHA256 | SHA-256 fingerprint hash |
AST_RTP_DTLS_HASH_SHA1 | SHA-1 fingerprint hash |
Definition at line 527 of file rtp_engine.h.
enum ast_rtp_dtls_setup |
DTLS setup types.
Definition at line 513 of file rtp_engine.h.
enum ast_rtp_dtls_verify |
DTLS verification settings.
Enumerator | |
---|---|
AST_RTP_DTLS_VERIFY_NONE | Don't verify anything |
AST_RTP_DTLS_VERIFY_FINGERPRINT | Verify the fingerprint |
AST_RTP_DTLS_VERIFY_CERTIFICATE | Verify the certificate |
Definition at line 533 of file rtp_engine.h.
enum ast_rtp_dtmf_mode |
RTP DTMF Modes
Definition at line 148 of file rtp_engine.h.
enum ast_rtp_extension |
Known RTP extensions.
Enumerator | |
---|---|
AST_RTP_EXTENSION_UNSUPPORTED | Per the RFC 0 should not be used, so we treat it as an unsupported extension placeholder |
AST_RTP_EXTENSION_ABS_SEND_TIME | abs-send-time from https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03 |
AST_RTP_EXTENSION_TRANSPORT_WIDE_CC | transport-cc from https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01 |
AST_RTP_EXTENSION_MAX | The maximum number of known RTP extensions |
Definition at line 542 of file rtp_engine.h.
Directions for RTP extensions.
Definition at line 769 of file rtp_engine.h.
enum ast_rtp_glue_result |
Result codes when RTP glue is queried for information
Definition at line 158 of file rtp_engine.h.
ICE candidate types.
Definition at line 455 of file rtp_engine.h.
ICE component types.
Enumerator | |
---|---|
AST_RTP_ICE_COMPONENT_RTP | |
AST_RTP_ICE_COMPONENT_RTCP |
Definition at line 462 of file rtp_engine.h.
enum ast_rtp_ice_role |
ICE role during negotiation.
Enumerator | |
---|---|
AST_RTP_ICE_ROLE_CONTROLLED | |
AST_RTP_ICE_ROLE_CONTROLLING |
Definition at line 468 of file rtp_engine.h.
Definition at line 255 of file rtp_engine.h.
Statistics that can be retrieved from an RTP instance
Definition at line 180 of file rtp_engine.h.
Field statistics that can be retrieved from an RTP instance
Definition at line 168 of file rtp_engine.h.
enum ast_rtp_options |
Additional RTP options
Enumerator | |
---|---|
AST_RTP_OPT_G726_NONSTANDARD | Remote side is using non-standard G.726 |
Definition at line 142 of file rtp_engine.h.
enum ast_rtp_property |
RTP Properties that can be set on an RTP instance
Definition at line 113 of file rtp_engine.h.
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_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().