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);
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 = {
1080 "cleaning up rx mapping vector element about to be replaced");
1113 ast_debug(2,
"Copying rx payload mapping %d (%p) from %p to %p\n",
1114 idx,
type, src, dest);
1196 ast_debug(2,
"Copying tx payload mapping %d (%p) from %p to %p\n",
1197 idx,
type, src, dest);
1201 "cleaning up tx mapping vector element about to be replaced");
1274 ast_debug(2,
"Crossover copying tx to rx payload mapping %d (%p) from %p to %p\n",
1275 idx,
type, src, dest);
1305 ast_debug(1,
"Don't have a default tx payload type %d format for m type on %p\n",
1310 ast_debug(1,
"Setting tx payload type %d based on m type on %p\n",
1318 "cleaning up replaced tx payload type");
1336 char *mimetype,
char *mimesubtype,
1338 unsigned int sample_rate)
1354 if (strcasecmp(mimesubtype, t->
subtype)) {
1358 if (strcasecmp(mimetype, t->
type)) {
1397 "cleaning up replaced tx payload type");
1417 return (found ? 0 : -2);
1461 if (
type &&
type->asterisk_format) {
1509 type->asterisk_format = 1;
1511 type->primary_mapping = 1;
1541 if (
type &&
type->asterisk_format) {
1557 codecs->framing = framing;
1563 unsigned int framing;
1566 framing =
codecs->framing;
1589 if (
type->asterisk_format) {
1592 *nonastformats |=
type->rtp_code;
1664 for (x = start; x <
end; ++x) {
1773 struct timeval oldest;
1781 && !
type->primary_mapping
1784 oldest =
type->when_retired;
1843 }
else if (
explicit) {
1880 if (!
type->asterisk_format
1881 &&
type->primary_mapping
1882 &&
type->rtp_code == code) {
1896 if (
type->asterisk_format
1897 &&
type->primary_mapping
1934 if (!
type->asterisk_format
1935 &&
type->rtp_code == code) {
1949 if (
type->asterisk_format
1988 const char *res =
"";
2018 unsigned int res = 0;
2060 if (rtp_capability & x) {
2190 res = instance->
engine->
fd(instance, rtcp);
2205 if (!strcasecmp(glue->
type,
type)) {
2246 *vinstance_dst =
NULL, *vinstance_src =
NULL,
2247 *tinstance_dst =
NULL, *tinstance_src =
NULL;
2257 if (!cap_src || !cap_dst) {
2267 audio_glue_dst_res = glue_dst->
get_rtp_info(c_dst, &instance_dst);
2270 audio_glue_src_res = glue_src->
get_rtp_info(c_src, &instance_src);
2299 if (vinstance_dst && vinstance_src) {
2302 if (tinstance_dst && tinstance_src) {
2306 if (glue_dst->
update_peer(c_dst, instance_src, vinstance_src, tinstance_src, cap_src, 0)) {
2310 ast_debug(1,
"Seeded SDP of '%s' with that of '%s'\n",
2332 *vinstance0 =
NULL, *vinstance1 =
NULL,
2333 *tinstance0 =
NULL, *tinstance1 =
NULL;
2341 if (!c1 || !cap1 || !cap0) {
2387 if (glue0->
update_peer(c0, instance1, vinstance1, tinstance1, cap1, 0)) {
2416 res = instance->
engine->
red_init(instance, buffer_time, payloads, generations);
2477 snprintf(
buf, size,
"ssrc=%u;themssrc=%u;lp=%u;rxjitter=%f;rxcount=%u;txjitter=%f;txcount=%u;rlp=%u;rtt=%f",
2480 snprintf(
buf, size,
"minrxjitter=%f;maxrxjitter=%f;avgrxjitter=%f;stdevrxjitter=%f;reported_minjitter=%f;reported_maxjitter=%f;reported_avgjitter=%f;reported_stdevjitter=%f;",
2483 snprintf(
buf, size,
"minrxlost=%f;maxrxlost=%f;avgrxlost=%f;stdevrxlost=%f;reported_minlost=%f;reported_maxlost=%f;reported_avglost=%f;reported_stdevlost=%f;",
2508 quality_buf,
sizeof(quality_buf));
2599 if (!peer_instance) {
2620 peer_instance =
NULL;
2655 const char *username)
2699 return instance->
glue;
2743 }
else if (remote_policy) {
2760 return instance->
srtp;
2818 const char *password;
2833 return local_candidates;
2853 const char *server,
unsigned int port,
const char *username,
const char *password)
2857 username, password);
2892 #ifdef TEST_FRAMEWORK
2893 struct ast_rtp_engine_test *ast_rtp_instance_get_test(
struct ast_rtp_instance *instance)
2895 return instance->
engine->test;
2902 int set_configuration;
2907 return set_configuration;
2941 return get_connection;
2977 return get_fingerprint_hash;
2982 const char *get_fingerprint;
2987 return get_fingerprint;
3014 if (!strcasecmp(
name,
"dtlsenable")) {
3016 }
else if (!strcasecmp(
name,
"dtlsverify")) {
3017 if (!strcasecmp(
value,
"yes")) {
3019 }
else if (!strcasecmp(
value,
"fingerprint")) {
3021 }
else if (!strcasecmp(
value,
"certificate")) {
3023 }
else if (!strcasecmp(
value,
"no")) {
3028 }
else if (!strcasecmp(
name,
"dtlsrekey")) {
3029 if (sscanf(
value,
"%30u", &dtls_cfg->
rekey) != 1) {
3032 }
else if (!strcasecmp(
name,
"dtlsautogeneratecert")) {
3034 }
else if (!strcasecmp(
name,
"dtlscertfile")) {
3041 }
else if (!strcasecmp(
name,
"dtlsprivatekey")) {
3048 }
else if (!strcasecmp(
name,
"dtlscipher")) {
3051 }
else if (!strcasecmp(
name,
"dtlscafile")) {
3058 }
else if (!strcasecmp(
name,
"dtlscapath") || !strcasecmp(
name,
"dtlscadir")) {
3065 }
else if (!strcasecmp(
name,
"dtlssetup")) {
3066 if (!strcasecmp(
value,
"active")) {
3068 }
else if (!strcasecmp(
value,
"passive")) {
3070 }
else if (!strcasecmp(
value,
"actpass")) {
3073 }
else if (!strcasecmp(
name,
"dtlsfingerprint")) {
3074 if (!strcasecmp(
value,
"sha-256")) {
3076 }
else if (!strcasecmp(
value,
"sha-1")) {
3090 ast_log(
LOG_ERROR,
"You cannot request automatically generated certificates"
3091 " (dtls_auto_generate_cert) and also specify a certificate file"
3092 " (dtls_cert_file) at the same time\n");
3098 " ignored when dtls_auto_generate_cert is enabled\n");
3299 if (!packet_string) {
3305 if (!channel_string) {
3310 if (payload->
blob) {
3328 ast_str_append(&packet_string, 0,
"ReportCount: %u\r\n", report_count);
3341 for (i = 0; i < report_count; i++) {
3349 if (!report_string) {
3353 ast_str_append(&report_string, 0,
"Report%dSourceSSRC: 0x%.8x\r\n",
3355 ast_str_append(&report_string, 0,
"Report%dFractionLost: %d\r\n",
3357 ast_str_append(&report_string, 0,
"Report%dCumulativeLost: %u\r\n",
3359 ast_str_append(&report_string, 0,
"Report%dHighestSequence: %u\r\n",
3361 ast_str_append(&report_string, 0,
"Report%dSequenceNumberCycles: %u\r\n",
3375 AS_OR(channel_string,
""),
3384 struct ast_json *json_rtcp_report_blocks;
3390 if (!json_rtcp_report_blocks) {
3395 struct ast_json *json_report_block;
3399 json_report_block =
ast_json_pack(
"{s: I, s: I, s: I, s: I, s: I, s: s, s: I}",
3407 if (!json_report_block
3420 json_rtcp_sender_info =
ast_json_pack(
"{s: s, s: s, s: I, s: I, s: I}",
3421 "ntp_timestamp_sec", sec,
3422 "ntp_timestamp_usec", usec,
3426 if (!json_rtcp_sender_info) {
3432 json_rtcp_report =
ast_json_pack(
"{s: I, s: I, s: i, s: o, s: o}",
3436 "sender_information", json_rtcp_sender_info ?:
ast_json_null(),
3437 "report_blocks", json_rtcp_report_blocks);
3438 if (!json_rtcp_report) {
3444 if (!json_channel) {
3452 "channel", json_channel,
3453 "rtcp_report", json_rtcp_report,
3454 "blob", payload->
blob);
3486 if (!message_type) {
3491 if (!payload || !report) {
3499 payload->blob = blob;
3503 payload->report = report;
3681 #ifdef USE_DEPRECATED_G726
3773 unsigned int ssrc = 0;
3786 const char *cname =
"";
3832 #ifdef TEST_FRAMEWORK
3833 size_t ast_rtp_instance_get_recv_buffer_max(
struct ast_rtp_instance *instance)
3836 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3844 res =
test->recv_buffer_max(instance);
3850 size_t ast_rtp_instance_get_recv_buffer_count(
struct ast_rtp_instance *instance)
3853 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3861 res =
test->recv_buffer_count(instance);
3867 size_t ast_rtp_instance_get_send_buffer_count(
struct ast_rtp_instance *instance)
3870 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3878 res =
test->send_buffer_count(instance);
3884 void ast_rtp_instance_set_schedid(
struct ast_rtp_instance *instance,
int id)
3886 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3894 test->set_schedid(instance,
id);
3898 void ast_rtp_instance_drop_packets(
struct ast_rtp_instance *instance,
int num)
3900 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3907 test->packets_to_drop = num;
3912 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3919 test->send_report = 1;
3924 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3931 return test->sdes_received;
3936 struct ast_rtp_engine_test *
test = ast_rtp_instance_get_test(instance);
3943 test->packets_to_drop = 0;
3944 test->send_report = 0;
3945 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.
#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_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)
static snd_pcm_format_t format
General Asterisk PBX channel definitions.
#define ast_channel_lock(chan)
#define ast_channel_lock_both(chan1, chan2)
Lock two channels.
const char * ast_channel_name(const struct ast_channel *chan)
#define ast_channel_unref(c)
Decrease channel reference count.
#define AST_MAX_USER_FIELD
#define ast_channel_unlock(chan)
const struct ast_channel_tech * ast_channel_tech(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.
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.
struct stasis_message_type * ast_rtp_rtcp_received_type(void)
Message type for an RTCP message received from some external source.
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_sent_type(void)
Message type for an RTCP message sent from this Asterisk instance.
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_ref(struct ast_json *value)
Increase refcount on 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_array_create(void)
Create a empty JSON array.
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.
struct ast_json * ast_json_object_create(void)
Create a new 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_null(void)
Get the JSON null value.
struct ast_json * ast_json_pack(char const *format,...)
Helper for creating complex JSON values.
int ast_json_object_set(struct ast_json *object, const char *key, struct ast_json *value)
Set a field in a JSON object.
struct ast_json * ast_json_integer_create(intmax_t value)
Create a JSON integer.
struct ast_json * ast_json_string_create(const char *value)
Construct a JSON string from value.
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_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.
struct ast_str * ast_manager_build_channel_state_string(const struct ast_channel_snapshot *snapshot)
Generate the AMI message body from a channel snapshot.
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
struct ast_rtp_engine * ast_rtp_instance_get_engine(struct ast_rtp_instance *instance)
Get the RTP engine in use on an RTP instance.
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.
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.
struct ast_rtp_codecs * ast_rtp_instance_get_codecs(struct ast_rtp_instance *instance)
Get the codecs structure of an RTP instance.
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.
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.
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
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)
const char * ast_rtp_instance_get_cname(struct ast_rtp_instance *rtp)
Retrieve the CNAME used in RTCP SDES items.
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
const char * ast_rtp_instance_extmap_get_uri(struct ast_rtp_instance *instance, int id)
Retrieve the URI for an RTP extension id.
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.
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
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.
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.
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 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.
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.
static const char * rtp_ice_wrap_get_password(struct ast_rtp_instance *instance)
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.
static const char * rtp_ice_wrap_get_ufrag(struct ast_rtp_instance *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.
int ast_rtp_instance_get_keepalive(struct ast_rtp_instance *instance)
Get the RTP keepalive interval.
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)
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_srtp * ast_rtp_instance_get_srtp(struct ast_rtp_instance *instance, int rtcp)
Obtain the SRTP instance associated with an RTP instance.
static void rtp_dtls_wrap_stop(struct ast_rtp_instance *instance)
static struct ast_rtp_payload_type * rtp_payload_type_alloc(struct ast_format *format, int payload, int rtp_code, int primary_mapping)
static int rtp_codecs_assign_payload_code_rx(struct ast_rtp_codecs *codecs, int asterisk_format, struct ast_format *format, int code, int explicit)
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)
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.
static void rtp_dtls_wrap_set_setup(struct ast_rtp_instance *instance, enum ast_rtp_dtls_setup setup)
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.
struct ast_rtp_payload_type * ast_rtp_engine_alloc_payload_type(void)
Allocation routine for ast_rtp_payload_type.
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)
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.
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)