Asterisk - The Open Source Telephony Project
18.5.0
|
Supports RTP and RTCP with Symmetric RTP support for NAT traversal. More...
#include "asterisk.h"
#include <sys/time.h>
#include <signal.h>
#include <fcntl.h>
#include <openssl/opensslconf.h>
#include <openssl/opensslv.h>
#include <pjlib.h>
#include <pjlib-util.h>
#include <pjnath.h>
#include <ifaddrs.h>
#include "asterisk/conversions.h"
#include "asterisk/options.h"
#include "asterisk/logger_category.h"
#include "asterisk/stun.h"
#include "asterisk/pbx.h"
#include "asterisk/frame.h"
#include "asterisk/format_cache.h"
#include "asterisk/channel.h"
#include "asterisk/acl.h"
#include "asterisk/config.h"
#include "asterisk/lock.h"
#include "asterisk/utils.h"
#include "asterisk/cli.h"
#include "asterisk/manager.h"
#include "asterisk/unaligned.h"
#include "asterisk/module.h"
#include "asterisk/rtp_engine.h"
#include "asterisk/smoother.h"
#include "asterisk/uuid.h"
#include "asterisk/test.h"
#include "asterisk/data_buffer.h"
#include "asterisk/res_pjproject.h"
#include "asterisk/security_events.h"
Go to the source code of this file.
Data Structures | |
struct | ast_ice_host_candidate |
Structure which contains ICE host candidate mapping information. More... | |
struct | ast_rtcp |
Structure defining an RTCP session. More... | |
struct | ast_rtp |
RTP session description. More... | |
struct | ast_rtp_ioqueue_thread |
Structure which contains ioqueue thread information. More... | |
struct | ast_rtp_rtcp_nack_payload |
Structure for storing RTP packets for retransmission. More... | |
struct | frame_list |
struct | host_candidates |
List of ICE host candidate mappings. More... | |
struct | ice_wrap |
struct | ioqueues |
List of ioqueue threads. More... | |
struct | optional_ts |
struct | rtp_drop_packets_data |
struct | rtp_learning_info |
RTP learning mode tracking information. More... | |
struct | rtp_red |
struct | rtp_ssrc_mapping |
Structure used for mapping an incoming SSRC to an RTP instance. More... | |
struct | rtp_transport_wide_cc_packet_statistics |
Packet statistics (used for transport-cc) More... | |
struct | rtp_transport_wide_cc_statistics |
Statistics information (used for transport-cc) More... | |
Enumerations | |
enum | strict_rtp_mode { STRICT_RTP_NO = 0, STRICT_RTP_YES, STRICT_RTP_SEQNO } |
enum | strict_rtp_state { STRICT_RTP_OPEN = 0, STRICT_RTP_LEARN, STRICT_RTP_CLOSED } |
Functions | |
static void | __init_pj_thread_storage (void) |
static void | __reg_module (void) |
static struct ast_rtp_instance * | __rtp_find_instance_by_ssrc (struct ast_rtp_instance *instance, struct ast_rtp *rtp, unsigned int ssrc, int source) |
static int | __rtp_recvfrom (struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int rtcp) |
static int | __rtp_sendto (struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int rtcp, int *via_ice, int use_srtp) |
static void | __unreg_module (void) |
static void | acl_change_stasis_cb (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | ast2pj_rtp_ice_role (enum ast_rtp_ice_role ast_role, enum pj_ice_sess_role *pj_role) |
struct ast_module * | AST_MODULE_SELF_SYM (void) |
static unsigned int | ast_rtcp_calc_interval (struct ast_rtp *rtp) |
static int | ast_rtcp_calculate_sr_rr_statistics (struct ast_rtp_instance *instance, struct ast_rtp_rtcp_report *rtcp_report, struct ast_sockaddr remote_address, int ice, int sr) |
static int | ast_rtcp_generate_compound_prefix (struct ast_rtp_instance *instance, unsigned char *rtcpheader, struct ast_rtp_rtcp_report *report, int *sr) |
static int | ast_rtcp_generate_nack (struct ast_rtp_instance *instance, unsigned char *rtcpheader) |
static int | ast_rtcp_generate_report (struct ast_rtp_instance *instance, unsigned char *rtcpheader, struct ast_rtp_rtcp_report *rtcp_report, int *sr) |
static int | ast_rtcp_generate_sdes (struct ast_rtp_instance *instance, unsigned char *rtcpheader, struct ast_rtp_rtcp_report *rtcp_report) |
static struct ast_frame * | ast_rtcp_interpret (struct ast_rtp_instance *instance, struct ast_srtp *srtp, const unsigned char *rtcpdata, size_t size, struct ast_sockaddr *addr) |
static struct ast_frame * | ast_rtcp_read (struct ast_rtp_instance *instance) |
static int | ast_rtcp_write (const void *data) |
Write a RTCP packet to the far end. More... | |
static int | ast_rtp_bundle (struct ast_rtp_instance *child, struct ast_rtp_instance *parent) |
static void | ast_rtp_change_source (struct ast_rtp_instance *instance) |
static int | ast_rtp_destroy (struct ast_rtp_instance *instance) |
static int | ast_rtp_dtmf_begin (struct ast_rtp_instance *instance, char digit) |
static int | ast_rtp_dtmf_compatible (struct ast_channel *chan0, struct ast_rtp_instance *instance0, struct ast_channel *chan1, struct ast_rtp_instance *instance1) |
static int | ast_rtp_dtmf_continuation (struct ast_rtp_instance *instance) |
static int | ast_rtp_dtmf_end (struct ast_rtp_instance *instance, char digit) |
static int | ast_rtp_dtmf_end_with_duration (struct ast_rtp_instance *instance, char digit, unsigned int duration) |
static enum ast_rtp_dtmf_mode | ast_rtp_dtmf_mode_get (struct ast_rtp_instance *instance) |
static int | ast_rtp_dtmf_mode_set (struct ast_rtp_instance *instance, enum ast_rtp_dtmf_mode dtmf_mode) |
static int | ast_rtp_extension_enable (struct ast_rtp_instance *instance, enum ast_rtp_extension extension) |
static int | ast_rtp_fd (struct ast_rtp_instance *instance, int rtcp) |
static const char * | ast_rtp_get_cname (struct ast_rtp_instance *instance) |
static unsigned int | ast_rtp_get_ssrc (struct ast_rtp_instance *instance) |
static int | ast_rtp_get_stat (struct ast_rtp_instance *instance, struct ast_rtp_instance_stats *stats, enum ast_rtp_instance_stat stat) |
static void | ast_rtp_ice_add_cand (struct ast_rtp_instance *instance, struct ast_rtp *rtp, unsigned comp_id, unsigned transport_id, pj_ice_cand_type type, pj_uint16_t local_pref, const pj_sockaddr_t *addr, const pj_sockaddr_t *base_addr, const pj_sockaddr_t *rel_addr, int addr_len) |
static void | ast_rtp_ice_add_remote_candidate (struct ast_rtp_instance *instance, const struct ast_rtp_engine_ice_candidate *candidate) |
static void | ast_rtp_ice_candidate_destroy (void *obj) |
Destructor for locally created ICE candidates. More... | |
static void | ast_rtp_ice_change_components (struct ast_rtp_instance *instance, int num_components) |
static struct ao2_container * | ast_rtp_ice_get_local_candidates (struct ast_rtp_instance *instance) |
static const char * | ast_rtp_ice_get_password (struct ast_rtp_instance *instance) |
static const char * | ast_rtp_ice_get_ufrag (struct ast_rtp_instance *instance) |
static void | ast_rtp_ice_lite (struct ast_rtp_instance *instance) |
static void | ast_rtp_ice_set_authentication (struct ast_rtp_instance *instance, const char *ufrag, const char *password) |
static void | ast_rtp_ice_set_role (struct ast_rtp_instance *instance, enum ast_rtp_ice_role role) |
static void | ast_rtp_ice_start (struct ast_rtp_instance *instance) |
static void | ast_rtp_ice_start_media (pj_ice_sess *ice, pj_status_t status) |
static void | ast_rtp_ice_stop (struct ast_rtp_instance *instance) |
static void | ast_rtp_ice_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 struct ast_frame * | ast_rtp_interpret (struct ast_rtp_instance *instance, struct ast_srtp *srtp, const struct ast_sockaddr *remote_address, unsigned char *read_area, int length, int prev_seqno, unsigned int bundled) |
static int | ast_rtp_local_bridge (struct ast_rtp_instance *instance0, struct ast_rtp_instance *instance1) |
static int | ast_rtp_new (struct ast_rtp_instance *instance, struct ast_sched_context *sched, struct ast_sockaddr *addr, void *data) |
static void | ast_rtp_on_ice_complete (pj_ice_sess *ice, pj_status_t status) |
static void | ast_rtp_on_ice_rx_data (pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len) |
static pj_status_t | ast_rtp_on_ice_tx_pkt (pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, const void *pkt, pj_size_t size, const pj_sockaddr_t *dst_addr, unsigned dst_addr_len) |
static void | ast_rtp_on_turn_rtcp_state (pj_turn_sock *turn_sock, pj_turn_state_t old_state, pj_turn_state_t new_state) |
static void | ast_rtp_on_turn_rtp_state (pj_turn_sock *turn_sock, pj_turn_state_t old_state, pj_turn_state_t new_state) |
static void | ast_rtp_on_turn_rx_rtcp_data (pj_turn_sock *turn_sock, void *pkt, unsigned pkt_len, const pj_sockaddr_t *peer_addr, unsigned addr_len) |
static void | ast_rtp_on_turn_rx_rtp_data (pj_turn_sock *turn_sock, void *pkt, unsigned pkt_len, const pj_sockaddr_t *peer_addr, unsigned addr_len) |
static void | ast_rtp_on_valid_pair (pj_ice_sess *ice) |
static void | ast_rtp_prop_set (struct ast_rtp_instance *instance, enum ast_rtp_property property, int value) |
static int | ast_rtp_qos_set (struct ast_rtp_instance *instance, int tos, int cos, const char *desc) |
static struct ast_frame * | ast_rtp_read (struct ast_rtp_instance *instance, int rtcp) |
static void | ast_rtp_remote_address_set (struct ast_rtp_instance *instance, struct ast_sockaddr *addr) |
static int | ast_rtp_rtcp_handle_nack (struct ast_rtp_instance *instance, unsigned int *nackdata, unsigned int position, unsigned int length) |
static int | ast_rtp_sendcng (struct ast_rtp_instance *instance, int level) |
generate comfort noice (CNG) More... | |
static void | ast_rtp_set_remote_ssrc (struct ast_rtp_instance *instance, unsigned int ssrc) |
static void | ast_rtp_set_stream_num (struct ast_rtp_instance *instance, int stream_num) |
static void | ast_rtp_stop (struct ast_rtp_instance *instance) |
static void | ast_rtp_stun_request (struct ast_rtp_instance *instance, struct ast_sockaddr *suggestion, const char *username) |
static void | ast_rtp_update_source (struct ast_rtp_instance *instance) |
static int | ast_rtp_write (struct ast_rtp_instance *instance, struct ast_frame *frame) |
static int | bridge_p2p_rtp_write (struct ast_rtp_instance *instance, struct ast_rtp_instance *instance1, unsigned int *rtpheader, int len, int hdrlen) |
static void | calc_mean_and_standard_deviation (double new_sample, double *mean, double *std_dev, unsigned int *count) |
static void | calc_rxstamp (struct timeval *tv, struct ast_rtp *rtp, unsigned int timestamp, int mark) |
static unsigned int | calc_txstamp (struct ast_rtp *rtp, struct timeval *delivery) |
static void | calculate_lost_packet_statistics (struct ast_rtp *rtp, unsigned int *lost_packets, int *fraction_lost) |
static int | compare_by_value (int elem, int value) |
Helper function to compare an elem in a vector by value. More... | |
static struct ast_frame * | create_dtmf_frame (struct ast_rtp_instance *instance, enum ast_frame_type type, int compensate) |
static int | create_new_socket (const char *type, int af) |
static void | drop_packets_data_update (struct timeval tv) |
static int | find_by_value (int elem, int value) |
Helper function to find an elem in a vector by value. More... | |
static char * | generate_random_string (char *buf, size_t size) |
static size_t | get_recv_buffer_count (struct ast_rtp_instance *instance) |
static size_t | get_recv_buffer_max (struct ast_rtp_instance *instance) |
static size_t | get_send_buffer_count (struct ast_rtp_instance *instance) |
static char * | handle_cli_rtcp_set_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_rtcp_set_stats (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_rtp_drop_incoming_packets (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_rtp_set_debug (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static char * | handle_cli_rtp_settings (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static void | host_candidate_overrides_clear (void) |
Helper function which clears the ICE host candidate mapping. More... | |
static int | ice_candidate_cmp (void *obj, void *arg, int flags) |
static int | ice_candidates_compare (struct ao2_container *left, struct ao2_container *right) |
static int | ice_create (struct ast_rtp_instance *instance, struct ast_sockaddr *addr, int port, int replace) |
static int | ice_reset_session (struct ast_rtp_instance *instance) |
static void | ice_wrap_dtor (void *vdoomed) |
ao2 ICE wrapper object destructor. More... | |
static int | ioqueue_worker_thread (void *data) |
Worker thread for ioqueue and timerheap. More... | |
static int | load_module (void) |
static void | ntp2timeval (unsigned int msw, unsigned int lsw, struct timeval *tv) |
static void | pj2ast_rtp_ice_role (enum pj_ice_sess_role pj_role, enum ast_rtp_ice_role *ast_role) |
static void | pj_thread_register_check (void) |
Function used to check if the calling thread is registered with pjlib. If it is not it will be registered. More... | |
static struct ast_frame * | process_cn_rfc3389 (struct ast_rtp_instance *instance, unsigned char *data, int len, unsigned int seqno, unsigned int timestamp, int payloadtype, int mark) |
static struct ast_frame * | process_dtmf_cisco (struct ast_rtp_instance *instance, unsigned char *data, int len, unsigned int seqno, unsigned int timestamp, int payloadtype, int mark) |
static void | process_dtmf_rfc2833 (struct ast_rtp_instance *instance, unsigned char *data, int len, unsigned int seqno, unsigned int timestamp, int payloadtype, int mark, struct frame_list *frames) |
static void | put_unaligned_time24 (void *p, uint32_t time_msw, uint32_t time_lsw) |
static struct ast_frame * | red_t140_to_red (struct rtp_red *red) |
static int | red_write (const void *data) |
Write t140 redundacy frame. More... | |
static int | reload_module (void) |
static int | rtcp_debug_test_addr (struct ast_sockaddr *addr) |
static char * | rtcp_do_debug_ip (struct ast_cli_args *a) |
static int | rtcp_mux (struct ast_rtp *rtp, const unsigned char *packet) |
static const char * | rtcp_payload_subtype2str (unsigned int pt, unsigned int subtype) |
static const char * | rtcp_payload_type2str (unsigned int pt) |
static int | rtcp_recvfrom (struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa) |
static int | rtcp_sendto (struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int *ice) |
static void | rtp_add_candidates_to_ice (struct ast_rtp_instance *instance, struct ast_rtp *rtp, struct ast_sockaddr *addr, int port, int component, int transport) |
static int | rtp_address_is_ice_blacklisted (const struct ast_sockaddr *address) |
static int | rtp_allocate_transport (struct ast_rtp_instance *instance, struct ast_rtp *rtp) |
static void | rtp_deallocate_transport (struct ast_rtp_instance *instance, struct ast_rtp *rtp) |
static int | rtp_debug_test_addr (struct ast_sockaddr *addr) |
static char * | rtp_do_debug_ip (struct ast_cli_args *a) |
static struct ast_rtp_instance * | rtp_find_instance_by_media_source_ssrc (struct ast_rtp_instance *instance, struct ast_rtp *rtp, unsigned int ssrc) |
static struct ast_rtp_instance * | rtp_find_instance_by_packet_source_ssrc (struct ast_rtp_instance *instance, struct ast_rtp *rtp, unsigned int ssrc) |
static void | rtp_instance_parse_extmap_extensions (struct ast_rtp_instance *instance, struct ast_rtp *rtp, unsigned char *extension, int len) |
static void | rtp_instance_parse_transport_wide_cc (struct ast_rtp_instance *instance, struct ast_rtp *rtp, unsigned char *data, int len) |
static void | rtp_instance_unlock (struct ast_rtp_instance *instance) |
static void | rtp_ioqueue_thread_destroy (struct ast_rtp_ioqueue_thread *ioqueue) |
Destroyer for ioqueue thread. More... | |
static struct ast_rtp_ioqueue_thread * | rtp_ioqueue_thread_get_or_create (void) |
Finder and allocator for an ioqueue thread. More... | |
static void | rtp_ioqueue_thread_remove (struct ast_rtp_ioqueue_thread *ioqueue) |
Removal function for ioqueue thread, determines if it should be terminated and destroyed. More... | |
static int | rtp_learning_rtp_seq_update (struct rtp_learning_info *info, uint16_t seq) |
static void | rtp_learning_seq_init (struct rtp_learning_info *info, uint16_t seq) |
static void | rtp_learning_start (struct ast_rtp *rtp) |
Start the strictrtp learning mode. More... | |
static int | rtp_raw_write (struct ast_rtp_instance *instance, struct ast_frame *frame, int codec) |
static int | rtp_recvfrom (struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa) |
static int | rtp_red_buffer (struct ast_rtp_instance *instance, struct ast_frame *frame) |
static int | rtp_red_init (struct ast_rtp_instance *instance, int buffer_time, int *payloads, int generations) |
static int | rtp_reload (int reload, int by_external_config) |
static int | rtp_sendto (struct ast_rtp_instance *instance, void *buf, size_t size, int flags, struct ast_sockaddr *sa, int *ice) |
static void | rtp_terminate_pjproject (void) |
static int | rtp_transport_wide_cc_feedback_produce (const void *data) |
static void | rtp_transport_wide_cc_feedback_status_append (unsigned char *rtcpheader, int *packet_len, int *status_vector_chunk_bits, uint16_t *status_vector_chunk, int *run_length_chunk_count, int *run_length_chunk_status, int status) |
static void | rtp_transport_wide_cc_feedback_status_vector_append (unsigned char *rtcpheader, int *packet_len, int *status_vector_chunk_bits, uint16_t *status_vector_chunk, int status) |
static int | rtp_transport_wide_cc_packet_statistics_cmp (struct rtp_transport_wide_cc_packet_statistics a, struct rtp_transport_wide_cc_packet_statistics b) |
static void | rtp_unload_acl (ast_rwlock_t *lock, struct ast_acl_list **acl) |
static void | rtp_write_rtcp_fir (struct ast_rtp_instance *instance, struct ast_rtp *rtp, struct ast_sockaddr *remote_address) |
static void | rtp_write_rtcp_psfb (struct ast_rtp_instance *instance, struct ast_rtp *rtp, struct ast_frame *frame, struct ast_sockaddr *remote_address) |
static void | set_rtp_rtcp_schedid (struct ast_rtp_instance *instance, int id) |
static int | should_drop_packets (struct ast_sockaddr *addr) |
static int | stun_address_is_blacklisted (const struct ast_sockaddr *addr) |
static int | timer_worker_thread (void *data) |
Worker thread for timerheap. More... | |
static void | timeval2ntp (struct timeval tv, unsigned int *msw, unsigned int *lsw) |
static int | unload_module (void) |
static void | update_address_with_ice_candidate (pj_ice_sess *ice, enum ast_rtp_ice_component_type component, struct ast_sockaddr *cand_address) |
Helper function which updates an ast_sockaddr with the candidate used for the component. More... | |
static void | update_jitter_stats (struct ast_rtp *rtp, unsigned int ia_jitter) |
static void | update_lost_stats (struct ast_rtp *rtp, unsigned int lost_packets) |
static int | update_rtt_stats (struct ast_rtp *rtp, unsigned int lsr, unsigned int dlsr) |
static unsigned int | use_random (struct ast_cli_args *a, int pos, unsigned int index) |
Variables | |
static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Asterisk RTP Stack" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .reload = reload_module, .load_pri = AST_MODPRI_CHANNEL_DEPEND, #ifdef 1 .requires = "res_pjproject", #endif } |
static struct stasis_subscription * | acl_change_sub = NULL |
static const struct ast_module_info * | ast_module_info = &__mod_info |
static struct ast_rtp_engine_ice | ast_rtp_ice |
static pj_ice_sess_cb | ast_rtp_ice_sess_cb |
static struct ast_rtp_engine_test | ast_rtp_test |
static pj_turn_sock_cb | ast_rtp_turn_rtcp_sock_cb |
static pj_turn_sock_cb | ast_rtp_turn_rtp_sock_cb |
static struct ast_rtp_engine | asterisk_rtp_engine |
static pj_caching_pool | cachingpool |
Pool factory used by pjlib to allocate memory. More... | |
static struct ast_cli_entry | cli_rtp [] |
static struct rtp_drop_packets_data | drop_packets_data |
static int | dtmftimeout = DEFAULT_DTMF_TIMEOUT |
static struct host_candidates | host_candidates = { .first = NULL, .last = NULL, .lock = { PTHREAD_RWLOCK_INITIALIZER , NULL, {1, 0} } , } |
static struct ast_acl_list * | ice_acl = NULL |
static ast_rwlock_t | ice_acl_lock = AST_RWLOCK_INIT_VALUE |
static int | icesupport = DEFAULT_ICESUPPORT |
static struct ioqueues | ioqueues = { .first = NULL, .last = NULL, .lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } , } |
static int | learning_min_duration = DEFAULT_LEARNING_MIN_DURATION |
static int | learning_min_sequential = DEFAULT_LEARNING_MIN_SEQUENTIAL |
static struct ast_sockaddr | lo6 = { .len = 0 } |
static struct ast_threadstorage | pj_thread_storage = { .once = PTHREAD_ONCE_INIT , .key_init = __init_pj_thread_storage , .custom_init = NULL , } |
static pj_pool_t * | pool |
Global memory pool for configuration and timers. More... | |
struct ast_srtp_res * | res_srtp |
struct ast_srtp_policy_res * | res_srtp_policy |
static struct ast_sockaddr | rtcpdebugaddr |
static int | rtcpdebugport |
static int | rtcpinterval = RTCP_DEFAULT_INTERVALMS |
static int | rtcpstats |
static struct ast_sockaddr | rtpdebugaddr |
static int | rtpdebugport |
static int | rtpend = DEFAULT_RTP_END |
static int | rtpstart = DEFAULT_RTP_START |
static int | srtp_replay_protection = DEFAULT_SRTP_REPLAY_PROTECTION |
static int | strictrtp = DEFAULT_STRICT_RTP |
static struct ast_acl_list * | stun_acl = NULL |
static ast_rwlock_t | stun_acl_lock = AST_RWLOCK_INIT_VALUE |
static int | stun_software_attribute = DEFAULT_STUN_SOFTWARE_ATTRIBUTE |
static struct sockaddr_in | stunaddr |
static pj_timer_heap_t * | timer_heap |
Global timer heap. More... | |
static int | timer_terminate |
Used to tell the timer thread to terminate. More... | |
static pj_thread_t * | timer_thread |
Thread executing the timer heap. More... | |
static pj_str_t | turnaddr |
static pj_str_t | turnpassword |
static int | turnport = DEFAULT_TURN_PORT |
static pj_str_t | turnusername |
Supports RTP and RTCP with Symmetric RTP support for NAT traversal.
Definition in file res_rtp_asterisk.c.
#define CALC_LEARNING_MIN_DURATION | ( | count | ) | (((count) - 1) * 9 - 5) |
Calculate the min learning duration in ms.
The min supported packet size represents 10 ms and we need to account for some jitter and fast clocks while learning. Some messed up devices have very bad jitter for a small packet sample size. Jitter can also be introduced by the network itself.
So we'll allow packets to come in every 9ms on average for fast clocking with the last one coming in 5ms early for jitter.
Definition at line 154 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_DTLS_MTU 1200 |
Definition at line 188 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_DTMF_TIMEOUT (150 * (8000 / 1000)) |
#define DEFAULT_ICESUPPORT 1 |
Definition at line 186 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_LEARNING_MIN_DURATION CALC_LEARNING_MIN_DURATION(DEFAULT_LEARNING_MIN_SEQUENTIAL) |
Definition at line 155 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_LEARNING_MIN_SEQUENTIAL 4 |
Definition at line 141 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_RTP_END 31000 |
Default maximum port number to end allocating RTP ports at
Definition at line 100 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_RTP_RECV_BUFFER_SIZE 20 |
The initial size of the RTP receiver buffer
Definition at line 111 of file res_rtp_asterisk.c.
Referenced by ast_rtp_prop_set().
#define DEFAULT_RTP_SEND_BUFFER_SIZE 250 |
The initial size of the RTP send buffer
Definition at line 109 of file res_rtp_asterisk.c.
Referenced by ast_rtp_prop_set().
#define DEFAULT_RTP_START 5000 |
Default port number to start allocating RTP ports from
Definition at line 99 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_SRTP_REPLAY_PROTECTION 1 |
Definition at line 185 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_STRICT_RTP STRICT_RTP_YES |
#define DEFAULT_STUN_SOFTWARE_ATTRIBUTE 1 |
Definition at line 187 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_TURN_PORT 3478 |
Definition at line 105 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DTMF_SAMPLE_RATE_MS 8 |
DTMF samples per millisecond
Definition at line 135 of file res_rtp_asterisk.c.
Referenced by ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), and ast_rtp_dtmf_end_with_duration().
#define FLAG_3389_WARNING (1 << 0) |
Definition at line 283 of file res_rtp_asterisk.c.
Referenced by process_cn_rfc3389().
#define FLAG_DTMF_COMPENSATE (1 << 4) |
Definition at line 288 of file res_rtp_asterisk.c.
#define FLAG_NAT_ACTIVE (3 << 1) |
Definition at line 284 of file res_rtp_asterisk.c.
Referenced by ast_rtp_read(), bridge_p2p_rtp_write(), and rtp_raw_write().
#define FLAG_NAT_INACTIVE (0 << 1) |
Definition at line 285 of file res_rtp_asterisk.c.
Referenced by bridge_p2p_rtp_write(), and rtp_raw_write().
#define FLAG_NAT_INACTIVE_NOWARN (1 << 1) |
Definition at line 286 of file res_rtp_asterisk.c.
Referenced by bridge_p2p_rtp_write(), and rtp_raw_write().
#define FLAG_NEED_MARKER_BIT (1 << 3) |
Definition at line 287 of file res_rtp_asterisk.c.
Referenced by ast_rtp_change_source(), ast_rtp_local_bridge(), ast_rtp_stop(), ast_rtp_update_source(), bridge_p2p_rtp_write(), and rtp_raw_write().
#define FLAG_REQ_LOCAL_BRIDGE_BIT (1 << 5) |
Definition at line 289 of file res_rtp_asterisk.c.
Referenced by ast_rtp_local_bridge(), and bridge_p2p_rtp_write().
#define MAX_TIMESTAMP_SKEW 640 |
Definition at line 92 of file res_rtp_asterisk.c.
Referenced by rtp_raw_write().
#define MAXIMUM_RTP_PORT 65535 |
Maximum port number to accept
Definition at line 103 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define MAXIMUM_RTP_RECV_BUFFER_SIZE (DEFAULT_RTP_RECV_BUFFER_SIZE + 20) |
Maximum RTP receive buffer size
Definition at line 112 of file res_rtp_asterisk.c.
Referenced by ast_rtp_read().
#define MAXIMUM_RTP_SEND_BUFFER_SIZE (DEFAULT_RTP_SEND_BUFFER_SIZE + 200) |
Maximum RTP send buffer size
Definition at line 110 of file res_rtp_asterisk.c.
Referenced by ast_rtp_rtcp_handle_nack().
#define MINIMUM_RTP_PORT 1024 |
Minimum port number to accept
Definition at line 102 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define MISSING_SEQNOS_ADDED_TRIGGER 2 |
The number of immediate missing packets that will trigger an immediate NACK
Definition at line 114 of file res_rtp_asterisk.c.
Referenced by ast_rtp_read().
#define OLD_PACKET_COUNT 1000 |
The number of previous packets that are considered old
Definition at line 113 of file res_rtp_asterisk.c.
Referenced by ast_rtp_read().
#define RTCP_DEFAULT_INTERVALMS 5000 |
Default milli-seconds between RTCP reports we send
Definition at line 95 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define RTCP_FB_NACK_BLOCK_WORD_LENGTH 2 |
Definition at line 6098 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_FB_REMB_BLOCK_WORD_LENGTH 4 |
Definition at line 6097 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_HEADER_SSRC_LENGTH 2 |
Definition at line 6096 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_LENGTH_MASK 0xFFFF |
Definition at line 6061 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_LENGTH_SHIFT 0 |
Definition at line 6070 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_MAX_INTERVALMS 60000 |
Max milli-seconds between RTCP reports we send
Definition at line 97 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define RTCP_MIN_INTERVALMS 500 |
Min milli-seconds between RTCP reports we send
Definition at line 96 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define RTCP_PADDING_MASK 0x01 |
Definition at line 6064 of file res_rtp_asterisk.c.
#define RTCP_PADDING_SHIFT 29 |
Definition at line 6073 of file res_rtp_asterisk.c.
#define RTCP_PAYLOAD_TYPE_MASK 0xFF |
Definition at line 6062 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_PAYLOAD_TYPE_SHIFT 16 |
Definition at line 6071 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_PT_APP 204 |
Application defined (From RFC3550)
Definition at line 129 of file res_rtp_asterisk.c.
#define RTCP_PT_BYE 203 |
Goodbye (To remove SSRC's from tables) (From RFC3550)
Definition at line 127 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret(), and rtcp_payload_type2str().
#define RTCP_PT_FUR 192 |
Full INTRA-frame Request / Fast Update Request (From RFC2032)
Definition at line 119 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret(), and rtcp_payload_type2str().
#define RTCP_PT_PSFB AST_RTP_RTCP_PSFB |
Payload Specific Feed Back (From RFC4585 also RFC5104)
Definition at line 132 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret(), rtcp_payload_subtype2str(), rtcp_payload_type2str(), rtp_write_rtcp_fir(), and rtp_write_rtcp_psfb().
#define RTCP_PT_RR AST_RTP_RTCP_RR |
Receiver Report (From RFC3550)
Definition at line 123 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_generate_report(), ast_rtcp_interpret(), and rtcp_payload_type2str().
#define RTCP_PT_SDES 202 |
Source Description (From RFC3550)
Definition at line 125 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_generate_sdes(), ast_rtcp_interpret(), and rtcp_payload_type2str().
#define RTCP_PT_SR AST_RTP_RTCP_SR |
Sender Report (From RFC3550)
Definition at line 121 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_generate_report(), ast_rtcp_interpret(), and rtcp_payload_type2str().
#define RTCP_REPORT_COUNT_MASK 0x1F |
Definition at line 6063 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_REPORT_COUNT_SHIFT 24 |
Definition at line 6072 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_RR_BLOCK_WORD_LENGTH 6 |
Definition at line 6095 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_SR_BLOCK_WORD_LENGTH 5 |
Definition at line 6094 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_VALID_MASK (RTCP_VERSION_MASK_SHIFTED | (((RTCP_PAYLOAD_TYPE_MASK & ~0x1)) << RTCP_PAYLOAD_TYPE_SHIFT)) |
Definition at line 6091 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_VALID_VALUE (RTCP_VERSION_SHIFTED | (RTCP_PT_SR << RTCP_PAYLOAD_TYPE_SHIFT)) |
Definition at line 6092 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_VERSION 2U |
Definition at line 6076 of file res_rtp_asterisk.c.
#define RTCP_VERSION_MASK 0x03 |
Definition at line 6065 of file res_rtp_asterisk.c.
#define RTCP_VERSION_MASK_SHIFTED (RTCP_VERSION_MASK << RTCP_VERSION_SHIFT) |
Definition at line 6078 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_VERSION_SHIFT 30 |
Definition at line 6074 of file res_rtp_asterisk.c.
#define RTCP_VERSION_SHIFTED (RTCP_VERSION << RTCP_VERSION_SHIFT) |
Definition at line 6077 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTP_DTLS_ESTABLISHED -37 |
Definition at line 161 of file res_rtp_asterisk.c.
Referenced by __rtp_recvfrom(), ast_rtcp_read(), and ast_rtp_read().
#define RTP_MTU 1200 |
Definition at line 134 of file res_rtp_asterisk.c.
#define RTP_SEQ_MOD (1<<16) |
A sequence number can't be more than 16 bits
Definition at line 94 of file res_rtp_asterisk.c.
Referenced by ast_rtp_interpret(), and rtp_instance_parse_transport_wide_cc().
#define SEQNO_CYCLE_OVER 65536 |
The number after the maximum allowed sequence number
Definition at line 116 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_generate_nack(), and ast_rtp_read().
#define SRTP_MASTER_KEY_LEN 16 |
Definition at line 157 of file res_rtp_asterisk.c.
Referenced by res_sdp_crypto_alloc(), and rtcp_debug_test_addr().
#define SRTP_MASTER_LEN (SRTP_MASTER_KEY_LEN + SRTP_MASTER_SALT_LEN) |
Definition at line 159 of file res_rtp_asterisk.c.
Referenced by rtcp_debug_test_addr().
#define SRTP_MASTER_SALT_LEN 14 |
Definition at line 158 of file res_rtp_asterisk.c.
Referenced by rtcp_debug_test_addr().
SSRC mapping comparator for AST_VECTOR_REMOVE_CMP_UNORDERED()
elem | Element to compare against |
value | Value to compare with the vector element. |
Definition at line 4045 of file res_rtp_asterisk.c.
Referenced by ast_rtp_bundle(), and ast_rtp_destroy().
#define STRICT_RTP_LEARN_TIMEOUT 5000 |
Strict RTP learning timeout time in milliseconds.
Definition at line 182 of file res_rtp_asterisk.c.
Referenced by ast_rtp_read().
#define TRANSPORT_SOCKET_RTCP 1 |
Definition at line 292 of file res_rtp_asterisk.c.
Referenced by __rtp_recvfrom(), ast_rtp_on_ice_rx_data(), ast_rtp_on_ice_tx_pkt(), ast_rtp_prop_set(), and ice_create().
#define TRANSPORT_SOCKET_RTP 0 |
Definition at line 291 of file res_rtp_asterisk.c.
Referenced by __rtp_recvfrom(), ast_rtp_on_ice_rx_data(), ast_rtp_on_ice_tx_pkt(), and ice_create().
#define TRANSPORT_TURN_RTCP 3 |
Definition at line 294 of file res_rtp_asterisk.c.
Referenced by ast_rtp_ice_turn_request(), ast_rtp_on_ice_rx_data(), ast_rtp_on_ice_tx_pkt(), and ast_rtp_on_turn_rx_rtcp_data().
#define TRANSPORT_TURN_RTP 2 |
Definition at line 293 of file res_rtp_asterisk.c.
Referenced by ast_rtp_ice_turn_request(), ast_rtp_on_ice_rx_data(), ast_rtp_on_ice_tx_pkt(), and ast_rtp_on_turn_rx_rtp_data().
#define TURN_STATE_WAIT_TIME 2000 |
Definition at line 107 of file res_rtp_asterisk.c.
Referenced by ast_rtp_ice_turn_request(), ice_reset_session(), and rtp_deallocate_transport().
#define ZFONE_PROFILE_ID 0x505a |
Definition at line 139 of file res_rtp_asterisk.c.
enum strict_rtp_mode |
Enumerator | |
---|---|
STRICT_RTP_NO | |
STRICT_RTP_YES | Don't adhere to any strict RTP rules |
STRICT_RTP_SEQNO | Strict RTP that restricts packets based on time and sequence number |
Definition at line 169 of file res_rtp_asterisk.c.
enum strict_rtp_state |
Enumerator | |
---|---|
STRICT_RTP_OPEN | |
STRICT_RTP_LEARN | No RTP packets should be dropped, all sources accepted |
STRICT_RTP_CLOSED | Accept next packet as source |
Definition at line 163 of file res_rtp_asterisk.c.
|
static |
Definition at line 862 of file res_rtp_asterisk.c.
|
static |
Definition at line 9742 of file res_rtp_asterisk.c.
|
static |
Definition at line 5869 of file res_rtp_asterisk.c.
References ast_rtp_get_ssrc(), AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, rtp_ssrc_mapping::instance, NULL, rtp_ssrc_mapping::ssrc, rtp_ssrc_mapping::ssrc_valid, ast_rtp::themssrc, and ast_rtp::themssrc_valid.
Referenced by rtp_find_instance_by_media_source_ssrc(), and rtp_find_instance_by_packet_source_ssrc().
|
static |
Definition at line 3084 of file res_rtp_asterisk.c.
References ao2_lock, ao2_ref, ao2_unlock, ast_debug_dtls, ast_log, ast_recvfrom(), AST_RTP_DTLS_CONNECTION_EXISTING, AST_RTP_DTLS_SETUP_ACTPASS, AST_RTP_DTLS_SETUP_PASSIVE, AST_RTP_ICE_COMPONENT_RTCP, AST_RTP_ICE_COMPONENT_RTP, ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_rtp_instance_get_test(), ast_rtp_instance_set_remote_address, ast_sockaddr_cmp(), ast_sockaddr_copy(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), buf, error(), in, len(), LOG_ERROR, LOG_WARNING, ast_rtp_engine_test::packets_to_drop, pj_thread_register_check(), ice_wrap::real_ice, RTP_DTLS_ESTABLISHED, ast_rtp::s, status, TRANSPORT_SOCKET_RTCP, and TRANSPORT_SOCKET_RTP.
Referenced by rtcp_recvfrom(), and rtp_recvfrom().
|
static |
Definition at line 3247 of file res_rtp_asterisk.c.
References ao2_lock, ao2_ref, ao2_unlock, AST_RTP_ICE_COMPONENT_RTCP, AST_RTP_ICE_COMPONENT_RTP, ast_rtp_instance_get_data(), ast_rtp_instance_get_srtp(), ast_rtp_instance_set_last_tx(), ast_sendto(), buf, len(), NULL, pj_thread_register_check(), ast_srtp_res::protect, ice_wrap::real_ice, ast_rtp::s, and status.
Referenced by rtcp_sendto(), and rtp_sendto().
|
static |
Definition at line 9742 of file res_rtp_asterisk.c.
|
static |
Definition at line 9613 of file res_rtp_asterisk.c.
References ast_named_acl_change_type(), rtp_reload(), and stasis_message_type().
Referenced by rtp_learning_start().
|
static |
Definition at line 927 of file res_rtp_asterisk.c.
References AST_RTP_ICE_ROLE_CONTROLLED, and AST_RTP_ICE_ROLE_CONTROLLING.
Referenced by ice_reset_session().
struct ast_module* AST_MODULE_SELF_SYM | ( | void | ) |
Definition at line 9742 of file res_rtp_asterisk.c.
|
static |
Definition at line 3323 of file res_rtp_asterisk.c.
References rtcpinterval.
Referenced by ast_rtp_interpret(), and rtp_raw_write().
|
static |
Definition at line 4579 of file res_rtp_asterisk.c.
References ast_json_pack(), ast_json_unref(), ast_rtp_get_rate(), ast_rtp_instance_get_data(), ast_rtp_publish_rtcp_message(), ast_rtp_rtcp_sent_type(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_verbose(), ast_rtp_rtcp_report_block::dlsr, ast_rtp::f, ast_frame_subclass::format, ast_rtp_rtcp_report_block::fraction, ast_rtp_rtcp_report_block::highest_seq_no, ast_rtp_rtcp_report_block::ia_jitter, ast_rtp_rtcp_report_block::lost_count, ast_rtp_rtcp_report_block::lsr, ast_rtp_rtcp_report::ntp_timestamp, NULL, ast_rtp_rtcp_report::octet_count, ast_rtp_rtcp_report::packet_count, ast_rtp_rtcp_report_block::packets, RAII_VAR, ast_rtp_rtcp_report::report_block, rtcp_debug_test_addr(), ast_rtp_rtcp_report::rtp_timestamp, ast_rtp_rtcp_report::sender_information, ast_rtp_rtcp_report_block::source_ssrc, ast_rtp_rtcp_report::ssrc, and ast_frame::subclass.
Referenced by ast_rtcp_write(), ast_rtp_read(), rtp_write_rtcp_fir(), and rtp_write_rtcp_psfb().
|
static |
Definition at line 4699 of file res_rtp_asterisk.c.
References ast_debug_rtcp, ast_rtcp_generate_report(), and ast_rtcp_generate_sdes().
Referenced by ast_rtcp_write(), ast_rtp_read(), rtp_write_rtcp_fir(), and rtp_write_rtcp_psfb().
|
static |
Definition at line 4729 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), AST_RTP_RTCP_FMT_NACK, AST_RTP_RTCP_RTPFB, ast_sockaddr_isnull(), AST_VECTOR_GET_CMP, AST_VECTOR_SIZE, ast_rtp::expectedrxseqno, find_by_value(), put_unaligned_uint32(), SEQNO_CYCLE_OVER, ast_rtp::ssrc, and ast_rtp::themssrc.
Referenced by ast_rtp_read().
|
static |
Definition at line 4491 of file res_rtp_asterisk.c.
References ast_calloc, ast_rtp_get_rate(), ast_rtp_instance_get_data(), ast_sockaddr_isnull(), ast_tvzero(), calculate_lost_packet_statistics(), ast_rtp_rtcp_report_block::dlsr, ast_rtp::f, ast_frame_subclass::format, ast_rtp_rtcp_report_block::fraction, ast_rtp_rtcp_report_block::highest_seq_no, ast_rtp_rtcp_report_block::ia_jitter, ast_rtp::lastrxseqno, ast_rtp::lastts, len(), ast_rtp_rtcp_report_block::lost_count, ast_rtp_rtcp_report_block::lsr, ast_rtp_rtcp_report::ntp_timestamp, NULL, ast_rtp_rtcp_report::octet_count, ast_rtp_rtcp_report::packet_count, ast_rtp_rtcp_report_block::packets, put_unaligned_uint32(), ast_rtp_rtcp_report::reception_report_count, ast_rtp_rtcp_report::report_block, RTCP_PT_RR, RTCP_PT_SR, ast_rtp_rtcp_report::rtp_timestamp, ast_rtp_rtcp_report::sender_information, ast_rtp_rtcp_report_block::source_ssrc, ast_rtp_rtcp_report::ssrc, ast_rtp::ssrc, ast_frame::subclass, ast_rtp::themssrc, ast_rtp::themssrc_valid, timersub(), timeval2ntp(), and ast_rtp_rtcp_report::type.
Referenced by ast_rtcp_generate_compound_prefix().
|
static |
Definition at line 4641 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), ast_sockaddr_isnull(), AST_UUID_STR_LEN, ast_rtp::cname, len(), put_unaligned_uint32(), RTCP_PT_SDES, and ast_rtp_rtcp_report::ssrc.
Referenced by ast_rtcp_generate_compound_prefix().
|
static |
True if we have seen an acceptable SSRC to learn the remote RTCP address
True if the ssrc value we have is valid and not garbage because it doesn't exist.
Always use packet source SSRC to find the rtp instance unless explicitly told not to.
Definition at line 6100 of file res_rtp_asterisk.c.
References ao2_cleanup, ao2_lock, ao2_unlock, ast_calloc, AST_CONTROL_VIDUPDATE, ast_debug, ast_debug_rtcp, ast_debug_rtp_packet_is_allowed, AST_FRAME_CONTROL, AST_FRAME_RTCP, AST_FRIENDLY_OFFSET, ast_json_pack(), ast_json_unref(), ast_null_frame, ast_rtp_instance_get_data(), ast_rtp_instance_get_prop(), ast_rtp_instance_get_test(), AST_RTP_PROPERTY_NAT, AST_RTP_PROPERTY_REMB, ast_rtp_publish_rtcp_message(), AST_RTP_RTCP_FMT_FIR, AST_RTP_RTCP_FMT_NACK, AST_RTP_RTCP_FMT_PLI, AST_RTP_RTCP_FMT_REMB, ast_rtp_rtcp_handle_nack(), ast_rtp_rtcp_received_type(), ast_rtp_rtcp_report_alloc(), AST_RTP_RTCP_RTPFB, ast_sockaddr_cmp(), ast_sockaddr_copy(), ast_sockaddr_stringify(), ast_verbose(), ast_rtp_rtcp_feedback_remb::br_exp, ast_rtp_rtcp_feedback_remb::br_mantissa, ast_frame::data, ast_frame::datalen, ast_frame::delivery, ast_rtp_rtcp_report_block::dlsr, ast_rtp::f, ast_rtp_rtcp_feedback::fmt, ast_rtp_rtcp_report_block::fraction, ast_frame::frametype, ast_rtp_rtcp_report_block::highest_seq_no, ast_rtp_rtcp_report_block::ia_jitter, ast_frame_subclass::integer, ast_rtp_rtcp_report_block::lost_count, ast_rtp_rtcp_report_block::lsr, ast_frame::mallocd, ntp2timeval(), NULL, ast_frame::offset, ast_rtp_rtcp_report_block::packets, ast_frame::ptr, RAII_VAR, ast_rtp_rtcp_feedback::remb, ast_rtp_rtcp_report::report_block, rtcp_debug_test_addr(), RTCP_FB_NACK_BLOCK_WORD_LENGTH, RTCP_FB_REMB_BLOCK_WORD_LENGTH, RTCP_HEADER_SSRC_LENGTH, RTCP_LENGTH_MASK, RTCP_LENGTH_SHIFT, rtcp_payload_subtype2str(), rtcp_payload_type2str(), RTCP_PAYLOAD_TYPE_MASK, RTCP_PAYLOAD_TYPE_SHIFT, RTCP_PT_BYE, RTCP_PT_FUR, RTCP_PT_PSFB, RTCP_PT_RR, RTCP_PT_SDES, RTCP_PT_SR, RTCP_REPORT_COUNT_MASK, RTCP_REPORT_COUNT_SHIFT, RTCP_RR_BLOCK_WORD_LENGTH, RTCP_SR_BLOCK_WORD_LENGTH, RTCP_VALID_MASK, RTCP_VALID_VALUE, RTCP_VERSION_MASK_SHIFTED, RTCP_VERSION_SHIFTED, rtp_find_instance_by_media_source_ssrc(), rtp_find_instance_by_packet_source_ssrc(), ast_frame::samples, ast_rtp_engine_test::sdes_received, ast_rtp_rtcp_report_block::source_ssrc, ast_frame::src, srtp_replay_protection, ast_frame::stream_num, STRICT_RTP_OPEN, ast_frame::subclass, ast_rtp::themssrc, ast_rtp::themssrc_valid, timeval2ntp(), ast_srtp_res::unprotect, update_jitter_stats(), update_lost_stats(), and update_rtt_stats().
Referenced by ast_rtcp_read(), and ast_rtp_read().
|
static |
Definition at line 6590 of file res_rtp_asterisk.c.
References ast_assert, AST_CONTROL_SRCCHANGE, ast_debug_stun, AST_FRAME_CONTROL, AST_FRIENDLY_OFFSET, ast_log, ast_null_frame, ast_rtcp_interpret(), ast_rtp_instance_get_data(), ast_rtp_instance_get_srtp(), ast_sockaddr_copy(), ast_sockaddr_from_sin, ast_sockaddr_ipv4_mapped(), ast_sockaddr_is_ipv4(), ast_sockaddr_stringify(), ast_sockaddr_to_sin, AST_STUN_ACCEPT, ast_stun_handle_packet(), errno, ast_rtp::f, ast_frame::frametype, ast_frame_subclass::integer, LOG_WARNING, NULL, rtcp_recvfrom(), RTP_DTLS_ESTABLISHED, ast_rtp::s, and ast_frame::subclass.
Referenced by ast_rtp_read().
|
static |
Write a RTCP packet to the far end.
Scheduler callback
Definition at line 4814 of file res_rtp_asterisk.c.
References ao2_cleanup, ao2_lock, ao2_ref, ao2_unlock, ast_log, ast_rtcp_calculate_sr_rr_statistics(), ast_rtcp_generate_compound_prefix(), ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_rtp_rtcp_report_alloc(), ast_sockaddr_copy(), ast_sockaddr_stringify(), AST_UUID_STR_LEN, cleanup(), errno, LOG_ERROR, RAII_VAR, rtcp_sendto(), and ast_rtp::themssrc_valid.
Referenced by ast_rtp_interpret(), and rtp_raw_write().
|
static |
Definition at line 8938 of file res_rtp_asterisk.c.
References ao2_bump, ao2_lock, ao2_ref, ao2_unlock, ast_debug_dtls, AST_RTP_DTLS_CONNECTION_EXISTING, ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, AST_RTP_INSTANCE_RTCP_STANDARD, ast_rtp_instance_set_remote_address, AST_VECTOR_APPEND, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_REMOVE_CMP_UNORDERED, rtp_ssrc_mapping::instance, NULL, rtp_allocate_transport(), rtp_deallocate_transport(), rtp_ssrc_mapping::ssrc, ast_rtp::ssrc, SSRC_MAPPING_ELEM_CMP, rtp_ssrc_mapping::ssrc_valid, ast_rtp::themssrc, and ast_rtp::themssrc_valid.
|
static |
Definition at line 4360 of file res_rtp_asterisk.c.
References ast_debug_rtp, ast_random(), ast_rtp_instance_get_data(), ast_rtp_instance_get_srtp(), ast_set_flag, ast_srtp_res::change_source, ast_rtp::expectedrxseqno, FLAG_NEED_MARKER_BIT, ast_rtp::lastts, and ast_rtp::ssrc.
|
static |
Definition at line 4048 of file res_rtp_asterisk.c.
References ao2_cleanup, ao2_lock, ao2_ref, ao2_unlock, ast_data_buffer_free(), ast_free, ast_rtp_instance_get_data(), AST_SCHED_DEL, ast_smoother_free(), AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_FREE, AST_VECTOR_REMOVE_CMP_UNORDERED, ast_rtp::f, ast_frame_subclass::format, NULL, rtp_deallocate_transport(), SSRC_MAPPING_ELEM_CMP, and ast_frame::subclass.
|
static |
Definition at line 4134 of file res_rtp_asterisk.c.
References ast_log, ast_rtp_codecs_payload_code_tx(), AST_RTP_DTMF, ast_rtp_instance_get_codecs(), ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_tv(), ast_tvadd(), ast_tvnow(), ast_verbose(), calc_txstamp(), digit, DTMF_SAMPLE_RATE_MS, errno, ast_rtp::lastts, LOG_ERROR, LOG_WARNING, NULL, rtp_debug_test_addr(), rtp_sendto(), and ast_rtp::ssrc.
|
static |
Definition at line 8723 of file res_rtp_asterisk.c.
References ast_channel_tech(), ast_rtp_instance_get_prop(), and AST_RTP_PROPERTY_DTMF.
|
static |
Definition at line 4209 of file res_rtp_asterisk.c.
References ast_log, ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_verbose(), calc_txstamp(), DTMF_SAMPLE_RATE_MS, errno, ast_rtp::lastts, LOG_ERROR, NULL, rtp_debug_test_addr(), rtp_sendto(), and ast_rtp::ssrc.
Referenced by ast_rtp_interpret().
|
static |
Definition at line 4342 of file res_rtp_asterisk.c.
References ast_rtp_dtmf_end_with_duration().
|
static |
Definition at line 4255 of file res_rtp_asterisk.c.
References ast_debug_rtp, ast_log, ast_rtp_get_rate(), ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_smoother_free(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_tv(), ast_tvadd(), ast_tvnow(), ast_verbose(), calc_txstamp(), cleanup(), DTMF_SAMPLE_RATE_MS, errno, ast_rtp::f, ast_frame_subclass::format, ast_rtp::lastts, LOG_ERROR, LOG_WARNING, NULL, rtp_debug_test_addr(), rtp_sendto(), ast_rtp::ssrc, and ast_frame::subclass.
Referenced by ast_rtp_dtmf_end().
|
static |
Definition at line 4127 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data().
|
static |
Definition at line 4119 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data().
|
static |
Definition at line 8926 of file res_rtp_asterisk.c.
References AST_RTP_EXTENSION_ABS_SEND_TIME, and AST_RTP_EXTENSION_TRANSPORT_WIDE_CC.
|
static |
Definition at line 8489 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::s.
|
static |
Definition at line 8873 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::cname.
|
static |
Definition at line 8865 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::ssrc.
Referenced by __rtp_find_instance_by_ssrc().
|
static |
Definition at line 8671 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_channel_id(), ast_rtp_instance_get_data(), AST_RTP_INSTANCE_STAT_CHANNEL_UNIQUEID, AST_RTP_INSTANCE_STAT_COMBINED_JITTER, AST_RTP_INSTANCE_STAT_COMBINED_LOSS, AST_RTP_INSTANCE_STAT_COMBINED_RTT, AST_RTP_INSTANCE_STAT_LOCAL_MAXJITTER, AST_RTP_INSTANCE_STAT_LOCAL_MAXRXPLOSS, AST_RTP_INSTANCE_STAT_LOCAL_MINJITTER, AST_RTP_INSTANCE_STAT_LOCAL_MINRXPLOSS, AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVJITTER, AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVRXPLOSS, AST_RTP_INSTANCE_STAT_LOCAL_SSRC, AST_RTP_INSTANCE_STAT_LOCAL_STDEVJITTER, AST_RTP_INSTANCE_STAT_LOCAL_STDEVRXPLOSS, AST_RTP_INSTANCE_STAT_MAX_RTT, AST_RTP_INSTANCE_STAT_MIN_RTT, AST_RTP_INSTANCE_STAT_NORMDEVRTT, AST_RTP_INSTANCE_STAT_REMOTE_MAXJITTER, AST_RTP_INSTANCE_STAT_REMOTE_MAXRXPLOSS, AST_RTP_INSTANCE_STAT_REMOTE_MINJITTER, AST_RTP_INSTANCE_STAT_REMOTE_MINRXPLOSS, AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVJITTER, AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVRXPLOSS, AST_RTP_INSTANCE_STAT_REMOTE_SSRC, AST_RTP_INSTANCE_STAT_REMOTE_STDEVJITTER, AST_RTP_INSTANCE_STAT_REMOTE_STDEVRXPLOSS, AST_RTP_INSTANCE_STAT_RTT, AST_RTP_INSTANCE_STAT_RXCOUNT, AST_RTP_INSTANCE_STAT_RXJITTER, AST_RTP_INSTANCE_STAT_RXOCTETCOUNT, AST_RTP_INSTANCE_STAT_RXPLOSS, AST_RTP_INSTANCE_STAT_STDEVRTT, AST_RTP_INSTANCE_STAT_TXCOUNT, AST_RTP_INSTANCE_STAT_TXJITTER, AST_RTP_INSTANCE_STAT_TXOCTETCOUNT, AST_RTP_INSTANCE_STAT_TXPLOSS, AST_RTP_STAT_SET, AST_RTP_STAT_STRCPY, AST_RTP_STAT_TERMINATOR, ast_rtp_instance_stats::channel_uniqueid, ast_rtp_instance_stats::local_maxjitter, ast_rtp_instance_stats::local_maxrxploss, ast_rtp_instance_stats::local_minjitter, ast_rtp_instance_stats::local_minrxploss, ast_rtp_instance_stats::local_normdevjitter, ast_rtp_instance_stats::local_normdevrxploss, ast_rtp_instance_stats::local_ssrc, ast_rtp_instance_stats::local_stdevjitter, ast_rtp_instance_stats::local_stdevrxploss, ast_rtp_instance_stats::maxrtt, ast_rtp_instance_stats::minrtt, ast_rtp_instance_stats::normdevrtt, ast_rtp_instance_stats::remote_maxjitter, ast_rtp_instance_stats::remote_maxrxploss, ast_rtp_instance_stats::remote_minjitter, ast_rtp_instance_stats::remote_minrxploss, ast_rtp_instance_stats::remote_normdevjitter, ast_rtp_instance_stats::remote_normdevrxploss, ast_rtp_instance_stats::remote_ssrc, ast_rtp_instance_stats::remote_stdevjitter, ast_rtp_instance_stats::remote_stdevrxploss, ast_rtp_instance_stats::rtt, ast_rtp_instance_stats::rxcount, ast_rtp_instance_stats::rxjitter, ast_rtp_instance_stats::rxoctetcount, ast_rtp_instance_stats::rxploss, ast_rtp::ssrc, ast_rtp_instance_stats::stdevrtt, ast_rtp::themssrc, ast_rtp_instance_stats::txcount, ast_rtp_instance_stats::txjitter, ast_rtp_instance_stats::txoctetcount, and ast_rtp_instance_stats::txploss.
|
static |
Definition at line 1239 of file res_rtp_asterisk.c.
References ast_rtp_engine_ice_candidate::address, ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, ao2_find, ao2_link, ao2_lock, ao2_ref, ao2_unlock, ast_debug_ice, ast_rtp_ice_candidate_destroy(), AST_RTP_ICE_CANDIDATE_TYPE_HOST, AST_RTP_ICE_CANDIDATE_TYPE_RELAYED, AST_RTP_ICE_CANDIDATE_TYPE_SRFLX, ast_sockaddr_parse(), ast_sockaddr_set_port, ast_sockaddr_stringify(), ast_strdup, ast_strndup, ast_rtp_engine_ice_candidate::foundation, ice_candidate_cmp(), ast_rtp_engine_ice_candidate::id, NULL, OBJ_POINTER, pj_thread_register_check(), ast_rtp_engine_ice_candidate::priority, ice_wrap::real_ice, ast_rtp_engine_ice_candidate::relay_address, status, ast_rtp_engine_ice_candidate::transport, and ast_rtp_engine_ice_candidate::type.
Referenced by ast_rtp_ice_turn_request(), and rtp_add_candidates_to_ice().
|
static |
Definition at line 821 of file res_rtp_asterisk.c.
References ast_rtp_engine_ice_candidate::address, ao2_alloc, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, ao2_container_count(), ao2_link, ao2_ref, ast_debug_ice, ast_rtp_ice_candidate_destroy(), ast_rtp_instance_get_data(), ast_sockaddr_copy(), ast_strdup, ast_rtp_engine_ice_candidate::foundation, ice_candidate_cmp(), ast_rtp_engine_ice_candidate::id, NULL, ast_rtp_engine_ice_candidate::priority, ast_rtp_engine_ice_candidate::relay_address, ast_rtp_engine_ice_candidate::transport, and ast_rtp_engine_ice_candidate::type.
|
static |
Destructor for locally created ICE candidates.
Definition at line 766 of file res_rtp_asterisk.c.
References ast_free, ast_rtp_engine_ice_candidate::foundation, and ast_rtp_engine_ice_candidate::transport.
Referenced by ast_rtp_ice_add_cand(), and ast_rtp_ice_add_remote_candidate().
|
static |
Definition at line 1734 of file res_rtp_asterisk.c.
References ast_debug_ice, ast_rtp_instance_get_data(), ice_reset_session(), and icesupport.
|
static |
Definition at line 1189 of file res_rtp_asterisk.c.
References ao2_ref, and ast_rtp_instance_get_data().
|
static |
Definition at line 1181 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data().
|
static |
Definition at line 1173 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data().
|
static |
Definition at line 1201 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and pj_thread_register_check().
|
static |
Definition at line 780 of file res_rtp_asterisk.c.
References ast_copy_string(), ast_rtp_instance_get_data(), ast_strlen_zero, and generate_random_string().
|
static |
Definition at line 1215 of file res_rtp_asterisk.c.
References ast_debug_ice, AST_RTP_ICE_ROLE_CONTROLLED, ast_rtp_instance_get_data(), and pj_thread_register_check().
|
static |
Definition at line 1031 of file res_rtp_asterisk.c.
References ast_rtp_engine_ice_candidate::address, ao2_cleanup, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_lock, ao2_ref, ao2_unlock, ast_debug_ice, ast_log, AST_RTP_ICE_CANDIDATE_TYPE_HOST, AST_RTP_ICE_CANDIDATE_TYPE_RELAYED, AST_RTP_ICE_CANDIDATE_TYPE_SRFLX, AST_RTP_ICE_COMPONENT_RTCP, AST_RTP_ICE_COMPONENT_RTP, ast_rtp_instance_get_data(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_test_suite_event_notify, ast_rtp_engine_ice_candidate::foundation, ice_candidates_compare(), ice_reset_session(), ast_rtp_engine_ice_candidate::id, LOG_NOTICE, LOG_WARNING, NULL, pj2ast_rtp_ice_role(), pj_thread_register_check(), ast_rtp_engine_ice_candidate::priority, ice_wrap::real_ice, ast_rtp_engine_ice_candidate::relay_address, STRICT_RTP_OPEN, timer_heap, and ast_rtp_engine_ice_candidate::type.