65#ifndef _ASTERISK_RTP_ENGINE_H
66#define _ASTERISK_RTP_ENGINE_H
68#if defined(__cplusplus) || defined(c_plusplus)
83#define AST_RTP_MAX_PT 128
89#define AST_RTP_PT_LAST_STATIC 34
92#define AST_RTP_PT_FIRST_DYNAMIC 96
95#define AST_RTP_PT_LAST_REASSIGN 63
98#define AST_RED_MAX_GENERATION 5
107#define MAX_CHANNEL_ID 152
110#define DEFAULT_DTMF_SAMPLE_RATE_MS 8000
294#define AST_RTP_DTMF (1 << 0)
296#define AST_RTP_CN (1 << 1)
298#define AST_RTP_CISCO_DTMF (1 << 2)
300#define AST_RTP_MAX AST_RTP_CISCO_DTMF
323#define AST_RTP_RTCP_SR 200
325#define AST_RTP_RTCP_RR 201
327#define AST_RTP_RTCP_RTPFB 205
329#define AST_RTP_RTCP_PSFB 206
333#define AST_RTP_RTCP_FMT_NACK 1
335#define AST_RTP_RTCP_FMT_PLI 1
337#define AST_RTP_RTCP_FMT_FIR 4
339#define AST_RTP_RTCP_FMT_REMB 15
341#define AST_RTP_RTCP_FMT_TRANSPORT_WIDE_CC 15
484#define AST_RTP_STAT_SET(current_stat, combined, placement, value) \
485if (stat == current_stat || stat == AST_RTP_INSTANCE_STAT_ALL || (combined >= 0 && combined == stat)) { \
487if (stat == current_stat) { \
492#define AST_RTP_STAT_STRCPY(current_stat, combined, placement, value) \
493if (stat == current_stat || stat == AST_RTP_INSTANCE_STAT_ALL || (combined >= 0 && combined == stat)) { \
494 ast_copy_string(placement, value, sizeof(placement)); \
495 if (stat == current_stat) { \
500#define AST_RTP_STAT_TERMINATOR(combined) \
501if (stat == combined) { \
557 enum ast_transport transport,
const char *server,
unsigned int port,
558 const char *username,
const char *password);
646struct ast_rtp_engine_test {
747 struct ast_rtp_engine_test *
test;
773#define AST_RTP_CODECS_NULL_INIT \
774 { .codecs_lock = AST_RWLOCK_INIT_VALUE, .payload_mapping_rx = { 0, }, .payload_mapping_tx = { 0, }, .framing = 0, .preferred_format = NULL, \
775 .preferred_dtmf_rate = -1, .preferred_dtmf_pt = -1}
852#define ast_rtp_engine_register(engine) ast_rtp_engine_register2(engine, AST_MODULE_SELF)
905#define ast_rtp_glue_register(glue) ast_rtp_glue_register2(glue, AST_MODULE_SELF)
1138#define ast_rtp_instance_set_remote_address(instance, address) \
1139 ast_rtp_instance_set_requested_target_address((instance), (address))
1250#define ast_rtp_instance_get_remote_address(instance, address) \
1251 ast_rtp_instance_get_incoming_source_address((instance), (address))
1286#define ast_rtp_instance_get_and_cmp_remote_address(instance, address) \
1287 ast_rtp_instance_get_and_cmp_requested_target_address((instance), (address))
1397 const char *uri,
const char *attributes);
1618 char *mimetype,
char *mimesubtype,
1620 unsigned int sample_rate);
2764#ifdef TEST_FRAMEWORK
2773struct ast_rtp_engine_test *ast_rtp_instance_get_test(
struct ast_rtp_instance *instance);
2951#ifdef TEST_FRAMEWORK
2958size_t ast_rtp_instance_get_recv_buffer_max(
struct ast_rtp_instance *instance);
2966size_t ast_rtp_instance_get_recv_buffer_count(
struct ast_rtp_instance *instance);
2974size_t ast_rtp_instance_get_send_buffer_count(
struct ast_rtp_instance *instance);
2982void ast_rtp_instance_set_schedid(
struct ast_rtp_instance *instance,
int id);
2990void ast_rtp_instance_drop_packets(
struct ast_rtp_instance *instance,
int num);
3063#define AST_LOG_CATEGORY_RTP "rtp"
3065#define AST_LOG_CATEGORY_RTP_PACKET "rtp_packet"
3067#define AST_LOG_CATEGORY_RTCP "rtcp"
3069#define AST_LOG_CATEGORY_RTCP_PACKET "rtcp_packet"
3071#define AST_LOG_CATEGORY_DTLS "dtls"
3073#define AST_LOG_CATEGORY_DTLS_PACKET "dtls_packet"
3075#define AST_LOG_CATEGORY_ICE "ice"
3085#define AST_DEBUG_CATEGORY_RTP ast_debug_category_rtp_id()
3086#define AST_DEBUG_CATEGORY_RTP_PACKET ast_debug_category_rtp_packet_id()
3087#define AST_DEBUG_CATEGORY_RTCP ast_debug_category_rtcp_id()
3088#define AST_DEBUG_CATEGORY_RTCP_PACKET ast_debug_category_rtcp_packet_id()
3089#define AST_DEBUG_CATEGORY_DTLS ast_debug_category_dtls_id()
3090#define AST_DEBUG_CATEGORY_DTLS_PACKET ast_debug_category_dtls_packet_id()
3091#define AST_DEBUG_CATEGORY_ICE ast_debug_category_ice_id()
3099#define ast_debug_rtp(sublevel, ...) \
3100 ast_debug_category(sublevel, AST_DEBUG_CATEGORY_RTP, __VA_ARGS__)
3103#define ast_debug_rtp_is_allowed \
3104 ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_RTP)
3107#define ast_debug_rtp_packet_is_allowed \
3108 ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_RTP_PACKET)
3116#define ast_debug_rtcp(sublevel, ...) \
3117 ast_debug_category(sublevel, AST_DEBUG_CATEGORY_RTCP, __VA_ARGS__)
3120#define ast_debug_rtcp_is_allowed \
3121 ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_RTCP)
3124#define ast_debug_rtcp_packet_is_allowed \
3125 ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_RTCP_PACKET)
3133#define ast_debug_dtls(sublevel, ...) \
3134 ast_debug_category(sublevel, AST_DEBUG_CATEGORY_DTLS, __VA_ARGS__)
3137#define ast_debug_dtls_packet_is_allowed \
3138 ast_debug_category_is_allowed(AST_LOG_CATEGORY_ENABLED, AST_DEBUG_CATEGORY_DTLS_PACKET)
3145#define ast_debug_ice(sublevel, ...) \
3146 ast_debug_category(sublevel, AST_DEBUG_CATEGORY_ICE, __VA_ARGS__)
3148#if defined(__cplusplus) || defined(c_plusplus)
static struct ast_sched_context * sched
static struct ao2_container * codecs
Registered codecs.
ast_media_type
Types of media.
struct stasis_message_type * ast_rtp_rtcp_sent_type(void)
Message type for an RTCP message sent from this Asterisk instance.
struct stasis_message_type * ast_rtp_rtcp_received_type(void)
Message type for an RTCP message received from some external source.
Asterisk internal frame definitions.
static struct ast_srtp_res srtp_res
static struct ast_srtp_policy_res policy_res
ast_rtp_dtls_setup
DTLS setup types.
@ AST_RTP_DTLS_SETUP_PASSIVE
@ AST_RTP_DTLS_SETUP_HOLDCONN
@ AST_RTP_DTLS_SETUP_ACTPASS
@ AST_RTP_DTLS_SETUP_ACTIVE
uintmax_t ast_debug_category_rtcp_packet_id(void)
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.
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.
struct stasis_topic * ast_rtp_topic(void)
Stasis Message Bus API topic for RTP and RTCP related messages
ast_rtp_ice_role
ICE role during negotiation.
@ AST_RTP_ICE_ROLE_CONTROLLING
@ AST_RTP_ICE_ROLE_CONTROLLED
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.
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.
void ast_rtp_codecs_payloads_destroy(struct ast_rtp_codecs *codecs)
Destroy the contents of an RTP codecs structure (but not the structure itself)
int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
Destroy an RTP instance.
enum ast_rtp_dtmf_mode ast_rtp_instance_dtmf_mode_get(struct ast_rtp_instance *instance)
Get the DTMF mode of an RTP instance.
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.
struct ast_format * ast_rtp_codecs_get_preferred_format(struct ast_rtp_codecs *codecs)
Retrieve rx preferred format.
struct ast_json * ast_rtp_convert_stats_json(const struct ast_rtp_instance_stats *stats)
Convert given stat instance into json format.
uintmax_t ast_debug_category_rtp_packet_id(void)
ast_rtp_ice_component_type
ICE component types.
@ AST_RTP_ICE_COMPONENT_RTCP
@ AST_RTP_ICE_COMPONENT_RTP
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.
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.
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.
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.
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.
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.
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.
void ast_rtp_instance_set_last_rx(struct ast_rtp_instance *rtp, time_t time)
Set the last RTP reception time.
int ast_rtp_instance_get_prop(struct ast_rtp_instance *instance, enum ast_rtp_property property)
Get the value of an RTP instance property.
int ast_rtp_engine_register_srtp(struct ast_srtp_res *srtp_res, struct ast_srtp_policy_res *policy_res)
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.
uintmax_t ast_debug_category_ice_id(void)
ast_rtp_dtls_hash
DTLS fingerprint hashes.
@ AST_RTP_DTLS_HASH_SHA256
int ast_rtp_engine_srtp_is_registered(void)
@ AST_RTP_DTMF_MODE_RFC2833
@ AST_RTP_DTMF_MODE_INBAND
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.
void ast_rtp_instance_stop(struct ast_rtp_instance *instance)
Stop an RTP instance.
void ast_rtp_dtls_cfg_free(struct ast_rtp_dtls_cfg *dtls_cfg)
Free contents of a DTLS configuration structure.
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.
void ast_rtp_engine_unregister_srtp(void)
@ AST_RTP_INSTANCE_RTCP_MUX
@ AST_RTP_INSTANCE_RTCP_STANDARD
@ AST_RTP_INSTANCE_RTCP_DISABLED
uintmax_t ast_debug_category_rtp_id(void)
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.
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.
struct ast_srtp * ast_rtp_instance_get_srtp(struct ast_rtp_instance *instance, int rtcp)
Obtain the SRTP instance associated with an RTP instance.
ast_rtp_instance_stat_field
@ AST_RTP_INSTANCE_STAT_FIELD_QUALITY_LOSS
@ AST_RTP_INSTANCE_STAT_FIELD_QUALITY_RTT
@ AST_RTP_INSTANCE_STAT_FIELD_QUALITY
@ AST_RTP_INSTANCE_STAT_FIELD_QUALITY_JITTER
@ AST_RTP_INSTANCE_STAT_FIELD_QUALITY_MES
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.
size_t ast_rtp_instance_extmap_count(struct ast_rtp_instance *instance)
Get the number of known unique identifiers.
ast_rtp_dtls_verify
DTLS verification settings.
@ AST_RTP_DTLS_VERIFY_NONE
@ AST_RTP_DTLS_VERIFY_FINGERPRINT
@ AST_RTP_DTLS_VERIFY_CERTIFICATE
@ AST_RTP_GLUE_RESULT_LOCAL
@ AST_RTP_GLUE_RESULT_REMOTE
@ AST_RTP_GLUE_RESULT_FORBID
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.
@ AST_RTP_INSTANCE_STAT_LOCAL_MAXRXPLOSS
@ AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVRXPLOSS
@ AST_RTP_INSTANCE_STAT_REMOTE_MAXRXPLOSS
@ AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVMES
@ AST_RTP_INSTANCE_STAT_REMOTE_MINJITTER
@ AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVMES
@ AST_RTP_INSTANCE_STAT_MIN_RTT
@ AST_RTP_INSTANCE_STAT_TXMES
@ AST_RTP_INSTANCE_STAT_CHANNEL_UNIQUEID
@ AST_RTP_INSTANCE_STAT_TXPLOSS
@ AST_RTP_INSTANCE_STAT_MAX_RTT
@ AST_RTP_INSTANCE_STAT_RXPLOSS
@ AST_RTP_INSTANCE_STAT_REMOTE_MAXJITTER
@ AST_RTP_INSTANCE_STAT_LOCAL_MAXJITTER
@ AST_RTP_INSTANCE_STAT_REMOTE_MINMES
@ AST_RTP_INSTANCE_STAT_REMOTE_STDEVJITTER
@ AST_RTP_INSTANCE_STAT_REMOTE_MINRXPLOSS
@ AST_RTP_INSTANCE_STAT_LOCAL_MINMES
@ AST_RTP_INSTANCE_STAT_TXOCTETCOUNT
@ AST_RTP_INSTANCE_STAT_RXMES
@ AST_RTP_INSTANCE_STAT_REMOTE_STDEVMES
@ AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVRXPLOSS
@ AST_RTP_INSTANCE_STAT_REMOTE_STDEVRXPLOSS
@ AST_RTP_INSTANCE_STAT_LOCAL_STDEVRXPLOSS
@ AST_RTP_INSTANCE_STAT_REMOTE_MAXMES
@ AST_RTP_INSTANCE_STAT_TXCOUNT
@ AST_RTP_INSTANCE_STAT_STDEVRTT
@ AST_RTP_INSTANCE_STAT_COMBINED_MES
@ AST_RTP_INSTANCE_STAT_LOCAL_MAXMES
@ AST_RTP_INSTANCE_STAT_RXJITTER
@ AST_RTP_INSTANCE_STAT_LOCAL_MINRXPLOSS
@ AST_RTP_INSTANCE_STAT_LOCAL_SSRC
@ AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVJITTER
@ AST_RTP_INSTANCE_STAT_COMBINED_JITTER
@ AST_RTP_INSTANCE_STAT_TXJITTER
@ AST_RTP_INSTANCE_STAT_LOCAL_MINJITTER
@ AST_RTP_INSTANCE_STAT_COMBINED_LOSS
@ AST_RTP_INSTANCE_STAT_LOCAL_STDEVJITTER
@ AST_RTP_INSTANCE_STAT_COMBINED_RTT
@ AST_RTP_INSTANCE_STAT_NORMDEVRTT
@ AST_RTP_INSTANCE_STAT_RTT
@ AST_RTP_INSTANCE_STAT_RXOCTETCOUNT
@ AST_RTP_INSTANCE_STAT_LOCAL_STDEVMES
@ AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVJITTER
@ AST_RTP_INSTANCE_STAT_ALL
@ AST_RTP_INSTANCE_STAT_RXCOUNT
@ AST_RTP_INSTANCE_STAT_REMOTE_SSRC
int ast_rtp_instance_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
Early bridge two channels that use RTP instances.
void ast_rtp_instance_set_stream_num(struct ast_rtp_instance *instance, int stream_num)
Set the stream number for an RTP instance.
void * ast_rtp_instance_get_data(struct ast_rtp_instance *instance)
Get the data portion of an RTP instance.
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.
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.
int ast_rtp_instance_get_keepalive(struct ast_rtp_instance *instance)
Get the RTP keepalive interval.
struct ast_rtp_engine * ast_rtp_instance_get_engine(struct ast_rtp_instance *instance)
Get the RTP engine in use on an RTP instance.
const char * ast_rtp_instance_get_cname(struct ast_rtp_instance *rtp)
Retrieve the CNAME used in RTCP SDES items.
int ast_rtp_codecs_payload_set_rx_sample_rate(struct ast_rtp_codecs *codecs, int code, struct ast_format *format, unsigned int sample_rate)
Set a payload code with sample rate for use with a specific Asterisk format.
void ast_rtp_codecs_payload_formats(struct ast_rtp_codecs *codecs, struct ast_format_cap *astformats, int *nonastformats)
Retrieve all formats that were found.
int ast_rtp_instance_get_timeout(struct ast_rtp_instance *instance)
Get the RTP timeout value.
int ast_rtp_instance_dtmf_begin(struct ast_rtp_instance *instance, char digit)
Begin sending a DTMF digit.
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.
void ast_rtp_instance_set_last_tx(struct ast_rtp_instance *rtp, time_t time)
Set the last RTP transmission time.
struct ast_frame * ast_rtp_instance_read(struct ast_rtp_instance *instance, int rtcp)
Receive a frame over RTP.
void ast_rtp_instance_set_data(struct ast_rtp_instance *instance, void *data)
Set the data portion of an RTP instance.
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.
int ast_rtp_instance_bundle(struct ast_rtp_instance *child, struct ast_rtp_instance *parent)
Request that an RTP instance be bundled with another.
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.
int ast_rtp_codecs_payload_code_tx_sample_rate(struct ast_rtp_codecs *codecs, int asterisk_format, const struct ast_format *format, int code, unsigned int sample_rate)
Retrieve a tx mapped payload type based on whether it is an Asterisk format and the code.
void ast_rtp_codecs_set_framing(struct ast_rtp_codecs *codecs, unsigned int framing)
Set the framing used for a set of codecs.
time_t ast_rtp_instance_get_last_tx(const struct ast_rtp_instance *rtp)
Get the last RTP transmission time.
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.
int ast_rtp_red_init(struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations)
Initialize RED support on an RTP instance.
struct ast_json * ast_rtp_instance_get_stats_all_json(struct ast_rtp_instance *instance)
Retrieve statistics about an RTP instance in json format.
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.
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.
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.
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.
int ast_rtp_codecs_get_preferred_dtmf_format_rate(struct ast_rtp_codecs *codecs)
Retrieve rx preferred dtmf format sample rate.
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.
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.
int ast_rtp_instance_dtmf_end_with_duration(struct ast_rtp_instance *instance, char digit, unsigned int duration)
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.
ast_rtp_ice_candidate_type
ICE candidate types.
@ AST_RTP_ICE_CANDIDATE_TYPE_RELAYED
@ AST_RTP_ICE_CANDIDATE_TYPE_SRFLX
@ AST_RTP_ICE_CANDIDATE_TYPE_HOST
int ast_rtp_codecs_payload_code_sample_rate(struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code, unsigned int sample_rate)
Retrieve a rx mapped payload type based on whether it is an Asterisk format, the code and the sample ...
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.
int ast_rtp_get_rate(const struct ast_format *format)
Retrieve the sample rate of a format according to RTP specifications.
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.
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.
int ast_rtp_instance_write(struct ast_rtp_instance *instance, struct ast_frame *frame)
Send a frame out over RTP.
ast_rtp_extension
Known RTP extensions.
@ AST_RTP_EXTENSION_TRANSPORT_WIDE_CC
@ AST_RTP_EXTENSION_ABS_SEND_TIME
@ AST_RTP_EXTENSION_UNSUPPORTED
int ast_rtp_glue_register2(struct ast_rtp_glue *glue, struct ast_module *module)
Register RTP glue.
uintmax_t ast_debug_category_dtls_packet_id(void)
int ast_rtp_payload_mapping_tx_is_present(struct ast_rtp_codecs *codecs, const struct ast_rtp_payload_type *to_match)
Determine if a type of payload is already present in mappings.
void ast_rtp_codecs_payloads_unset(struct ast_rtp_codecs *codecs, struct ast_rtp_instance *instance, int payload)
Remove tx payload type mapped information.
int ast_rtp_instance_sendcng(struct ast_rtp_instance *instance, int level)
Send a comfort noise packet to the RTP instance.
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.
void ast_rtp_instance_set_remote_ssrc(struct ast_rtp_instance *rtp, unsigned int ssrc)
Set the remote SSRC for an RTP instance.
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.
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.
@ AST_RTP_OPT_G726_NONSTANDARD
ast_rtp_dtls_connection
DTLS connection states.
@ AST_RTP_DTLS_CONNECTION_NEW
@ AST_RTP_DTLS_CONNECTION_EXISTING
int ast_rtp_codecs_payloads_initialize(struct ast_rtp_codecs *codecs)
Initialize an RTP codecs structure.
@ AST_RTP_PROPERTY_MAX
Maximum number of RTP properties supported.
@ AST_RTP_PROPERTY_RETRANS_RECV
@ AST_RTP_PROPERTY_RETRANS_SEND
@ AST_RTP_PROPERTY_ASYMMETRIC_CODEC
@ AST_RTP_PROPERTY_DTMF_COMPENSATE
int ast_rtp_dtls_cfg_parse(struct ast_rtp_dtls_cfg *dtls_cfg, const char *name, const char *value)
Parse DTLS related configuration options.
void * ast_rtp_instance_get_extended_prop(struct ast_rtp_instance *instance, int property)
Get the value of an RTP instance extended property.
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 orde...
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.
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.
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.
time_t ast_rtp_instance_get_last_rx(const struct ast_rtp_instance *rtp)
Get the last RTP reception time.
int ast_rtp_engine_register2(struct ast_rtp_engine *engine, struct ast_module *module)
Register an RTP engine.
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.
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.
void ast_rtp_instance_set_channel_id(struct ast_rtp_instance *instance, const char *uniqueid)
Set the channel that owns this RTP instance.
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.
ast_rtp_extension_direction
Directions for RTP extensions.
@ AST_RTP_EXTENSION_DIRECTION_SENDRECV
@ AST_RTP_EXTENSION_DIRECTION_NONE
@ AST_RTP_EXTENSION_DIRECTION_INACTIVE
@ AST_RTP_EXTENSION_DIRECTION_RECVONLY
@ AST_RTP_EXTENSION_DIRECTION_SENDONLY
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.
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.
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.
uintmax_t ast_debug_category_rtcp_id(void)
struct ast_rtp_glue * ast_rtp_instance_get_glue(const char *type)
Get the RTP glue that binds a channel to the RTP engine.
const char * ast_rtp_instance_extmap_get_uri(struct ast_rtp_instance *instance, int id)
Retrieve the URI for an RTP extension id.
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.
int ast_rtp_codecs_set_preferred_dtmf_format(struct ast_rtp_codecs *codecs, int pt, int rate)
Set the preferred dtmf format pt and sample rate.
int ast_rtp_instance_dtmf_end(struct ast_rtp_instance *instance, char digit)
Stop sending a DTMF digit.
int ast_rtp_instance_extmap_get_id(struct ast_rtp_instance *instance, enum ast_rtp_extension extension)
Retrieve the id for an RTP extension.
int ast_rtp_dtls_cfg_validate(struct ast_rtp_dtls_cfg *dtls_cfg)
Validates DTLS related configuration options.
int ast_rtp_codecs_get_preferred_dtmf_format_pt(struct ast_rtp_codecs *codecs)
Retrieve rx preferred dtmf format payload type.
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.
int ast_rtp_engine_unregister(struct ast_rtp_engine *engine)
Unregister an RTP engine.
uintmax_t ast_debug_category_dtls_id(void)
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.
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 mim...
void ast_rtp_instance_extmap_clear(struct ast_rtp_instance *instance)
Clear negotiated RTP extension information.
struct ast_rtp_payload_type * ast_rtp_engine_alloc_payload_type(void)
Allocation routine for ast_rtp_payload_type.
struct ast_rtp_codecs * ast_rtp_instance_get_codecs(struct ast_rtp_instance *instance)
Get the codecs structure of an RTP instance.
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.
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.
int ast_rtp_instance_fd(struct ast_rtp_instance *instance, int rtcp)
Get the file descriptor for an RTP session (or RTCP)
void ast_rtp_instance_update_source(struct ast_rtp_instance *instance)
Indicate that the RTP marker bit should be set on an RTP stream.
unsigned int ast_rtp_codecs_get_framing(struct ast_rtp_codecs *codecs)
Get the framing used for a set of codecs.
void ast_rtp_instance_set_keepalive(struct ast_rtp_instance *instance, int timeout)
Set the RTP keepalive interval.
unsigned int ast_rtp_instance_get_ssrc(struct ast_rtp_instance *rtp)
Retrieve the local SSRC value that we will be using.
int ast_rtp_red_buffer(struct ast_rtp_instance *instance, struct ast_frame *frame)
Buffer a frame in an RTP instance for RED.
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.
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.
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.
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.
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.
void ast_rtp_instance_set_timeout(struct ast_rtp_instance *instance, int timeout)
Set the RTP timeout value.
int ast_rtp_glue_unregister(struct ast_rtp_glue *glue)
Unregister RTP glue.
int ast_rtp_codecs_set_preferred_format(struct ast_rtp_codecs *codecs, struct ast_format *format)
Set the preferred format.
Scheduler Routines (derived from cheops)
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
Main Channel structure associated with a channel.
Data structure associated with a single frame of data.
Abstract JSON element (object, array, string, int, ...).
struct ast_rtp_codecs::@277 payload_mapping_tx
struct ast_format * preferred_format
struct ast_rtp_codecs::@276 payload_mapping_rx
DTLS configuration structure.
enum ast_rtp_dtls_setup default_setup
enum ast_rtp_dtls_verify verify
enum ast_rtp_dtls_hash hash
unsigned int ephemeral_cert
enum ast_srtp_suite suite
Structure that represents the optional DTLS SRTP support within an RTP engine.
int(* set_configuration)(struct ast_rtp_instance *instance, const struct ast_rtp_dtls_cfg *dtls_cfg)
int(* active)(struct ast_rtp_instance *instance)
enum ast_rtp_dtls_setup(* get_setup)(struct ast_rtp_instance *instance)
void(* stop)(struct ast_rtp_instance *instance)
enum ast_rtp_dtls_hash(* get_fingerprint_hash)(struct ast_rtp_instance *instance)
void(* reset)(struct ast_rtp_instance *instance)
void(* set_fingerprint)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint)
enum ast_rtp_dtls_connection(* get_connection)(struct ast_rtp_instance *instance)
void(* set_setup)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup)
Structure for an ICE candidate.
enum ast_rtp_ice_component_type id
struct ast_sockaddr relay_address
enum ast_rtp_ice_candidate_type type
Structure that represents the optional ICE support within an RTP engine.
void(* ice_lite)(struct ast_rtp_instance *instance)
void(* stop)(struct ast_rtp_instance *instance)
void(* change_components)(struct ast_rtp_instance *instance, int num_components)
void(* set_authentication)(struct ast_rtp_instance *instance, const char *ufrag, const char *password)
void(* start)(struct ast_rtp_instance *instance)
void(* turn_request)(struct ast_rtp_instance *instance, enum ast_rtp_ice_component_type component, enum ast_transport transport, const char *server, unsigned int port, const char *username, const char *password)
void(* add_remote_candidate)(struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate)
void(* set_role)(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role)
int(* get_stat)(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat)
int(* write)(struct ast_rtp_instance *instance, struct ast_frame *frame)
int(* qos)(struct ast_rtp_instance *instance, int tos, int cos, const char *desc)
void(* stop)(struct ast_rtp_instance *instance)
enum ast_rtp_dtmf_mode(* dtmf_mode_get)(struct ast_rtp_instance *instance)
int(* activate)(struct ast_rtp_instance *instance)
void(* change_source)(struct ast_rtp_instance *instance)
int(* dtmf_end)(struct ast_rtp_instance *instance, char digit)
void(* payload_set)(struct ast_rtp_instance *instance, int payload, int asterisk_format, struct ast_format *format, int code)
int(* destroy)(struct ast_rtp_instance *instance)
int(* fd)(struct ast_rtp_instance *instance, int rtcp)
int(* dtmf_mode_set)(struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode)
void(* set_remote_ssrc)(struct ast_rtp_instance *instance, unsigned int ssrc)
int(* dtmf_compatible)(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1)
int(* make_compatible)(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1)
int(* red_buffer)(struct ast_rtp_instance *instance, struct ast_frame *frame)
int(* set_read_format)(struct ast_rtp_instance *instance, struct ast_format *format)
int(* red_init)(struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations)
void(* prop_set)(struct ast_rtp_instance *instance, enum ast_rtp_property property, int value)
int(* dtmf_end_with_duration)(struct ast_rtp_instance *instance, char digit, unsigned int duration)
int(* set_write_format)(struct ast_rtp_instance *instance, struct ast_format *format)
void(* remote_address_set)(struct ast_rtp_instance *instance, struct ast_sockaddr *sa)
void(* available_formats)(struct ast_rtp_instance *instance, struct ast_format_cap *to_endpoint, struct ast_format_cap *to_asterisk, struct ast_format_cap *result)
int(* sendcng)(struct ast_rtp_instance *instance, int level)
void(* update_source)(struct ast_rtp_instance *instance)
void(* stun_request)(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username)
int(* dtmf_begin)(struct ast_rtp_instance *instance, char digit)
struct ast_rtp_engine_ice * ice
unsigned int(* ssrc_get)(struct ast_rtp_instance *instance)
struct ast_rtp_engine_dtls * dtls
void(* set_stream_num)(struct ast_rtp_instance *instance, int stream_num)
int(* bundle)(struct ast_rtp_instance *child, struct ast_rtp_instance *parent)
int(* extension_enable)(struct ast_rtp_instance *instance, enum ast_rtp_extension extension)
int(* extended_prop_set)(struct ast_rtp_instance *instance, int property, void *value)
int(* allow_vrtp_remote)(struct ast_channel *chan1, struct ast_rtp_instance *instance)
Used to prevent two channels from remotely bridging video rtp if the channel tech has a reason for pr...
enum ast_rtp_glue_result(* get_rtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance)
Callback for retrieving the RTP instance carrying audio.
void(* get_codec)(struct ast_channel *chan, struct ast_format_cap *result_cap)
Callback for retrieving codecs that the channel can do. Result returned in result_cap.
int(* update_peer)(struct ast_channel *chan, struct ast_rtp_instance *instance, struct ast_rtp_instance *vinstance, struct ast_rtp_instance *tinstance, const struct ast_format_cap *cap, int nat_active)
enum ast_rtp_glue_result(* get_trtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance)
Callback for retrieving the RTP instance carrying text.
int(* allow_rtp_remote)(struct ast_channel *chan1, struct ast_rtp_instance *instance)
Used to prevent two channels from remotely bridging audio rtp if the channel tech has a reason for pr...
enum ast_rtp_glue_result(* get_vrtp_info)(struct ast_channel *chan, struct ast_rtp_instance **instance)
Callback for retrieving the RTP instance carrying video.
double remote_stdevrxploss
double local_normdevjitter
double local_normdevrxploss
unsigned int rxoctetcount
double remote_normdevrxploss
double local_stdevrxploss
double remote_normdevjitter
unsigned int txoctetcount
char channel_uniqueid[MAX_CHANNEL_ID]
double remote_stdevjitter
struct ast_rtp_instance * bridged
unsigned int primary_mapping
struct ast_format * format
struct timeval when_retired
A REMB feedback message (see draft-alvestrand-rmcat-remb-03 for details)
An object that represents data received in a feedback report.
struct ast_rtp_rtcp_feedback_remb remb
A report block within a SR/RR report.
unsigned int highest_seq_no
struct ast_rtp_rtcp_report_block::@272 lost_count
An object that represents data sent during a SR/RR RTCP report.
struct ast_rtp_rtcp_report::@273 sender_information
unsigned short reception_report_count
unsigned int rtp_timestamp
struct ast_rtp_rtcp_report_block * report_block[0]
struct timeval ntp_timestamp
unsigned int packet_count
Structure for rwlock and tracking information.
Socket address structure.
Support for dynamic strings.
structure to hold extensions
Vector container support.
#define AST_VECTOR(name, type)
Define a vector structure.