246#define MAX_RTP_MIME_TYPES 128
287#define SET_AST_JSON_OBJ(target, name, obj) ({ \
288 struct ast_json *j_tmp = obj; \
290 ast_json_object_set(target, name, j_tmp); \
341 engine->
mod = module;
347 if (!strcmp(current_engine->
name, engine->
name)) {
359 ast_verb(5,
"Registered RTP engine '%s'\n", engine->
name);
371 ast_verb(5,
"Unregistered RTP engine '%s'\n", engine->
name);
376 return current_engine ? 0 : -1;
392 if (!strcasecmp(current_glue->
type, glue->
type)) {
415 ast_verb(5,
"Unregistered RTP glue '%s'\n", glue->
type);
420 return current_glue ? 0 : -1;
428 if (instance->
data) {
438 if (instance->
srtp) {
455 ast_debug(1,
"Destroyed RTP instance '%p'\n", instance);
472 buffer[0],
sizeof(buffer[0])),
474 buffer[1],
sizeof(buffer[1])),
476 buffer[2],
sizeof(buffer[2])),
478 buffer[3],
sizeof(buffer[3]))
501 if (!strcmp(engine->
name, engine_name)) {
531 instance->
engine = engine;
548 ast_debug(1,
"Using engine '%s' for RTP instance '%p'\n", engine->
name, instance);
558 ast_debug(1,
"Engine '%s' failed to setup RTP instance '%p'\n", engine->
name, instance);
565 ast_debug(1,
"RTP instance '%p' is setup and ready to go\n", instance);
582 instance->
data = data;
587 return instance->
data;
605 frame = instance->
engine->
read(instance, rtcp);
841 const char *uri,
const char *attributes)
886 static const struct rtp_extmap extmap_none = {
1106 "cleaning up rx mapping vector element about to be replaced");
1157 ast_debug(2,
"Copying rx payload mapping %d (%p) from %p to %p\n",
1158 idx,
type, src, dest);
1222 if (
codecs && to_match) {
1253 ast_debug(2,
"Copying tx payload mapping %d (%p) from %p to %p\n",
1254 idx,
type, src, dest);
1258 "cleaning up tx mapping vector element about to be replaced");
1334 ast_debug(2,
"Crossover copying tx to rx payload mapping %d (%p) from %p to %p\n",
1335 idx,
type, src, dest);
1368 ast_debug(1,
"Don't have a default tx payload type %d format for m type on %p\n",
1373 ast_debug(1,
"Setting tx payload type %d based on m type on %p\n",
1381 "cleaning up replaced tx payload type");
1399 char *mimetype,
char *mimesubtype,
1417 if (strcasecmp(mimesubtype, t->
subtype)) {
1421 if (strcasecmp(mimetype, t->
type)) {
1461 "cleaning up replaced tx payload type");
1481 return (found ? 0 : -2);
1538 if (
type &&
type->asterisk_format) {
1593 pt =
codecs->preferred_dtmf_pt;
1602 rate =
codecs->preferred_dtmf_rate;
1610 codecs->preferred_dtmf_pt = pt;
1611 codecs->preferred_dtmf_rate = rate;
1630 type->asterisk_format = 1;
1632 type->primary_mapping = 1;
1662 if (
type &&
type->asterisk_format) {
1678 codecs->framing = framing;
1684 unsigned int framing;
1687 framing =
codecs->framing;
1710 if (
type->asterisk_format) {
1713 *nonastformats |=
type->rtp_code;
1785 for (x = start; x <
end; ++x) {
1894 struct timeval oldest;
1902 && !
type->primary_mapping
1905 oldest =
type->when_retired;
1930 int payload = code, i;
1966 }
else if (
payload > -1 && !
explicit
1997 }
else if (
explicit) {
2039 if (!
type->asterisk_format
2040 &&
type->primary_mapping
2041 &&
type->rtp_code == code
2056 if (
type->asterisk_format
2057 &&
type->primary_mapping
2099 if (!
type->asterisk_format
2100 &&
type->rtp_code == code
2118 if (
type->asterisk_format
2172 const char *res =
"";
2202 unsigned int res = 0;
2244 if (rtp_capability & x) {
2374 res = instance->
engine->
fd(instance, rtcp);
2389 if (!strcasecmp(glue->
type,
type)) {
2430 *vinstance_dst =
NULL, *vinstance_src =
NULL,
2431 *tinstance_dst =
NULL, *tinstance_src =
NULL;
2441 if (!cap_src || !cap_dst) {
2451 audio_glue_dst_res = glue_dst->
get_rtp_info(c_dst, &instance_dst);
2454 audio_glue_src_res = glue_src->
get_rtp_info(c_src, &instance_src);
2483 if (vinstance_dst && vinstance_src) {
2486 if (tinstance_dst && tinstance_src) {
2490 if (glue_dst->
update_peer(c_dst, instance_src, vinstance_src, tinstance_src, cap_src, 0)) {
2494 ast_debug(1,
"Seeded SDP of '%s' with that of '%s'\n",
2516 *vinstance0 =
NULL, *vinstance1 =
NULL,
2517 *tinstance0 =
NULL, *tinstance1 =
NULL;
2525 if (!c1 || !cap1 || !cap0) {
2571 if (glue0->
update_peer(c0, instance1, vinstance1, tinstance1, cap1, 0)) {
2600 res = instance->
engine->
red_init(instance, buffer_time, payloads, generations);
2626 if (!instance || !instance->
engine || !stats) {
2667 snprintf(
buf, size,
"ssrc=%u;themssrc=%u;lp=%u;rxjitter=%f;rxcount=%u;"
2668 "txjitter=%f;txcount=%u;rlp=%u;rtt=%f;rxmes=%f;txmes=%f",
2673 snprintf(
buf, size,
"minrxjitter=%010.6f;maxrxjitter=%010.6f;avgrxjitter=%010.6f;stdevrxjitter=%010.6f;mintxjitter=%010.6f;maxtxjitter=%010.6f;avgtxjitter=%010.6f;stdevtxjitter=%010.6f;",
2676 snprintf(
buf, size,
" minrxlost=%010.6f; maxrxlost=%010.6f; avgrxlost=%010.6f; stdevrxlost=%010.6f; mintxlost=%010.6f; maxtxlost=%010.6f; avgtxlost=%010.6f; stdevtxlost=%010.6f;",
2681 snprintf(
buf, size,
" minrxmes=%010.6f; maxrxmes=%010.6f; avgrxmes=%010.6f; stdevrxmes=%010.6f; mintxmes=%010.6f; maxtxmes=%010.6f; avgtxmes=%010.6f; stdevtxmes=%010.6f;",
2707 quality_buf,
sizeof(quality_buf));
2807 if (!peer_instance) {
2828 peer_instance =
NULL;
2863 const char *username)
2907 return instance->
glue;
2951 }
else if (remote_policy) {
2968 return instance->
srtp;
3026 const char *password;
3041 return local_candidates;
3061 const char *server,
unsigned int port,
const char *username,
const char *password)
3065 username, password);
3100#ifdef TEST_FRAMEWORK
3101struct ast_rtp_engine_test *ast_rtp_instance_get_test(
struct ast_rtp_instance *instance)
3103 return instance->
engine->test;
3110 int set_configuration;
3115 return set_configuration;
3149 return get_connection;
3185 return get_fingerprint_hash;
3190 const char *get_fingerprint;
3195 return get_fingerprint;
3222 if (!strcasecmp(
name,
"dtlsenable")) {
3224 }
else if (!strcasecmp(
name,
"dtlsverify")) {
3225 if (!strcasecmp(
value,
"yes")) {
3227 }
else if (!strcasecmp(
value,
"fingerprint")) {
3229 }
else if (!strcasecmp(
value,
"certificate")) {
3231 }
else if (!strcasecmp(
value,
"no")) {
3236 }
else if (!strcasecmp(
name,
"dtlsrekey")) {
3237 if (sscanf(
value,
"%30u", &dtls_cfg->
rekey) != 1) {
3240 }
else if (!strcasecmp(
name,
"dtlsautogeneratecert")) {
3242 }
else if (!strcasecmp(
name,
"dtlscertfile")) {
3249 }
else if (!strcasecmp(
name,
"dtlsprivatekey")) {
3256 }
else if (!strcasecmp(
name,
"dtlscipher")) {
3259 }
else if (!strcasecmp(
name,
"dtlscafile")) {
3266 }
else if (!strcasecmp(
name,
"dtlscapath") || !strcasecmp(
name,
"dtlscadir")) {
3273 }
else if (!strcasecmp(
name,
"dtlssetup")) {
3274 if (!strcasecmp(
value,
"active")) {
3276 }
else if (!strcasecmp(
value,
"passive")) {
3278 }
else if (!strcasecmp(
value,
"actpass")) {
3281 }
else if (!strcasecmp(
name,
"dtlsfingerprint")) {
3282 if (!strcasecmp(
value,
"sha-256")) {
3284 }
else if (!strcasecmp(
value,
"sha-1")) {
3298 ast_log(
LOG_ERROR,
"You cannot request automatically generated certificates"
3299 " (dtls_auto_generate_cert) and also specify a certificate file"
3300 " (dtls_cert_file) at the same time\n");
3306 " ignored when dtls_auto_generate_cert is enabled\n");
3507 if (!packet_string) {
3513 if (!channel_string) {
3518 if (payload->
blob) {
3540 ast_str_append(&packet_string, 0,
"ReportCount: %u\r\n", report_count);
3553 for (i = 0; i < report_count; i++) {
3561 if (!report_string) {
3565 ast_str_append(&report_string, 0,
"Report%dSourceSSRC: 0x%.8x\r\n",
3567 ast_str_append(&report_string, 0,
"Report%dFractionLost: %d\r\n",
3569 ast_str_append(&report_string, 0,
"Report%dCumulativeLost: %u\r\n",
3571 ast_str_append(&report_string, 0,
"Report%dHighestSequence: %u\r\n",
3573 ast_str_append(&report_string, 0,
"Report%dSequenceNumberCycles: %u\r\n",
3587 AS_OR(channel_string,
""),
3596 struct ast_json *json_rtcp_report_blocks;
3602 if (!json_rtcp_report_blocks) {
3607 struct ast_json *json_report_block;
3611 json_report_block =
ast_json_pack(
"{s: I, s: I, s: I, s: I, s: I, s: s, s: I}",
3619 if (!json_report_block
3632 json_rtcp_sender_info =
ast_json_pack(
"{s: s, s: s, s: I, s: I, s: I}",
3633 "ntp_timestamp_sec", sec,
3634 "ntp_timestamp_usec", usec,
3638 if (!json_rtcp_sender_info) {
3644 json_rtcp_report =
ast_json_pack(
"{s: I, s: I, s: i, s: o, s: o}",
3648 "sender_information", json_rtcp_sender_info ?:
ast_json_null(),
3649 "report_blocks", json_rtcp_report_blocks);
3650 if (!json_rtcp_report) {
3656 if (!json_channel) {
3664 "channel", json_channel,
3665 "rtcp_report", json_rtcp_report,
3666 "blob", payload->
blob);
3698 if (!message_type) {
3703 if (!payload || !report) {
3711 payload->blob = blob;
3715 payload->report = report;
3911 #ifdef USE_DEPRECATED_G726
4013 unsigned int ssrc = 0;
4026 const char *cname =
"";
4072#ifdef TEST_FRAMEWORK
4073size_t ast_rtp_instance_get_recv_buffer_max(
struct ast_rtp_instance *instance)
4076 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4084 res =
test->recv_buffer_max(instance);
4090size_t ast_rtp_instance_get_recv_buffer_count(
struct ast_rtp_instance *instance)
4093 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4101 res =
test->recv_buffer_count(instance);
4107size_t ast_rtp_instance_get_send_buffer_count(
struct ast_rtp_instance *instance)
4110 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4118 res =
test->send_buffer_count(instance);
4124void ast_rtp_instance_set_schedid(
struct ast_rtp_instance *instance,
int id)
4126 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4134 test->set_schedid(instance,
id);
4138void ast_rtp_instance_drop_packets(
struct ast_rtp_instance *instance,
int num)
4140 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4147 test->packets_to_drop = num;
4152 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4159 test->send_report = 1;
4164 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4171 return test->sdes_received;
4176 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
4183 test->packets_to_drop = 0;
4184 test->send_report = 0;
4185 test->sdes_received = 0;
Prototypes for public functions only of internal interest,.
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
int ast_register_atexit(void(*func)(void))
Register a function to be executed before Asterisk exits.
#define ast_strdup(str)
A wrapper for strdup()
#define ast_strdupa(s)
duplicate a string in memory from the stack
@ AO2_ALLOC_OPT_LOCK_NOLOCK
#define ao2_replace(dst, src)
Replace one object reference with another cleaning up the original.
#define ao2_ref(o, delta)
Reference/unreference an object and return the old refcount.
#define ao2_alloc_options(data_size, destructor_fn, options)
#define ao2_t_cleanup(obj, tag)
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
#define ao2_alloc(data_size, destructor_fn)
General Asterisk PBX channel definitions.
const char * ast_channel_name(const struct ast_channel *chan)
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
#define ast_channel_lock(chan)
#define ast_channel_lock_both(chan1, chan2)
Lock two channels.
#define ast_channel_unref(c)
Decrease channel reference count.
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
#define AST_MAX_USER_FIELD
#define ast_channel_unlock(chan)
static struct ao2_container * codecs
Registered codecs.
ast_media_type
Types of media.
const char * ast_codec_media_type2str(enum ast_media_type type)
Conversion function to take a media type and turn it into a string.
static int replace(struct ast_channel *chan, const char *cmd, char *data, struct ast_str **buf, ssize_t len)
struct stasis_message_type * ast_rtp_rtcp_sent_type(void)
Message type for an RTCP message sent from this Asterisk instance.
struct ast_channel_snapshot * ast_channel_snapshot_get_latest(const char *uniqueid)
Obtain the latest ast_channel_snapshot from the Stasis Message Bus API cache. This is an ao2 object,...
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
struct stasis_message_type * ast_rtp_rtcp_received_type(void)
Message type for an RTCP message received from some external source.
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
int ast_option_rtpusedynamic
unsigned int ast_option_rtpptdynamic
Support for logging to various files, console and syslog Configuration in file logger....
#define ast_debug(level,...)
Log a DEBUG message.
#define ast_verb(level,...)
Asterisk JSON abstraction layer.
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
struct ast_json * ast_json_null(void)
Get the JSON null value.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
struct ast_json * ast_json_real_create(double value)
Create a JSON real number.
AST_JSON_INT_T ast_json_int_t
Primarily used to cast when packing to an "I" type.
double ast_json_real_get(const struct ast_json *real)
Get the value from a JSON real number.
A set of macros to manage forward-linked lists.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
#define AST_RWLIST_REMOVE
#define AST_RWLIST_TRAVERSE
#define AST_RWLIST_INSERT_TAIL
Asterisk locking-related definitions:
#define ast_rwlock_wrlock(a)
#define ast_rwlock_rdlock(a)
#define ast_rwlock_init(rwlock)
wrapper for rwlock with tracking enabled
#define ast_rwlock_destroy(rwlock)
#define ast_rwlock_unlock(a)
#define ast_rwlock_tryrdlock(a)
uintmax_t ast_debug_category_register(const char *name)
Register a debug level logger category.
int ast_debug_category_unregister(const char *name)
Un-register a debug level logger category.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define EVENT_FLAG_REPORTING
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
struct ast_manager_event_blob * ast_manager_event_blob_create(int event_flags, const char *manager_event, const char *extra_fields_fmt,...)
Construct a ast_manager_event_blob.
Asterisk module definitions.
#define ast_module_unref(mod)
Release a reference to the module.
#define ast_module_running_ref(mod)
Hold a reference to the module if it is running.
def ignore(key=None, val=None, section=None, pjsip=None, nmapped=None, type='endpoint')
static void ast_sockaddr_copy(struct ast_sockaddr *dst, const struct ast_sockaddr *src)
Copies the data from one ast_sockaddr to another.
int ast_sockaddr_cmp(const struct ast_sockaddr *a, const struct ast_sockaddr *b)
Compares two ast_sockaddr structures.
Options provided by main asterisk program.
Core PBX routines and definitions.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
static void to_ami(struct ast_sip_subscription *sub, struct ast_str **buf)
static struct ast_srtp_res srtp_res
static struct ast_srtp_policy_res policy_res
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
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.
static enum ast_rtp_dtls_connection rtp_dtls_wrap_get_connection(struct ast_rtp_instance *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_srtp_res * res_srtp
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)
static void rtp_ice_wrap_turn_request(struct ast_rtp_instance *instance, enum ast_rtp_ice_component_type component, enum ast_transport transport, const char *server, unsigned int port, const char *username, const char *password)
static void rtp_payload_type_dtor(void *obj)
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.
static struct ast_rtp_engine_ice rtp_ice_wrappers
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.
static uintmax_t debug_category_dtls_packet_id
static const char * rtp_dtls_wrap_get_fingerprint(struct ast_rtp_instance *instance)
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)
static void rtp_ice_wrap_stop(struct ast_rtp_instance *instance)
int ast_rtp_engine_srtp_is_registered(void)
static void rtp_ice_wrap_add_remote_candidate(struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate)
static struct ast_rtp_payload_type * static_RTP_PT[AST_RTP_MAX_PT]
Mapping between Asterisk codecs and rtp payload types.
static const char * rtp_ice_wrap_get_ufrag(struct ast_rtp_instance *instance)
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.
static void rtcp_message_payload_dtor(void *obj)
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.
static struct ast_rtp_mime_type ast_rtp_mime_types[128]
static void rtp_ice_wrap_ice_lite(struct ast_rtp_instance *instance)
static void rtp_ice_wrap_set_role(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role)
void ast_rtp_engine_unregister_srtp(void)
static int rtp_codecs_assign_payload_code_rx(struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code, int explicit, unsigned int sample_rate)
static const char * rtp_ice_wrap_get_password(struct ast_rtp_instance *instance)
static void rtp_ice_wrap_start(struct ast_rtp_instance *instance)
uintmax_t ast_debug_category_rtp_id(void)
static uintmax_t debug_category_rtcp_id
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.
static struct stasis_topic * rtp_topic
Stasis Message Bus API topic for RTP related messages
void ast_rtp_instance_set_keepalive(struct ast_rtp_instance *instance, int interval)
Set the RTP keepalive interval.
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.
static enum ast_rtp_extension_direction rtp_extmap_negotiate_direction(enum ast_rtp_extension_direction ours, enum ast_rtp_extension_direction theirs)
Helper function which negotiates two RTP extension directions to get our current direction.
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.
static void rtp_engine_shutdown(void)
#define SET_AST_JSON_OBJ(target, name, obj)
Set given json object into target with name.
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_get_data(struct ast_rtp_instance *instance)
Get the data portion of an RTP instance.
struct ast_srtp_policy_res * res_srtp_policy
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.
static enum ast_rtp_dtls_setup rtp_dtls_wrap_get_setup(struct ast_rtp_instance *instance)
static void rtp_ice_wrap_change_components(struct ast_rtp_instance *instance, int num_components)
static void rtp_dtls_wrap_set_fingerprint(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint)
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.
static void rtp_dtls_wrap_stop(struct ast_rtp_instance *instance)
void ast_rtp_instance_set_last_tx(struct ast_rtp_instance *rtp, time_t time)
Set the last RTP transmission time.
static void add_static_payload(int payload, struct ast_format *format, int rtp_code)
static ast_rwlock_t static_RTP_PT_lock
static void rtp_ice_wrap_set_authentication(struct ast_rtp_instance *instance, const char *ufrag, const char *password)
struct ast_frame * ast_rtp_instance_read(struct ast_rtp_instance *instance, int rtcp)
Receive a frame over RTP.
static int rtp_dtls_wrap_active(struct ast_rtp_instance *instance)
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.
static void rtp_dtls_wrap_set_setup(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup)
void ast_rtp_codecs_set_framing(struct ast_rtp_codecs *codecs, unsigned int framing)
Set the framing used for a set of codecs.
static void rtp_dtls_wrap_reset(struct ast_rtp_instance *instance)
static uintmax_t debug_category_rtcp_packet_id
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.
static void rtp_codecs_payloads_copy_tx(struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance)
static int rtp_codecs_find_non_primary_dynamic_rx(struct ast_rtp_codecs *codecs)
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.
static uintmax_t debug_category_ice_id
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.
static void rtp_codecs_payloads_copy_rx(struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance)
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.
static int mime_types_len
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.
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.
int ast_rtp_engine_init(void)
initializes the rtp engine arrays
int ast_rtp_glue_register2(struct ast_rtp_glue *glue, struct ast_module *module)
Register RTP glue.
static void rtp_codecs_payload_set_rx(struct ast_rtp_codecs *codecs, int payload, struct ast_rtp_payload_type *new_type, int replace)
static struct ast_rtp_engine_dtls rtp_dtls_wrappers
uintmax_t ast_debug_category_dtls_packet_id(void)
static void rtp_engine_atexit(void)
static void rtp_rtcp_report_dtor(void *obj)
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.
static uintmax_t debug_category_rtp_id
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.
static struct ao2_container * rtp_ice_wrap_get_local_candidates(struct ast_rtp_instance *instance)
static void rtp_engine_mime_type_cleanup(int i)
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.
int ast_rtp_codecs_payloads_initialize(struct ast_rtp_codecs *codecs)
Initialize an RTP codecs structure.
static uintmax_t debug_category_rtp_packet_id
static struct ast_rtp_payload_type * rtp_payload_type_alloc(struct ast_format *format, int payload, int rtp_code, int primary_mapping, unsigned int sample_rate)
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.
static uintmax_t debug_category_dtls_id
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...
static void payload_mapping_rx_clear_primary(struct ast_rtp_codecs *codecs, struct ast_rtp_payload_type *to_match)
static int find_unused_payload_in_range(const struct ast_rtp_codecs *codecs, int start, int end, struct ast_rtp_payload_type *ignore[])
static void set_next_mime_type(struct ast_format *format, int rtp_code, const char *type, const char *subtype, unsigned int sample_rate)
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.
static void unref_instance_cond(struct ast_rtp_instance **instance)
Conditionally unref an rtp instance.
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.
static struct ast_json * rtcp_report_to_json(struct stasis_message *msg, const struct stasis_message_sanitizer *sanitize)
int ast_rtp_engine_register2(struct ast_rtp_engine *engine, struct ast_module *module)
Register an RTP engine.
static void rtp_codecs_payload_replace_rx(struct ast_rtp_codecs *codecs, int payload, struct ast_rtp_payload_type *new_type)
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.
static enum ast_rtp_dtls_hash rtp_dtls_wrap_get_fingerprint_hash(struct ast_rtp_instance *instance)
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.
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.
static int find_static_payload_type(int asterisk_format, const struct ast_format *format, int code)
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.
static struct ast_manager_event_blob * rtcp_report_to_ami(struct stasis_message *msg)
void ast_rtp_instance_set_stream_num(struct ast_rtp_instance *rtp, int stream_num)
Set the stream number for an RTP instance.
int ast_rtp_codecs_get_preferred_dtmf_format_pt(struct ast_rtp_codecs *codecs)
Retrieve rx preferred dtmf format payload type.
static const char *const rtp_extension_uris[AST_RTP_EXTENSION_MAX]
URIs for known RTP extensions.
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.
static int find_unused_payload(const struct ast_rtp_codecs *codecs)
static int rtp_dtls_wrap_set_configuration(struct ast_rtp_instance *instance, const struct ast_rtp_dtls_cfg *dtls_cfg)
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.
STASIS_MESSAGE_TYPE_DEFN(ast_rtp_rtcp_sent_type,.to_ami=rtcp_report_to_ami,.to_json=rtcp_report_to_json,)
Define RTCP/RTP message types.
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.
static void rtp_instance_set_incoming_source_address_nolock(struct ast_rtp_instance *instance, const struct ast_sockaddr *address)
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.
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.
static void instance_destructor(void *obj)
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.
static int payload_mapping_tx_is_present(const struct ast_rtp_codecs *codecs, const struct ast_rtp_payload_type *to_match)
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.
static ast_rwlock_t mime_types_lock
Pluggable RTP Architecture.
ast_rtp_dtls_setup
DTLS setup types.
@ AST_RTP_DTLS_SETUP_PASSIVE
@ AST_RTP_DTLS_SETUP_ACTPASS
@ AST_RTP_DTLS_SETUP_ACTIVE
ast_rtp_ice_role
ICE role during negotiation.
#define AST_RTP_PT_LAST_REASSIGN
ast_rtp_ice_component_type
ICE component types.
ast_rtp_dtls_hash
DTLS fingerprint hashes.
@ AST_RTP_DTLS_HASH_SHA256
#define AST_LOG_CATEGORY_ICE
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
@ AST_RTP_DTLS_VERIFY_NONE
@ AST_RTP_DTLS_VERIFY_FINGERPRINT
@ AST_RTP_DTLS_VERIFY_CERTIFICATE
@ AST_RTP_GLUE_RESULT_REMOTE
@ AST_RTP_GLUE_RESULT_FORBID
#define AST_LOG_CATEGORY_RTCP_PACKET
@ AST_RTP_INSTANCE_STAT_COMBINED_MES
@ AST_RTP_INSTANCE_STAT_COMBINED_JITTER
@ AST_RTP_INSTANCE_STAT_COMBINED_LOSS
@ AST_RTP_INSTANCE_STAT_COMBINED_RTT
@ AST_RTP_INSTANCE_STAT_ALL
#define AST_LOG_CATEGORY_DTLS
#define AST_LOG_CATEGORY_RTCP
#define ast_debug_rtp(sublevel,...)
Log debug level RTP information.
#define AST_LOG_CATEGORY_RTP
#define ast_debug_rtp_is_allowed
ast_rtp_extension
Known RTP extensions.
@ AST_RTP_EXTENSION_TRANSPORT_WIDE_CC
@ AST_RTP_EXTENSION_ABS_SEND_TIME
@ AST_RTP_EXTENSION_UNSUPPORTED
#define AST_RTP_PT_FIRST_DYNAMIC
@ AST_RTP_OPT_G726_NONSTANDARD
ast_rtp_dtls_connection
DTLS connection states.
@ AST_RTP_PROPERTY_MAX
Maximum number of RTP properties supported.
#define AST_LOG_CATEGORY_RTP_PACKET
#define AST_RTP_PT_LAST_STATIC
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
#define AST_LOG_CATEGORY_DTLS_PACKET
#define AST_RTP_CISCO_DTMF
Scheduler Routines (derived from cheops)
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
struct ast_json * ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot, const struct stasis_message_sanitizer *sanitize)
Build a JSON object from a ast_channel_snapshot.
String manipulation functions.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true"....
static force_inline char * ast_str_to_upper(char *str)
Convert a string to all upper-case.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
Structure representing a snapshot of channel state.
Main Channel structure associated with a channel.
struct ast_bridge * bridge
Data structure associated with a single frame of data.
Abstract JSON element (object, array, string, int, ...).
Struct containing info for an AMI event to send out.
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)
const char *(* get_fingerprint)(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.
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)
const char *(* get_ufrag)(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)
const char *(* get_password)(struct ast_rtp_instance *instance)
void(* set_role)(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role)
struct ao2_container *(* get_local_candidates)(struct ast_rtp_instance *instance)
int(* get_stat)(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat)
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)
void *(* extended_prop_get)(struct ast_rtp_instance *instance, int property)
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(* new)(struct ast_rtp_instance *instance, struct ast_sched_context *sched, struct ast_sockaddr *sa, void *data)
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)
const char *(* cname_get)(struct ast_rtp_instance *instance)
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)
struct ast_frame *(* read)(struct ast_rtp_instance *instance, int rtcp)
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)
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_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_codecs codecs
struct ast_srtp * rtcp_srtp
struct ast_rtp_instance::@382 extmap_enabled
int properties[AST_RTP_PROPERTY_MAX]
struct ast_sockaddr incoming_source_address
struct ast_rtp_glue * glue
struct ast_rtp_instance::@383 extmap_negotiated
struct ast_sockaddr requested_target_address
struct ast_sockaddr local_address
struct ast_rtp_instance::@384 extmap_unique_ids
struct ast_rtp_instance * bridged
struct ast_rtp_engine * engine
char channel_uniqueid[AST_MAX_UNIQUEID]
unsigned int sample_rate
Expected sample rate of the /c subtype.
char subtype[64]
The format type.
char type[16]
The media type.
struct ast_rtp_payload_type payload_type
A mapping object between the Asterisk codec and this RTP payload.
unsigned int primary_mapping
struct ast_format * format
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.
void(* destroy)(struct ast_srtp *srtp)
int(* replace)(struct ast_srtp **srtp, struct ast_rtp_instance *rtp, struct ast_srtp_policy *policy)
int(* add_stream)(struct ast_srtp *srtp, struct ast_srtp_policy *policy)
int(* create)(struct ast_srtp **srtp, struct ast_rtp_instance *rtp, struct ast_srtp_policy *policy)
Support for dynamic strings.
structure to hold extensions
struct ast_rtp_rtcp_report * report
struct ast_channel_snapshot * snapshot
enum ast_rtp_extension extension
enum ast_rtp_extension_direction direction
Structure containing callbacks for Stasis message sanitization.
Time-related functions and macros.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
Support for translation of data formats. translate.c.
void ast_translate_available_formats(struct ast_format_cap *dest, struct ast_format_cap *src, struct ast_format_cap *result)
Find available formats.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
int ast_file_is_readable(const char *filename)
Test that a file exists and is readable by the effective user.
Vector container support.
#define AST_VECTOR_REPLACE(vec, idx, elem)
Replace an element at a specific position in a vector, growing the vector if needed.
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
#define AST_VECTOR(name, type)
Define a vector structure.
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
#define AST_VECTOR_GET_ADDR(vec, idx)
Get an address of element in a vector.