148 #include <sys/time.h> 247 #define MAX_RTP_MIME_TYPES 128 288 #define SET_AST_JSON_OBJ(target, name, obj) ({ \ 289 struct ast_json *j_tmp = obj; \ 291 ast_json_object_set(target, name, j_tmp); \ 341 engine->
mod = module;
347 if (!strcmp(current_engine->
name, engine->
name)) {
359 ast_verb(2,
"Registered RTP engine '%s'\n", engine->
name);
371 ast_verb(2,
"Unregistered RTP engine '%s'\n", engine->
name);
376 return current_engine ? 0 : -1;
392 if (!strcasecmp(current_glue->
type, glue->
type)) {
415 ast_verb(2,
"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);
479 if (!strcmp(engine->
name, engine_name)) {
509 instance->
engine = engine;
526 ast_debug(1,
"Using engine '%s' for RTP instance '%p'\n", engine->
name, instance);
535 if (instance->
engine->
new(instance, sched, &address, data)) {
536 ast_debug(1,
"Engine '%s' failed to setup RTP instance '%p'\n", engine->
name, instance);
543 ast_debug(1,
"RTP instance '%p' is setup and ready to go\n", instance);
560 instance->
data = data;
565 return instance->
data;
583 frame = instance->
engine->
read(instance, rtcp);
819 const char *uri,
const char *attributes)
864 static const struct rtp_extmap extmap_none = {
875 for (idx = 0; idx <
AST_VECTOR_SIZE(&instance->extmap_unique_ids); ++idx) {
879 for (idx = 0; idx <
AST_VECTOR_SIZE(&instance->extmap_negotiated); ++idx) {
979 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_rx); ++idx) {
985 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_tx); ++idx) {
1034 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_rx); ++idx) {
1057 *new_type = *current;
1084 "cleaning up rx mapping vector element about to be replaced");
1113 for (idx = 0; idx <
AST_VECTOR_SIZE(&src->payload_mapping_rx); ++idx) {
1119 ast_debug(2,
"Copying rx payload mapping %d (%p) from %p to %p\n",
1120 idx, type, src, dest);
1149 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_tx); ++idx) {
1155 if (current == to_match) {
1198 for (idx = 0; idx <
AST_VECTOR_SIZE(&src->payload_mapping_tx); ++idx) {
1204 ast_debug(2,
"Copying tx payload mapping %d (%p) from %p to %p\n",
1205 idx, type, src, dest);
1209 "cleaning up tx mapping vector element about to be replaced");
1243 for (idx = 0; idx <
AST_VECTOR_SIZE(&dest->payload_mapping_tx); ++idx) {
1273 for (idx = 0; idx <
AST_VECTOR_SIZE(&src->payload_mapping_tx); ++idx) {
1282 ast_debug(2,
"Crossover copying tx to rx payload mapping %d (%p) from %p to %p\n",
1283 idx, type, src, dest);
1310 new_type =
ao2_bump(static_RTP_PT[payload]);
1313 ast_debug(1,
"Don't have a default tx payload type %d format for m type on %p\n",
1318 ast_debug(1,
"Setting tx payload type %d based on m type on %p\n",
1326 "cleaning up replaced tx payload type");
1344 char *mimetype,
char *mimesubtype,
1346 unsigned int sample_rate)
1362 if (strcasecmp(mimesubtype, t->
subtype)) {
1366 if (strcasecmp(mimetype, t->
type)) {
1405 "cleaning up replaced tx payload type");
1425 return (found ? 0 : -2);
1441 ast_debug(2,
"Unsetting payload %d on %p\n", payload, codecs);
1496 type =
ao2_bump(static_RTP_PT[payload]);
1571 unsigned int framing;
1589 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_tx); ++idx) {
1629 if (!asterisk_format) {
1631 if (static_RTP_PT[idx]
1632 && !static_RTP_PT[idx]->asterisk_format
1633 && static_RTP_PT[idx]->
rtp_code == code) {
1638 }
else if (format) {
1640 if (static_RTP_PT[idx]
1641 && static_RTP_PT[idx]->asterisk_format
1672 for (x = start; x <
end; ++x) {
1677 }
else if (!codecs || x >=
AST_VECTOR_SIZE(&codecs->payload_mapping_rx)) {
1720 ignore[101] = static_RTP_PT[101];
1721 ignore[121] = static_RTP_PT[121];
1781 struct timeval oldest;
1851 }
else if (
explicit) {
1880 if (!asterisk_format) {
1882 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_rx); ++idx) {
1896 }
else if (format) {
1898 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_rx); ++idx) {
1934 if (!asterisk_format) {
1936 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_tx); ++idx) {
1949 }
else if (format) {
1951 for (idx = 0; idx <
AST_VECTOR_SIZE(&codecs->payload_mapping_tx); ++idx) {
1996 const char *res =
"";
2000 if (
ast_rtp_mime_types[i].payload_type.asterisk_format && asterisk_format && format &&
2010 }
else if (!
ast_rtp_mime_types[i].payload_type.asterisk_format && !asterisk_format &&
2026 unsigned int res = 0;
2030 if (
ast_rtp_mime_types[i].payload_type.asterisk_format && asterisk_format && format &&
2034 }
else if (!
ast_rtp_mime_types[i].payload_type.asterisk_format && !asterisk_format &&
2054 if (asterisk_format) {
2066 ast_str_append(&buf, 0,
"0x%x (", (
unsigned int) rtp_capability);
2068 if (rtp_capability & x) {
2175 res = instance->
engine->
qos(instance, tos, cos, desc);
2198 res = instance->
engine->
fd(instance, rtcp);
2213 if (!strcasecmp(glue->
type, type)) {
2254 *vinstance_dst =
NULL, *vinstance_src =
NULL,
2255 *tinstance_dst =
NULL, *tinstance_src =
NULL;
2265 if (!cap_src || !cap_dst) {
2275 audio_glue_dst_res = glue_dst->
get_rtp_info(c_dst, &instance_dst);
2278 audio_glue_src_res = glue_src->
get_rtp_info(c_src, &instance_src);
2307 if (vinstance_dst && vinstance_src) {
2310 if (tinstance_dst && tinstance_src) {
2314 if (glue_dst->
update_peer(c_dst, instance_src, vinstance_src, tinstance_src, cap_src, 0)) {
2318 ast_debug(1,
"Seeded SDP of '%s' with that of '%s'\n",
2340 *vinstance0 =
NULL, *vinstance1 =
NULL,
2341 *tinstance0 =
NULL, *tinstance1 =
NULL;
2349 if (!c1 || !cap1 || !cap0) {
2395 if (glue0->
update_peer(c0, instance1, vinstance1, tinstance1, cap1, 0)) {
2424 res = instance->
engine->
red_init(instance, buffer_time, payloads, generations);
2485 snprintf(buf, size,
"ssrc=%u;themssrc=%u;lp=%u;rxjitter=%f;rxcount=%u;txjitter=%f;txcount=%u;rlp=%u;rtt=%f",
2488 snprintf(buf, size,
"minrxjitter=%f;maxrxjitter=%f;avgrxjitter=%f;stdevrxjitter=%f;reported_minjitter=%f;reported_maxjitter=%f;reported_avgjitter=%f;reported_stdevjitter=%f;",
2491 snprintf(buf, size,
"minrxlost=%f;maxrxlost=%f;avgrxlost=%f;stdevrxlost=%f;reported_minlost=%f;reported_maxlost=%f;reported_avglost=%f;reported_stdevlost=%f;",
2516 quality_buf,
sizeof(quality_buf));
2607 if (!peer_instance) {
2628 peer_instance =
NULL;
2663 const char *username)
2707 return instance->
glue;
2712 if (res_srtp || res_srtp_policy) {
2715 if (!srtp_res || !policy_res) {
2728 res_srtp_policy =
NULL;
2750 res = res_srtp->
create(srtp, instance, remote_policy);
2751 }
else if (remote_policy) {
2752 res = res_srtp->
replace(srtp, instance, remote_policy);
2755 res = res_srtp->
add_stream(*srtp, local_policy);
2768 return instance->
srtp;
2841 return local_candidates;
2861 const char *server,
unsigned int port,
const char *username,
const char *
password)
2865 username, password);
2900 #ifdef TEST_FRAMEWORK 2910 int set_configuration;
2915 return set_configuration;
2949 return get_connection;
2985 return get_fingerprint_hash;
2990 const char *get_fingerprint;
2995 return get_fingerprint;
3022 if (!strcasecmp(name,
"dtlsenable")) {
3024 }
else if (!strcasecmp(name,
"dtlsverify")) {
3025 if (!strcasecmp(value,
"yes")) {
3027 }
else if (!strcasecmp(value,
"fingerprint")) {
3029 }
else if (!strcasecmp(value,
"certificate")) {
3031 }
else if (!strcasecmp(value,
"no")) {
3036 }
else if (!strcasecmp(name,
"dtlsrekey")) {
3037 if (sscanf(value,
"%30u", &dtls_cfg->
rekey) != 1) {
3040 }
else if (!strcasecmp(name,
"dtlsautogeneratecert")) {
3042 }
else if (!strcasecmp(name,
"dtlscertfile")) {
3044 ast_log(
LOG_ERROR,
"%s file %s does not exist or is not readable\n", name, value);
3049 }
else if (!strcasecmp(name,
"dtlsprivatekey")) {
3051 ast_log(
LOG_ERROR,
"%s file %s does not exist or is not readable\n", name, value);
3056 }
else if (!strcasecmp(name,
"dtlscipher")) {
3059 }
else if (!strcasecmp(name,
"dtlscafile")) {
3061 ast_log(
LOG_ERROR,
"%s file %s does not exist or is not readable\n", name, value);
3066 }
else if (!strcasecmp(name,
"dtlscapath") || !strcasecmp(name,
"dtlscadir")) {
3068 ast_log(
LOG_ERROR,
"%s file %s does not exist or is not readable\n", name, value);
3073 }
else if (!strcasecmp(name,
"dtlssetup")) {
3074 if (!strcasecmp(value,
"active")) {
3076 }
else if (!strcasecmp(value,
"passive")) {
3078 }
else if (!strcasecmp(value,
"actpass")) {
3081 }
else if (!strcasecmp(name,
"dtlsfingerprint")) {
3082 if (!strcasecmp(value,
"sha-256")) {
3084 }
else if (!strcasecmp(value,
"sha-1")) {
3098 ast_log(
LOG_ERROR,
"You cannot request automatically generated certificates" 3099 " (dtls_auto_generate_cert) and also specify a certificate file" 3100 " (dtls_cert_file) at the same time\n");
3106 " ignored when dtls_auto_generate_cert is enabled\n");
3253 if (static_RTP_PT[x]
3255 ao2_ref(static_RTP_PT[x], -1);
3256 static_RTP_PT[x] =
NULL;
3307 if (!packet_string) {
3313 if (!channel_string) {
3318 if (payload->
blob) {
3336 ast_str_append(&packet_string, 0,
"ReportCount: %u\r\n", report_count);
3349 for (i = 0; i < report_count; i++) {
3357 if (!report_string) {
3361 ast_str_append(&report_string, 0,
"Report%dSourceSSRC: 0x%.8x\r\n",
3363 ast_str_append(&report_string, 0,
"Report%dFractionLost: %d\r\n",
3365 ast_str_append(&report_string, 0,
"Report%dCumulativeLost: %u\r\n",
3367 ast_str_append(&report_string, 0,
"Report%dHighestSequence: %u\r\n",
3369 ast_str_append(&report_string, 0,
"Report%dSequenceNumberCycles: %u\r\n",
3383 AS_OR(channel_string,
""),
3392 struct ast_json *json_rtcp_report_blocks;
3398 if (!json_rtcp_report_blocks) {
3403 struct ast_json *json_report_block;
3407 json_report_block =
ast_json_pack(
"{s: I, s: I, s: I, s: I, s: I, s: s, s: I}",
3415 if (!json_report_block
3428 json_rtcp_sender_info =
ast_json_pack(
"{s: s, s: s, s: I, s: I, s: I}",
3429 "ntp_timestamp_sec", sec,
3430 "ntp_timestamp_usec", usec,
3434 if (!json_rtcp_sender_info) {
3440 json_rtcp_report =
ast_json_pack(
"{s: I, s: I, s: i, s: o, s: o}",
3444 "sender_information", json_rtcp_sender_info ?:
ast_json_null(),
3445 "report_blocks", json_rtcp_report_blocks);
3446 if (!json_rtcp_report) {
3452 if (!json_channel) {
3459 "channel", json_channel,
3460 "rtcp_report", json_rtcp_report,
3461 "blob", payload->
blob);
3493 if (!message_type) {
3498 if (!payload || !report) {
3506 payload->blob = blob;
3510 payload->report = report;
3597 static_RTP_PT[x] =
NULL;
3688 #ifdef USE_DEPRECATED_G726 3780 unsigned int ssrc = 0;
3793 const char *cname =
"";
3839 #ifdef TEST_FRAMEWORK uintmax_t ast_debug_category_rtcp_packet_id(void)
static enum ast_rtp_dtls_connection rtp_dtls_wrap_get_connection(struct ast_rtp_instance *instance)
#define AST_VECTOR_FREE(vec)
Deallocates this vector.
struct stasis_message_type * ast_rtp_rtcp_sent_type(void)
Message type for an RTCP message sent from this Asterisk 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.
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.
double local_normdevrxploss
int ast_rtp_instance_sendcng(struct ast_rtp_instance *instance, int level)
Send a comfort noise packet to the RTP instance.
int(* activate)(struct ast_rtp_instance *instance)
Struct containing info for an AMI event to send out.
An object that represents data sent during a SR/RR RTCP report.
int ast_rtp_codecs_payloads_initialize(struct ast_rtp_codecs *codecs)
Initialize an RTP codecs structure.
void ast_rtp_instance_extmap_clear(struct ast_rtp_instance *instance)
Clear negotiated RTP extension information.
#define ast_rwlock_rdlock(a)
#define ast_channel_lock(chan)
int ast_rtp_engine_unregister(struct ast_rtp_engine *engine)
Unregister an RTP engine.
Main Channel structure associated with a channel.
char type[16]
The media type.
int(* bundle)(struct ast_rtp_instance *child, struct ast_rtp_instance *parent)
static int mime_types_len
int ast_rtp_red_buffer(struct ast_rtp_instance *instance, struct ast_frame *frame)
Buffer a frame in an RTP instance for RED.
void(* prop_set)(struct ast_rtp_instance *instance, enum ast_rtp_property property, int value)
void(* payload_set)(struct ast_rtp_instance *instance, int payload, int asterisk_format, struct ast_format *format, int code)
void ast_rtp_instance_set_keepalive(struct ast_rtp_instance *instance, int interval)
Set the RTP keepalive interval.
struct ast_json * ast_json_ref(struct ast_json *value)
Increase refcount on value.
static void unref_instance_cond(struct ast_rtp_instance **instance)
Conditionally unref an rtp instance.
#define ao2_t_cleanup(obj, tag)
int(* set_configuration)(struct ast_rtp_instance *instance, const struct ast_rtp_dtls_cfg *dtls_cfg)
Asterisk locking-related definitions:
static void rtp_instance_set_incoming_source_address_nolock(struct ast_rtp_instance *instance, const struct ast_sockaddr *address)
static int find_unused_payload_in_range(const struct ast_rtp_codecs *codecs, int start, int end, struct ast_rtp_payload_type *ignore[])
Asterisk main include file. File version handling, generic pbx functions.
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...
void ast_rtp_codecs_set_framing(struct ast_rtp_codecs *codecs, unsigned int framing)
Set the framing used for a set of codecs.
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.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
static enum ast_rtp_dtls_hash rtp_dtls_wrap_get_fingerprint_hash(struct ast_rtp_instance *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.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
int(* set_write_format)(struct ast_rtp_instance *instance, struct ast_format *format)
struct ast_rtp_engine * ast_rtp_instance_get_engine(struct ast_rtp_instance *instance)
Get the RTP engine in use on an RTP instance.
void *(* extended_prop_get)(struct ast_rtp_instance *instance, int property)
String manipulation functions.
unsigned int highest_seq_no
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...
enum ast_rtp_dtmf_mode(* dtmf_mode_get)(struct ast_rtp_instance *instance)
static struct ast_rtp_engine_dtls rtp_dtls_wrappers
const char *(* get_password)(struct ast_rtp_instance *instance)
static void rtp_ice_wrap_set_role(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role)
const char *(* get_fingerprint)(struct ast_rtp_instance *instance)
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_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...
void ast_rtp_engine_unregister_srtp(void)
unsigned int ast_rtp_codecs_get_framing(struct ast_rtp_codecs *codecs)
Get the framing used for a set of codecs.
int(* sendcng)(struct ast_rtp_instance *instance, int level)
double remote_normdevjitter
char subtype[64]
The format 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(* write)(struct ast_rtp_instance *instance, struct ast_frame *frame)
#define ast_channel_unref(c)
Decrease channel reference count.
static ast_rwlock_t mime_types_lock
Support for translation of data formats. translate.c.
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.
static void ast_sockaddr_copy(struct ast_sockaddr *dst, const struct ast_sockaddr *src)
Copies the data from one ast_sockaddr to another.
#define ast_rwlock_destroy(rwlock)
int ast_rtp_engine_init(void)
initializes the rtp engine arrays
Time-related functions and macros.
void ast_json_unref(struct ast_json *value)
Decrease refcount on value. If refcount reaches zero, value is freed.
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.
#define STASIS_MESSAGE_TYPE_INIT(name)
Boiler-plate messaging macro for initializing message types.
uintmax_t ast_debug_category_rtp_id(void)
static void rtp_engine_shutdown(void)
const char * ast_rtp_instance_get_cname(struct ast_rtp_instance *rtp)
Retrieve the CNAME used in RTCP SDES items.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
static struct ast_rtp_mime_type ast_rtp_mime_types[128]
struct ast_frame *(* read)(struct ast_rtp_instance *instance, int rtcp)
uintmax_t ast_debug_category_dtls_packet_id(void)
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
int ast_rtp_engine_register_srtp(struct ast_srtp_res *srtp_res, struct ast_srtp_policy_res *policy_res)
void ast_rtp_instance_set_schedid(struct ast_rtp_instance *instance, int id)
Set the schedid for RTCP.
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.
#define AST_RTP_PT_LAST_STATIC
static void rtp_codecs_payloads_copy_rx(struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance)
int ast_file_is_readable(const char *filename)
Test that a file exists and is readable by the effective user.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
double remote_stdevjitter
AST_JSON_INT_T ast_json_int_t
Primarily used to cast when packing to an "I" type.
static void rtp_codecs_payload_replace_rx(struct ast_rtp_codecs *codecs, int payload, struct ast_rtp_payload_type *new_type)
static void instance_destructor(void *obj)
static int rtp_codecs_find_non_primary_dynamic_rx(struct ast_rtp_codecs *codecs)
int ast_rtp_engine_register2(struct ast_rtp_engine *engine, struct ast_module *module)
Register an RTP engine.
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_stop(struct ast_rtp_instance *instance)
Stop an RTP instance.
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.
static const char * rtp_dtls_wrap_get_fingerprint(struct ast_rtp_instance *instance)
void(* stop)(struct ast_rtp_instance *instance)
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 void rtp_ice_wrap_change_components(struct ast_rtp_instance *instance, int num_components)
void ast_rtp_instance_get_incoming_source_address(struct ast_rtp_instance *instance, struct ast_sockaddr *address)
Get the incoming source address of the remote endpoint.
#define AST_VECTOR_APPEND(vec, elem)
Append an element to a vector, growing the vector if needed.
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.
Structure representing a snapshot of channel state.
int(* dtmf_end)(struct ast_rtp_instance *instance, char digit)
static void rtp_ice_wrap_stop(struct ast_rtp_instance *instance)
static void rtp_dtls_wrap_stop(struct ast_rtp_instance *instance)
unsigned short reception_report_count
unsigned int ast_rtp_instance_get_ssrc(struct ast_rtp_instance *rtp)
Retrieve the local SSRC value that we will be using.
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.
#define STASIS_MESSAGE_TYPE_CLEANUP(name)
Boiler-plate messaging macro for cleaning up message types.
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.
struct ast_rtp_rtcp_report_block * report_block[0]
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(* 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)
struct stasis_message_type * stasis_message_type(const struct stasis_message *msg)
Get the message type for a stasis_message.
int ast_rtp_instance_get_prop(struct ast_rtp_instance *instance, enum ast_rtp_property property)
Get the value of an RTP instance property.
const char *(* cname_get)(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.
static struct ast_rtp_engine_ice rtp_ice_wrappers
void(* change_source)(struct ast_rtp_instance *instance)
void(* change_components)(struct ast_rtp_instance *instance, int num_components)
void(* add_remote_candidate)(struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate)
static struct ast_json * rtcp_report_to_json(struct stasis_message *msg, const struct stasis_message_sanitizer *sanitize)
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static void rtp_codecs_payloads_copy_tx(struct ast_rtp_codecs *src, struct ast_rtp_codecs *dest, struct ast_rtp_instance *instance)
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(* stop)(struct ast_rtp_instance *instance)
static void rtp_dtls_wrap_reset(struct ast_rtp_instance *instance)
static void rtp_ice_wrap_add_remote_candidate(struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate)
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.
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...
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
ast_rtp_extension
Known RTP extensions.
A report block within a SR/RR report.
static struct ast_manager_event_blob * rtcp_report_to_ami(struct stasis_message *msg)
#define ao2_alloc_options(data_size, destructor_fn, options)
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.
uintmax_t ast_debug_category_rtp_packet_id(void)
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.
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
#define ast_strdup(str)
A wrapper for strdup()
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.
void(* stop)(struct ast_rtp_instance *instance)
#define AST_RTP_PT_FIRST_DYNAMIC
void(* update_source)(struct ast_rtp_instance *instance)
int ast_rtp_instance_fd(struct ast_rtp_instance *instance, int rtcp)
Get the file descriptor for an RTP session (or RTCP)
int ast_sockaddr_cmp(const struct ast_sockaddr *a, const struct ast_sockaddr *b)
Compares two ast_sockaddr structures.
int ast_rtp_instance_dtmf_end_with_duration(struct ast_rtp_instance *instance, char digit, unsigned int duration)
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.
unsigned int rtp_timestamp
void ast_rtp_instance_set_channel_id(struct ast_rtp_instance *instance, const char *uniqueid)
Set the channel that owns this RTP instance.
static struct ast_srtp_res srtp_res
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.
int(* add_stream)(struct ast_srtp *srtp, struct ast_srtp_policy *policy)
#define ast_rwlock_unlock(a)
int(* make_compatible)(struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1)
Structure for an ICE candidate.
unsigned int sample_rate
Expected sample rate of the /c subtype.
Socket address structure.
void ast_rtp_codecs_payloads_destroy(struct ast_rtp_codecs *codecs)
Destroy the contents of an RTP codecs structure (but not the structure itself)
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.
static struct ast_str * password
int ast_rtp_instance_destroy(struct ast_rtp_instance *instance)
Destroy an RTP instance.
#define ast_verb(level,...)
enum ast_rtp_dtls_hash(* get_fingerprint_hash)(struct ast_rtp_instance *instance)
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.
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.
struct ast_rtp_rtcp_report::@315 sender_information
Structure containing callbacks for Stasis message sanitization.
uintmax_t ast_debug_category_ice_id(void)
enum ast_rtp_dtls_setup(* get_setup)(struct ast_rtp_instance *instance)
struct stasis_message_type * ast_rtp_rtcp_received_type(void)
Message type for an RTCP message received from some external source.
time_t ast_rtp_instance_get_last_tx(const struct ast_rtp_instance *rtp)
Get the last RTP transmission time.
void(* remote_address_set)(struct ast_rtp_instance *instance, struct ast_sockaddr *sa)
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)
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
void ast_translate_available_formats(struct ast_format_cap *dest, struct ast_format_cap *src, struct ast_format_cap *result)
Find available formats.
#define ast_module_unref(mod)
Release a reference to the module.
#define ast_strlen_zero(foo)
static void rtp_rtcp_report_dtor(void *obj)
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 add_static_payload(int payload, struct ast_format *format, int rtp_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.
int ast_rtp_instance_get_timeout(struct ast_rtp_instance *instance)
Get the RTP timeout value.
struct ast_json * ast_json_null(void)
Get the JSON null value.
static int rtp_dtls_wrap_active(struct ast_rtp_instance *instance)
struct ast_frame * ast_rtp_instance_read(struct ast_rtp_instance *instance, int rtcp)
Receive a frame over RTP.
int ast_rtp_glue_register2(struct ast_rtp_glue *glue, struct ast_module *module)
Register RTP glue.
#define AST_LOG_CATEGORY_DTLS
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.
enum ast_rtp_dtls_connection(* get_connection)(struct ast_rtp_instance *instance)
struct ast_rtp_codecs * ast_rtp_instance_get_codecs(struct ast_rtp_instance *instance)
Get the codecs structure of an RTP instance.
int(* destroy)(struct ast_rtp_instance *instance)
#define ast_rwlock_tryrdlock(a)
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
size_t(* send_buffer_count)(struct ast_rtp_instance *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_dtmf_begin(struct ast_rtp_instance *instance, char digit)
Begin sending a DTMF digit.
int ast_rtp_instance_get_sdes_received(struct ast_rtp_instance *instance)
Get the value of sdes_received on the test engine.
struct ast_rtp_payload_type payload_type
A mapping object between the Asterisk codec and this RTP payload.
struct ast_rtp_engine_dtls * dtls
#define ast_debug(level,...)
Log a DEBUG message.
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.
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.
int(* red_buffer)(struct ast_rtp_instance *instance, struct ast_frame *frame)
static uintmax_t debug_category_dtls_packet_id
static uintmax_t debug_category_rtp_id
#define AST_VECTOR_INIT(vec, size)
Initialize a vector.
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...
int ast_rtp_instance_get_keepalive(struct ast_rtp_instance *instance)
Get the RTP keepalive interval.
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.
General Asterisk PBX channel definitions.
Asterisk JSON abstraction layer.
#define AST_VECTOR_GET_ADDR(vec, idx)
Get an address of element in a vector.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
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.
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.
struct ast_rtp_payload_type * ast_rtp_engine_alloc_payload_type(void)
Allocation routine for ast_rtp_payload_type.
int ast_rtp_instance_write(struct ast_rtp_instance *instance, struct ast_frame *frame)
Send a frame out over RTP.
size_t ast_rtp_instance_get_send_buffer_count(struct ast_rtp_instance *instance)
Get the current size of the send buffer.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
Maximum number of RTP properties supported.
void ast_channel_stage_snapshot_done(struct ast_channel *chan)
Clear flag to indicate channel snapshot is being staged, and publish snapshot.
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)
ast_rtp_ice_role
ICE role during negotiation.
static struct ao2_container * codecs
Registered codecs.
struct ast_rtp_engine_test * test
void(* set_fingerprint)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint)
void ast_rtp_instance_set_stream_num(struct ast_rtp_instance *rtp, int stream_num)
Set the stream number for an RTP instance.
#define AST_RWLIST_TRAVERSE
struct ast_rtp_glue * glue
static int find_static_payload_type(int asterisk_format, const struct ast_format *format, int code)
Scheduler Routines (derived from cheops)
int(* new)(struct ast_rtp_instance *instance, struct ast_sched_context *sched, struct ast_sockaddr *sa, void *data)
static void rtp_ice_wrap_ice_lite(struct ast_rtp_instance *instance)
structure to hold extensions
#define ao2_ref(o, delta)
static struct ast_rtp_payload_type * rtp_payload_type_alloc(struct ast_format *format, int payload, int rtp_code, int primary_mapping)
struct ast_srtp_res * res_srtp
char channel_uniqueid[MAX_CHANNEL_ID]
ast_rtp_ice_component_type
ICE component types.
size_t(* recv_buffer_count)(struct ast_rtp_instance *instance)
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int find_unused_payload(const struct ast_rtp_codecs *codecs)
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_rtcp_id
const char * ast_json_string_get(const struct ast_json *string)
Get the value of a JSON string.
void ast_rtp_instance_set_timeout(struct ast_rtp_instance *instance, int timeout)
Set the RTP timeout value.
A set of macros to manage forward-linked lists.
enum ast_rtp_dtls_hash hash
struct ast_rtp_glue * ast_rtp_instance_get_glue(const char *type)
Get the RTP glue that binds a channel to the RTP engine.
double local_stdevrxploss
void ast_rtp_instance_update_source(struct ast_rtp_instance *instance)
Indicate that the RTP marker bit should be set on an RTP 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.
void ast_rtp_instance_set_last_tx(struct ast_rtp_instance *rtp, time_t time)
Set the last RTP transmission time.
#define AST_VECTOR(name, type)
Define a vector structure.
struct stasis_topic * stasis_topic_create(const char *name)
Create a new topic.
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.
static void rtp_dtls_wrap_set_fingerprint(struct ast_rtp_instance *instance, enum ast_rtp_dtls_hash hash, const char *fingerprint)
unsigned int txoctetcount
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(* 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.
static struct ast_srtp_policy_res policy_res
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
static const char * rtp_ice_wrap_get_ufrag(struct ast_rtp_instance *instance)
Core PBX routines and definitions.
int ast_rtp_get_rate(const struct ast_format *format)
Retrieve the sample rate of a format according to RTP specifications.
struct ast_json * ast_json_array_create(void)
Create a empty JSON array.
double remote_normdevrxploss
Structure that represents the optional DTLS SRTP support within an RTP engine.
static void rtp_ice_wrap_start(struct ast_rtp_instance *instance)
int ast_rtp_instance_bundle(struct ast_rtp_instance *child, struct ast_rtp_instance *parent)
Request that an RTP instance be bundled with another.
static uintmax_t debug_category_rtp_packet_id
int ast_json_array_append(struct ast_json *array, struct ast_json *value)
Append to an array.
enum ast_rtp_extension_direction direction
static struct stasis_topic * rtp_topic
Stasis Message Bus API topic for RTP related messages
ast_rtp_dtls_setup
DTLS setup types.
struct ast_sockaddr incoming_source_address
static force_inline char * ast_str_to_upper(char *str)
Convert a string to all upper-case.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
#define AST_LOG_CATEGORY_RTCP_PACKET
void ast_channel_stage_snapshot(struct ast_channel *chan)
Set flag to indicate channel snapshot is being staged.
const char *(* get_ufrag)(struct ast_rtp_instance *instance)
enum ast_rtp_dtls_setup default_setup
void(* set_authentication)(struct ast_rtp_instance *instance, const char *ufrag, const char *password)
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.
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_dtmf_end(struct ast_rtp_instance *instance, char digit)
Stop sending a DTMF digit.
int attribute_pure ast_true(const char *val)
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
int(* dtmf_begin)(struct ast_rtp_instance *instance, char digit)
struct ao2_container *(* get_local_candidates)(struct ast_rtp_instance *instance)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
unsigned int rxoctetcount
int ast_rtp_engine_srtp_is_registered(void)
enum ast_rtp_dtls_verify verify
int ast_rtp_glue_unregister(struct ast_rtp_glue *glue)
Unregister RTP glue.
ast_rtp_extension_direction
Directions for RTP extensions.
void(* set_role)(struct ast_rtp_instance *instance, enum ast_rtp_ice_role role)
int(* dtmf_mode_set)(struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode)
void * stasis_message_data(const struct stasis_message *msg)
Get the data contained in a message.
ast_rtp_dtls_connection
DTLS connection states.
struct stasis_message * stasis_message_create(struct stasis_message_type *type, void *data)
Create a new message.
struct ast_rtp_engine_ice * ice
struct ast_format * format
static void rtcp_message_payload_dtor(void *obj)
#define ast_rwlock_init(rwlock)
wrapper for rwlock with tracking enabled
int(* extended_prop_set)(struct ast_rtp_instance *instance, int property, void *value)
unsigned int(* ssrc_get)(struct ast_rtp_instance *instance)
static uintmax_t debug_category_ice_id
static uintmax_t debug_category_rtcp_packet_id
int ast_rtp_dtls_cfg_parse(struct ast_rtp_dtls_cfg *dtls_cfg, const char *name, const char *value)
Parse DTLS related configuration options.
static const char * rtp_ice_wrap_get_password(struct ast_rtp_instance *instance)
unsigned int packet_count
def ignore(key=None, val=None, section=None, pjsip=None, nmapped=None, type='endpoint')
enum ast_rtp_extension extension
#define ao2_alloc(data_size, destructor_fn)
void(* reset)(struct ast_rtp_instance *instance)
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.
ast_rtp_dtls_hash
DTLS fingerprint hashes.
int properties[AST_RTP_PROPERTY_MAX]
struct ast_srtp_policy_res * res_srtp_policy
#define ast_channel_unlock(chan)
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.
#define AST_RTP_CISCO_DTMF
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.
void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
Publish a message to a topic's subscribers.
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 enum ast_rtp_dtls_setup rtp_dtls_wrap_get_setup(struct ast_rtp_instance *instance)
static struct ast_rtp_payload_type * static_RTP_PT[AST_RTP_MAX_PT]
Mapping between Asterisk codecs and rtp payload types.
void(* start)(struct ast_rtp_instance *instance)
void ast_rtp_instance_set_remote_ssrc(struct ast_rtp_instance *rtp, unsigned int ssrc)
Set the remote SSRC for an RTP 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(* set_schedid)(struct ast_rtp_instance *instance, int id)
struct ast_srtp * rtcp_srtp
uintmax_t ast_debug_category_dtls_id(void)
void(* set_setup)(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup)
static void to_ami(struct ast_sip_subscription *sub, struct ast_str **buf)
double ast_json_real_get(const struct ast_json *real)
Get the value from a JSON real number.
Prototypes for public functions only of internal interest,.
#define AST_LOG_CATEGORY_RTP
int(* qos)(struct ast_rtp_instance *instance, int tos, int cos, const char *desc)
Vector container support.
size_t ast_rtp_instance_get_recv_buffer_count(struct ast_rtp_instance *instance)
Get the current size of the receive buffer.
struct ast_sockaddr local_address
void(* set_remote_ssrc)(struct ast_rtp_instance *instance, unsigned int ssrc)
#define AST_LOG_CATEGORY_ICE
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.
unsigned int ephemeral_cert
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.
Structure that represents the test functionality for res_rtp_asterisk unit tests. ...
#define AST_LOG_CATEGORY_RTCP
void(* set_stream_num)(struct ast_rtp_instance *instance, int stream_num)
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_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_set_last_rx(struct ast_rtp_instance *rtp, time_t time)
Set the last RTP reception time.
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)
void(* stun_request)(struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username)
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.
struct ast_sockaddr requested_target_address
Support for logging to various files, console and syslog Configuration in file logger.conf.
void ast_rtp_instance_drop_packets(struct ast_rtp_instance *instance, int num)
Set the number of packets to drop on RTP read.
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 payload_mapping_tx_is_present(const struct ast_rtp_codecs *codecs, const struct ast_rtp_payload_type *to_match)
struct ast_rtp_instance * bridged
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...
int ast_debug_category_unregister(const char *name)
Un-register a debug level logger category.
#define ast_rwlock_wrlock(a)
#define ast_module_running_ref(mod)
Hold a reference to the module if it is running.
int(* set_read_format)(struct ast_rtp_instance *instance, struct ast_format *format)
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.
#define ast_channel_lock_both(chan1, chan2)
Lock two channels.
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.
#define EVENT_FLAG_REPORTING
struct ast_json * ast_json_object_create(void)
Create a new JSON object.
static uintmax_t debug_category_dtls_id
int(* active)(struct ast_rtp_instance *instance)
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.
#define AST_RWLIST_INSERT_TAIL
ast_rtp_instance_stat_field
#define AST_VECTOR_GET(vec, idx)
Get an element from a vector.
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.
char channel_uniqueid[AST_MAX_UNIQUEID]
size_t ast_rtp_instance_get_recv_buffer_max(struct ast_rtp_instance *instance)
Get the maximum size of the receive buffer.
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...
struct ast_json * ast_json_real_create(double value)
Create a JSON real number.
Structure for rwlock and tracking information.
struct ast_json * ast_json_object_get(struct ast_json *object, const char *key)
Get a field from a JSON object.
static struct ao2_container * rtp_ice_wrap_get_local_candidates(struct ast_rtp_instance *instance)
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static void rtp_ice_wrap_set_authentication(struct ast_rtp_instance *instance, const char *ufrag, const char *password)
struct ast_channel * ast_channel_bridge_peer(struct ast_channel *chan)
Get the channel's bridge peer only if the bridge is two-party.
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.
const char * ast_channel_name(const struct ast_channel *chan)
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 stasis_topic * ast_rtp_topic(void)
Stasis Message Bus API topic for RTP and RTCP related messages
size_t(* recv_buffer_max)(struct ast_rtp_instance *instance)
#define AST_VECTOR_REPLACE(vec, idx, elem)
Replace an element at a specific position in a vector, growing the vector if needed.
Data structure associated with a single frame of data.
#define AST_RTP_PT_LAST_REASSIGN
enum ast_srtp_suite suite
double remote_stdevrxploss
int ast_option_rtpusedynamic
Structure that represents the optional ICE support within an RTP engine.
Abstract JSON element (object, array, string, int, ...).
struct ast_rtp_engine * engine
int ast_rtp_instance_extmap_get_id(struct ast_rtp_instance *instance, enum ast_rtp_extension extension)
Retrieve the id for an RTP extension.
struct ast_srtp * ast_rtp_instance_get_srtp(struct ast_rtp_instance *instance, int rtcp)
Obtain the SRTP instance associated with an RTP instance.
struct ast_channel_snapshot * snapshot
Options provided by main asterisk program.
static void payload_mapping_rx_clear_primary(struct ast_rtp_codecs *codecs, struct ast_rtp_payload_type *to_match)
void ast_rtp_instance_set_data(struct ast_rtp_instance *instance, void *data)
Set the data portion of an RTP instance.
#define AST_RWLIST_REMOVE
int(* red_init)(struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations)
#define AST_LOG_CATEGORY_DTLS_PACKET
static int rtp_codecs_assign_payload_code_rx(struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code, int explicit)
ast_media_type
Types of media.
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.
struct ast_rtp_rtcp_report * report
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 local_normdevjitter
#define AST_LOG_CATEGORY_RTP_PACKET
uintmax_t ast_debug_category_register(const char *name)
Register a debug level logger category.
int ast_rtp_dtls_cfg_validate(struct ast_rtp_dtls_cfg *dtls_cfg)
Validates DTLS related configuration options.
static void rtp_engine_mime_type_cleanup(int i)
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. ...
unsigned int primary_mapping
struct timeval ntp_timestamp
struct timeval when_retired
size_t ast_rtp_instance_extmap_count(struct ast_rtp_instance *instance)
Get the number of known unique identifiers.
time_t ast_rtp_instance_get_last_rx(const struct ast_rtp_instance *rtp)
void * ast_rtp_instance_get_data(struct ast_rtp_instance *instance)
Get the data portion of an RTP instance.
Pluggable RTP Architecture.
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(* extension_enable)(struct ast_rtp_instance *instance, enum ast_rtp_extension extension)
static ast_rwlock_t static_RTP_PT_lock
Asterisk module definitions.
int(* dtmf_end_with_duration)(struct ast_rtp_instance *instance, char digit, unsigned int duration)
void(* destroy)(struct ast_srtp *srtp)
static snd_pcm_format_t format
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.
int(* replace)(struct ast_srtp **srtp, struct ast_rtp_instance *rtp, struct ast_srtp_policy *policy)
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.
struct ast_json * ast_rtp_convert_stats_json(const struct ast_rtp_instance_stats *stats)
Convert given stat instance into json format.
const char * ast_rtp_instance_extmap_get_uri(struct ast_rtp_instance *instance, int id)
Retrieve the URI for an RTP extension id.
static const char *const rtp_extension_uris[AST_RTP_EXTENSION_MAX]
URIs for known RTP extensions.
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
unsigned int ast_option_rtpptdynamic
int(* fd)(struct ast_rtp_instance *instance, int rtcp)
#define AST_VECTOR_SIZE(vec)
Get the number of elements in a vector.
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.
void ast_rtp_instance_queue_report(struct ast_rtp_instance *instance)
Sends a SR/RR report the next time RTP would be sent.
struct ast_rtp_codecs codecs
void ast_rtp_instance_reset_test_engine(struct ast_rtp_instance *instance)
Resets all the fields to default values for the test engine.
int ast_rtp_instance_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
Early bridge two channels that use RTP instances.
#define SET_AST_JSON_OBJ(target, name, obj)
Set given json object into target with name.
DTLS configuration structure.
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.
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(* get_stat)(struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat)
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.
struct ast_json * ast_rtp_instance_get_stats_all_json(struct ast_rtp_instance *instance)
Retrieve statistics about an RTP instance in json format.
int(* create)(struct ast_srtp **srtp, struct ast_rtp_instance *rtp, struct ast_srtp_policy *policy)
static int rtp_dtls_wrap_set_configuration(struct ast_rtp_instance *instance, const struct ast_rtp_dtls_cfg *dtls_cfg)
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.
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
static void rtp_dtls_wrap_set_setup(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup)
void(* ice_lite)(struct ast_rtp_instance *instance)
#define AST_MAX_USER_FIELD
struct ast_rtp_rtcp_report_block::@314 lost_count
uintmax_t ast_debug_category_rtcp_id(void)
static void rtp_payload_type_dtor(void *obj)