Asterisk - The Open Source Telephony Project
21.4.1
|
Supports RTP and RTCP with Symmetric RTP support for NAT traversal. More...
#include "asterisk.h"
#include <arpa/nameser.h>
#include "asterisk/dns_core.h"
#include "asterisk/dns_internal.h"
#include "asterisk/dns_recurring.h"
#include <sys/time.h>
#include <signal.h>
#include <fcntl.h>
#include <math.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_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... | |
Macros | |
#define | CALC_LEARNING_MIN_DURATION(count) (((count) - 1) * 9 - 5) |
Calculate the min learning duration in ms. More... | |
#define | DEFAULT_DTLS_MTU 1200 |
#define | DEFAULT_DTMF_TIMEOUT (150 * (8000 / 1000)) |
#define | DEFAULT_ICESUPPORT 1 |
#define | DEFAULT_LEARNING_MIN_DURATION CALC_LEARNING_MIN_DURATION(DEFAULT_LEARNING_MIN_SEQUENTIAL) |
#define | DEFAULT_LEARNING_MIN_SEQUENTIAL 4 |
#define | DEFAULT_RTP_END 31000 |
#define | DEFAULT_RTP_RECV_BUFFER_SIZE 20 |
#define | DEFAULT_RTP_SEND_BUFFER_SIZE 250 |
#define | DEFAULT_RTP_START 5000 |
#define | DEFAULT_SRTP_REPLAY_PROTECTION 1 |
#define | DEFAULT_STRICT_RTP STRICT_RTP_YES |
#define | DEFAULT_STUN_SOFTWARE_ATTRIBUTE 1 |
#define | DEFAULT_TURN_PORT 3478 |
#define | FLAG_3389_WARNING (1 << 0) |
#define | FLAG_DTMF_COMPENSATE (1 << 4) |
#define | FLAG_NAT_ACTIVE (3 << 1) |
#define | FLAG_NAT_INACTIVE (0 << 1) |
#define | FLAG_NAT_INACTIVE_NOWARN (1 << 1) |
#define | FLAG_NEED_MARKER_BIT (1 << 3) |
#define | FLAG_REQ_LOCAL_BRIDGE_BIT (1 << 5) |
#define | MAX_TIMESTAMP_SKEW 640 |
#define | MAXIMUM_RTP_PORT 65535 |
#define | MAXIMUM_RTP_RECV_BUFFER_SIZE (DEFAULT_RTP_RECV_BUFFER_SIZE + 20) |
#define | MAXIMUM_RTP_SEND_BUFFER_SIZE (DEFAULT_RTP_SEND_BUFFER_SIZE + 200) |
#define | MINIMUM_RTP_PORT 1024 |
#define | MISSING_SEQNOS_ADDED_TRIGGER 2 |
#define | OLD_PACKET_COUNT 1000 |
#define | RESCALE(in, inmin, inmax, outmin, outmax) ((((in - inmin)/(inmax-inmin))*(outmax-outmin))+outmin) |
#define | RTCP_DEFAULT_INTERVALMS 5000 |
#define | RTCP_FB_NACK_BLOCK_WORD_LENGTH 2 |
#define | RTCP_FB_REMB_BLOCK_WORD_LENGTH 4 |
#define | RTCP_HEADER_SSRC_LENGTH 2 |
#define | RTCP_LENGTH_MASK 0xFFFF |
#define | RTCP_LENGTH_SHIFT 0 |
#define | RTCP_MAX_INTERVALMS 60000 |
#define | RTCP_MIN_INTERVALMS 500 |
#define | RTCP_PADDING_MASK 0x01 |
#define | RTCP_PADDING_SHIFT 29 |
#define | RTCP_PAYLOAD_TYPE_MASK 0xFF |
#define | RTCP_PAYLOAD_TYPE_SHIFT 16 |
#define | RTCP_PT_APP 204 |
#define | RTCP_PT_BYE 203 |
#define | RTCP_PT_FUR 192 |
#define | RTCP_PT_PSFB AST_RTP_RTCP_PSFB |
#define | RTCP_PT_RR AST_RTP_RTCP_RR |
#define | RTCP_PT_SDES 202 |
#define | RTCP_PT_SR AST_RTP_RTCP_SR |
#define | RTCP_REPORT_COUNT_MASK 0x1F |
#define | RTCP_REPORT_COUNT_SHIFT 24 |
#define | RTCP_RR_BLOCK_WORD_LENGTH 6 |
#define | RTCP_SR_BLOCK_WORD_LENGTH 5 |
#define | RTCP_VALID_MASK (RTCP_VERSION_MASK_SHIFTED | (((RTCP_PAYLOAD_TYPE_MASK & ~0x1)) << RTCP_PAYLOAD_TYPE_SHIFT)) |
#define | RTCP_VALID_VALUE (RTCP_VERSION_SHIFTED | (RTCP_PT_SR << RTCP_PAYLOAD_TYPE_SHIFT)) |
#define | RTCP_VERSION 2U |
#define | RTCP_VERSION_MASK 0x03 |
#define | RTCP_VERSION_MASK_SHIFTED (RTCP_VERSION_MASK << RTCP_VERSION_SHIFT) |
#define | RTCP_VERSION_SHIFT 30 |
#define | RTCP_VERSION_SHIFTED (RTCP_VERSION << RTCP_VERSION_SHIFT) |
#define | RTP_DTLS_ESTABLISHED -37 |
#define | RTP_IGNORE_FIRST_PACKETS_COUNT 15 |
#define | RTP_MTU 1200 |
#define | RTP_SEQ_MOD (1<<16) |
#define | SEQNO_CYCLE_OVER 65536 |
#define | SRTP_MASTER_KEY_LEN 16 |
#define | SRTP_MASTER_LEN (SRTP_MASTER_KEY_LEN + SRTP_MASTER_SALT_LEN) |
#define | SRTP_MASTER_SALT_LEN 14 |
#define | SSRC_MAPPING_ELEM_CMP(elem, value) ((elem).instance == (value)) |
SSRC mapping comparator for AST_VECTOR_REMOVE_CMP_UNORDERED() More... | |
#define | STRICT_RTP_LEARN_TIMEOUT 5000 |
Strict RTP learning timeout time in milliseconds. More... | |
#define | TRANSPORT_SOCKET_RTCP 1 |
#define | TRANSPORT_SOCKET_RTP 0 |
#define | TRANSPORT_TURN_RTCP 3 |
#define | TRANSPORT_TURN_RTP 2 |
#define | TURN_STATE_WAIT_TIME 2000 |
#define | ZFONE_PROFILE_ID 0x505a |
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. | |
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 double | calc_media_experience_score (struct ast_rtp_instance *instance, double normdevrtt, double normdev_rxjitter, double stdev_rxjitter, double normdev_rxlost) |
Calculate a "media experience score" based on given data. More... | |
static void | calc_rxstamp_and_jitter (struct timeval *tv, struct ast_rtp *rtp, unsigned int rx_rtp_ts, 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 void | clean_stunaddr (void) |
static int | compare_by_value (int elem, int value) |
Helper function to compare an elem in a vector by value. | |
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 int | find_by_value (int elem, int value) |
Helper function to find an elem in a vector by value. | |
static char * | generate_random_string (char *buf, size_t size) |
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_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. | |
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. | |
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. | |
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 redundancy 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. | |
static struct ast_rtp_ioqueue_thread * | rtp_ioqueue_thread_get_or_create (void) |
Finder and allocator for an ioqueue thread. | |
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. | |
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 int | store_stunaddr_resolved (const struct ast_dns_query *query) |
static int | stun_address_is_blacklisted (const struct ast_sockaddr *addr) |
static void | stunaddr_resolve_callback (const struct ast_dns_query *query) |
static int | timer_worker_thread (void *data) |
Worker thread for timerheap. | |
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. | |
static void | update_jitter_stats (struct ast_rtp *rtp, unsigned int ia_jitter) |
static void | update_local_mes_stats (struct ast_rtp *rtp) |
static void | update_lost_stats (struct ast_rtp *rtp, unsigned int lost_packets) |
static void | update_reported_mes_stats (struct ast_rtp *rtp) |
static int | update_rtt_stats (struct ast_rtp *rtp, unsigned int lsr, unsigned int dlsr) |
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 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. | |
static struct ast_cli_entry | cli_rtp [] |
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. | |
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 ast_rwlock_t | stunaddr_lock = AST_RWLOCK_INIT_VALUE |
static struct ast_dns_query_recurring * | stunaddr_resolver = NULL |
static pj_timer_heap_t * | timer_heap |
Global timer heap. | |
static int | timer_terminate |
Used to tell the timer thread to terminate. | |
static pj_thread_t * | timer_thread |
Thread executing the timer heap. | |
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 159 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_DTMF_TIMEOUT (150 * (8000 / 1000)) |
#define DEFAULT_RTP_END 31000 |
Default maximum port number to end allocating RTP ports at
Definition at line 106 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 117 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 115 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 105 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define DEFAULT_STRICT_RTP STRICT_RTP_YES |
#define MAXIMUM_RTP_PORT 65535 |
Maximum port number to accept
Definition at line 109 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 118 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 116 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 108 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 120 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 119 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 101 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define RTCP_MAX_INTERVALMS 60000 |
Max milli-seconds between RTCP reports we send
Definition at line 103 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 102 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
#define RTCP_PT_APP 204 |
Application defined (From RFC3550)
Definition at line 135 of file res_rtp_asterisk.c.
#define RTCP_PT_BYE 203 |
Goodbye (To remove SSRC's from tables) (From RFC3550)
Definition at line 133 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_PT_FUR 192 |
Full INTRA-frame Request / Fast Update Request (From RFC2032)
Definition at line 125 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_PT_PSFB AST_RTP_RTCP_PSFB |
Payload Specific Feed Back (From RFC4585 also RFC5104)
Definition at line 138 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_PT_RR AST_RTP_RTCP_RR |
Receiver Report (From RFC3550)
Definition at line 129 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_PT_SDES 202 |
Source Description (From RFC3550)
Definition at line 131 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTCP_PT_SR AST_RTP_RTCP_SR |
Sender Report (From RFC3550)
Definition at line 127 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_interpret().
#define RTP_IGNORE_FIRST_PACKETS_COUNT 15 |
Because both ends usually don't start sending RTP at the same time, some of the calculations like rtt and jitter will probably be unstable for a while so we'll skip some received packets before starting analyzing. This just affects analyzing; we still process the RTP as normal.
Definition at line 203 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 100 of file res_rtp_asterisk.c.
#define SEQNO_CYCLE_OVER 65536 |
The number after the maximum allowed sequence number
Definition at line 122 of file res_rtp_asterisk.c.
Referenced by ast_rtp_read().
#define SSRC_MAPPING_ELEM_CMP | ( | elem, | |
value | |||
) | ((elem).instance == (value)) |
SSRC mapping comparator for AST_VECTOR_REMOVE_CMP_UNORDERED()
elem | Element to compare against |
value | Value to compare with the vector element. |
0 | if element does not match. |
Non-zero | if element matches. |
Definition at line 4192 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 187 of file res_rtp_asterisk.c.
Referenced by ast_rtp_read().
enum strict_rtp_mode |
Enumerator | |
---|---|
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 174 of file res_rtp_asterisk.c.
enum strict_rtp_state |
Enumerator | |
---|---|
STRICT_RTP_LEARN |
No RTP packets should be dropped, all sources accepted |
STRICT_RTP_CLOSED |
Accept next packet as source |
Definition at line 168 of file res_rtp_asterisk.c.
|
static |
Definition at line 6354 of file res_rtp_asterisk.c.
References ast_rtp_get_ssrc(), AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, rtp_ssrc_mapping::instance, rtp_ssrc_mapping::ssrc, ast_rtp::ssrc_mapping, 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 3169 of file res_rtp_asterisk.c.
References address, ao2_ref, ast_debug_dtls, ast_recvfrom(), AST_RTP_DTLS_CONNECTION_EXISTING, AST_RTP_DTLS_SETUP_ACTPASS, AST_RTP_DTLS_SETUP_PASSIVE, ast_rtp_instance_get_channel_id(), ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_rtp_instance_set_remote_address, ast_sockaddr_cmp(), ast_sockaddr_copy(), ast_sockaddr_isnull(), ast_sockaddr_pj_sockaddr_cmp(), ast_sockaddr_stringify(), ast_rtp::ice, ast_rtp::ice_active_remote_candidates, ast_rtp::ice_media_started, ast_rtp::ice_proposed_remote_candidates, ast_rtp::passthrough, pj_thread_register_check(), ice_wrap::real_ice, ast_rtp::rtcp_loop, ast_rtp::rtp_loop, ast_rtcp::s, and ast_rtcp::them.
Referenced by rtcp_recvfrom(), and rtp_recvfrom().
|
static |
Definition at line 3385 of file res_rtp_asterisk.c.
References ao2_ref, ast_rtp_instance_get_data(), ast_rtp_instance_get_srtp(), ast_rtp_instance_set_last_tx(), ast_sendto(), ast_rtp::bundled, ast_rtp::ice, pj_thread_register_check(), ice_wrap::real_ice, and ast_rtcp::s.
Referenced by rtcp_sendto(), and rtp_sendto().
|
static |
Definition at line 3461 of file res_rtp_asterisk.c.
References rtcpinterval.
Referenced by rtp_raw_write().
|
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 6585 of file res_rtp_asterisk.c.
References ast_calloc, AST_CONTROL_VIDUPDATE, ast_debug, ast_debug_rtcp, AST_FRAME_CONTROL, AST_FRAME_RTCP, AST_FRIENDLY_OFFSET, ast_json_pack(), ast_json_unref(), ast_null_frame, ast_rtp_get_rate(), ast_rtp_instance_get_channel_id(), ast_rtp_instance_get_data(), ast_rtp_instance_get_prop(), 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_samp2sec(), ast_sockaddr_cmp(), ast_sockaddr_copy(), ast_sockaddr_stringify(), 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::f, ast_rtp_rtcp_feedback::fmt, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, ast_frame::mallocd, ast_frame::offset, RAII_VAR, ast_rtp_rtcp_feedback::remb, ast_rtp_rtcp_report::report_block, ast_rtcp::reported_mes, RTCP_PT_BYE, RTCP_PT_FUR, RTCP_PT_PSFB, RTCP_PT_RR, RTCP_PT_SDES, RTCP_PT_SR, rtp_find_instance_by_media_source_ssrc(), rtp_find_instance_by_packet_source_ssrc(), ast_rtcp::rtt, ast_rtcp::rxlsr, ast_frame::samples, ast_rtp::send_buffer, ast_rtcp::soc, ast_rtcp::spc, ast_frame::src, ast_frame::stream_num, ast_rtp::stream_num, ast_rtp::strict_rtp_state, ast_frame::subclass, ast_rtcp::them, ast_rtcp::themrxlsr, ast_rtp::themssrc, and ast_rtp::themssrc_valid.
Referenced by ast_rtcp_read(), and ast_rtp_read().
|
static |
Definition at line 7091 of file res_rtp_asterisk.c.
References AST_CONTROL_SRCCHANGE, ast_debug_stun, AST_FRAME_CONTROL, AST_FRIENDLY_OFFSET, 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_handle_packet(), ast_rtp::f, ast_frame::frametype, ast_frame_subclass::integer, rtcp_recvfrom(), ast_rtcp::s, ast_frame::subclass, and ast_rtcp::them.
Referenced by ast_rtp_read().
|
static |
Write a RTCP packet to the far end.
Scheduler callback
Definition at line 5002 of file res_rtp_asterisk.c.
References ao2_ref, ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_rtp_rtcp_report_alloc(), ast_sockaddr_copy(), ast_sockaddr_stringify(), ast_rtp::bundled, cleanup(), ast_rtp::ice, RAII_VAR, rtcp_sendto(), ast_rtcp::schedid, ast_rtcp::them, and ast_rtp::themssrc_valid.
Referenced by rtp_raw_write().
|
static |
Definition at line 9460 of file res_rtp_asterisk.c.
References ao2_bump, ao2_ref, AST_RTP_DTLS_CONNECTION_EXISTING, ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_rtp_instance_set_remote_address, AST_VECTOR_APPEND, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_REMOVE_CMP_UNORDERED, ast_rtp::bundled, rtp_ssrc_mapping::instance, rtp_ssrc_mapping::ssrc, ast_rtp::ssrc, ast_rtp::ssrc_mapping, SSRC_MAPPING_ELEM_CMP, rtp_ssrc_mapping::ssrc_valid, ast_rtp::themssrc, and ast_rtp::themssrc_valid.
|
static |
Definition at line 4539 of file res_rtp_asterisk.c.
References ast_debug_rtp, ast_rtp_instance_get_data(), ast_rtp_instance_get_srtp(), ast_rtp::expectedrxseqno, and ast_rtp::ssrc.
|
static |
Definition at line 4195 of file res_rtp_asterisk.c.
References ao2_ref, ast_data_buffer_free(), ast_rtp_instance_get_data(), AST_SCHED_DEL, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_FREE, AST_VECTOR_REMOVE_CMP_UNORDERED, ast_rtp::bundled, ast_rtp::f, ast_frame_subclass::format, ast_rtp::missing_seqno, ast_rtp::owner, rtp_transport_wide_cc_statistics::packet_statistics, ast_rtp::recv_buffer, rtp_red::schedid, ast_rtp::send_buffer, ast_rtp::ssrc_mapping, SSRC_MAPPING_ELEM_CMP, ast_frame::subclass, and ast_rtp::transport_wide_cc.
|
static |
Definition at line 4282 of file res_rtp_asterisk.c.
References ast_debug, ast_format_get_sample_rate(), ast_format_none, ast_rtp_codecs_get_preferred_format(), ast_rtp_codecs_payload_code_tx(), ast_rtp_codecs_payload_code_tx_sample_rate(), 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_test_suite_event_notify, ast_tv(), ast_tvadd(), ast_tvnow(), ast_rtp::dtmf_samplerate_ms, RAII_VAR, rtp_sendto(), ast_rtp::send_digit, ast_rtp::sending_digit, ast_rtp::seqno, and ast_rtp::ssrc.
|
static |
Definition at line 9243 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_prop(), and AST_RTP_PROPERTY_DTMF.
|
static |
Definition at line 4385 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_rtp::dtmf_samplerate_ms, rtp_sendto(), ast_rtp::send_digit, ast_rtp::seqno, and ast_rtp::ssrc.
|
static |
Definition at line 4521 of file res_rtp_asterisk.c.
References ast_rtp_dtmf_end_with_duration().
|
static |
Definition at line 4431 of file res_rtp_asterisk.c.
References ast_debug_rtp, ast_rtp_get_rate(), ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_tv(), ast_tvadd(), ast_tvnow(), cleanup(), ast_rtp::dtmf_samplerate_ms, ast_rtp::expectedseqno, ast_rtp::f, ast_frame_subclass::format, rtp_sendto(), ast_rtp::send_digit, ast_rtp::sending_digit, ast_rtp::seqno, ast_rtp::ssrc, and ast_frame::subclass.
Referenced by ast_rtp_dtmf_end().
|
static |
Definition at line 4275 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::dtmfmode.
|
static |
Definition at line 4267 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::dtmfmode.
|
static |
Definition at line 8996 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtcp::s.
|
static |
Definition at line 9395 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::cname.
|
static |
Definition at line 9387 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 9178 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_MES, AST_RTP_INSTANCE_STAT_COMBINED_RTT, AST_RTP_INSTANCE_STAT_LOCAL_MAXJITTER, AST_RTP_INSTANCE_STAT_LOCAL_MAXMES, AST_RTP_INSTANCE_STAT_LOCAL_MAXRXPLOSS, AST_RTP_INSTANCE_STAT_LOCAL_MINJITTER, AST_RTP_INSTANCE_STAT_LOCAL_MINMES, AST_RTP_INSTANCE_STAT_LOCAL_MINRXPLOSS, AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVJITTER, AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVMES, AST_RTP_INSTANCE_STAT_LOCAL_NORMDEVRXPLOSS, AST_RTP_INSTANCE_STAT_LOCAL_SSRC, AST_RTP_INSTANCE_STAT_LOCAL_STDEVJITTER, AST_RTP_INSTANCE_STAT_LOCAL_STDEVMES, 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_MAXMES, AST_RTP_INSTANCE_STAT_REMOTE_MAXRXPLOSS, AST_RTP_INSTANCE_STAT_REMOTE_MINJITTER, AST_RTP_INSTANCE_STAT_REMOTE_MINMES, AST_RTP_INSTANCE_STAT_REMOTE_MINRXPLOSS, AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVJITTER, AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVMES, AST_RTP_INSTANCE_STAT_REMOTE_NORMDEVRXPLOSS, AST_RTP_INSTANCE_STAT_REMOTE_SSRC, AST_RTP_INSTANCE_STAT_REMOTE_STDEVJITTER, AST_RTP_INSTANCE_STAT_REMOTE_STDEVMES, 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_RXMES, 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_TXMES, AST_RTP_INSTANCE_STAT_TXOCTETCOUNT, AST_RTP_INSTANCE_STAT_TXPLOSS, ast_rtp_instance_stats::channel_uniqueid, ast_rtcp::expected_prior, ast_rtp_instance_stats::local_maxjitter, ast_rtp_instance_stats::local_maxmes, ast_rtp_instance_stats::local_maxrxploss, ast_rtp_instance_stats::local_minjitter, ast_rtp_instance_stats::local_minmes, ast_rtp_instance_stats::local_minrxploss, ast_rtp_instance_stats::local_normdevjitter, ast_rtp_instance_stats::local_normdevmes, ast_rtp_instance_stats::local_normdevrxploss, ast_rtp_instance_stats::local_ssrc, ast_rtp_instance_stats::local_stdevjitter, ast_rtp_instance_stats::local_stdevmes, ast_rtp_instance_stats::local_stdevrxploss, ast_rtp_instance_stats::maxrtt, ast_rtcp::maxrtt, ast_rtcp::maxrxjitter, ast_rtcp::maxrxlost, ast_rtcp::maxrxmes, ast_rtp_instance_stats::minrtt, ast_rtcp::minrtt, ast_rtcp::minrxjitter, ast_rtcp::minrxlost, ast_rtcp::minrxmes, ast_rtcp::normdev_rxjitter, ast_rtcp::normdev_rxlost, ast_rtcp::normdev_rxmes, ast_rtp_instance_stats::normdevrtt, ast_rtcp::normdevrtt, ast_rtcp::received_prior, ast_rtp_instance_stats::remote_maxjitter, ast_rtp_instance_stats::remote_maxmes, ast_rtp_instance_stats::remote_maxrxploss, ast_rtp_instance_stats::remote_minjitter, ast_rtp_instance_stats::remote_minmes, ast_rtp_instance_stats::remote_minrxploss, ast_rtp_instance_stats::remote_normdevjitter, ast_rtp_instance_stats::remote_normdevmes, ast_rtp_instance_stats::remote_normdevrxploss, ast_rtp_instance_stats::remote_ssrc, ast_rtp_instance_stats::remote_stdevjitter, ast_rtp_instance_stats::remote_stdevmes, ast_rtp_instance_stats::remote_stdevrxploss, ast_rtcp::reported_jitter, ast_rtcp::reported_lost, ast_rtcp::reported_maxjitter, ast_rtcp::reported_maxlost, ast_rtcp::reported_maxmes, ast_rtcp::reported_mes, ast_rtcp::reported_minjitter, ast_rtcp::reported_minlost, ast_rtcp::reported_minmes, ast_rtcp::reported_normdev_jitter, ast_rtcp::reported_normdev_lost, ast_rtcp::reported_normdev_mes, ast_rtcp::reported_stdev_jitter, ast_rtcp::reported_stdev_lost, ast_rtcp::reported_stdev_mes, ast_rtp_instance_stats::rtt, ast_rtcp::rtt, ast_rtp_instance_stats::rxcount, ast_rtp::rxcount, ast_rtp_instance_stats::rxjitter, ast_rtp::rxjitter, ast_rtp::rxmes, ast_rtp_instance_stats::rxmes, ast_rtp::rxoctetcount, ast_rtp_instance_stats::rxoctetcount, ast_rtp_instance_stats::rxploss, ast_rtp::ssrc, ast_rtcp::stdev_rxjitter, ast_rtcp::stdev_rxlost, ast_rtp_instance_stats::stdevrtt, ast_rtcp::stdevrtt, ast_rtp::themssrc, ast_rtp_instance_stats::txcount, ast_rtp::txcount, ast_rtp_instance_stats::txjitter, ast_rtp_instance_stats::txmes, ast_rtp::txoctetcount, ast_rtp_instance_stats::txoctetcount, and ast_rtp_instance_stats::txploss.
|
static |
Definition at line 1295 of file res_rtp_asterisk.c.
References ast_rtp_engine_ice_candidate::address, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_list, ao2_link, ao2_ref, 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, ast_rtp::ice, ast_rtp::ice_local_candidates, ast_rtp_engine_ice_candidate::id, OBJ_POINTER, pj_thread_register_check(), ast_rtp_engine_ice_candidate::priority, ice_wrap::real_ice, ast_rtp_engine_ice_candidate::relay_address, 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 877 of file res_rtp_asterisk.c.
References ast_rtp_engine_ice_candidate::address, 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, ast_rtp::ice_proposed_remote_candidates, ast_rtp_engine_ice_candidate::id, 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 |
Definition at line 1790 of file res_rtp_asterisk.c.
References ast_debug_ice, ast_rtp_instance_get_data(), ast_rtp::ice, ast_rtp::ice_num_components, and ice_reset_session().
|
static |
Definition at line 1245 of file res_rtp_asterisk.c.
References ao2_ref, ast_rtp_instance_get_data(), and ast_rtp::ice_local_candidates.
|
static |
Definition at line 1237 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::local_passwd.
|
static |
Definition at line 1229 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_rtp::local_ufrag.
|
static |
Definition at line 1257 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), ast_rtp::ice, pj_thread_register_check(), and ice_wrap::real_ice.
|
static |
Definition at line 836 of file res_rtp_asterisk.c.
References ast_copy_string(), ast_rtp_instance_get_data(), generate_random_string(), ast_rtp::local_passwd, ast_rtp::local_ufrag, ast_rtp::remote_passwd, and ast_rtp::remote_ufrag.
|
static |
Definition at line 1271 of file res_rtp_asterisk.c.
References ast_debug_ice, ast_rtp_instance_get_data(), ast_rtp::ice, pj_thread_register_check(), ice_wrap::real_ice, and ast_rtp::role.
|
static |
Definition at line 1087 of file res_rtp_asterisk.c.
References address, ast_rtp_engine_ice_candidate::address, ao2_container_count(), ao2_iterator_destroy(), ao2_iterator_init(), ao2_ref, ast_debug_ice, AST_RTP_ICE_CANDIDATE_TYPE_HOST, AST_RTP_ICE_CANDIDATE_TYPE_RELAYED, AST_RTP_ICE_CANDIDATE_TYPE_SRFLX, ast_rtp_instance_get_data(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_test_suite_event_notify, ast_rtp_engine_ice_candidate::foundation, ast_rtp::ice, ast_rtp::ice_active_remote_candidates, ast_rtp::ice_num_components, ast_rtp::ice_proposed_remote_candidates, ice_reset_session(), ast_rtp_engine_ice_candidate::id, pj_thread_register_check(), ast_rtp_engine_ice_candidate::priority, ice_wrap::real_ice, ast_rtp_engine_ice_candidate::relay_address, ast_rtp::remote_passwd, ast_rtp::remote_ufrag, ast_rtp::role, ast_rtp::strict_rtp_state, timer_heap, ast_rtp::turn_rtcp, ast_rtp::turn_rtp, and ast_rtp_engine_ice_candidate::type.
|
static |
Definition at line 947 of file res_rtp_asterisk.c.
References ao2_ref, ast_debug_ice, ast_rtp_instance_get_data(), and ast_rtp::ice.
|
static |
Definition at line 1633 of file res_rtp_asterisk.c.
References ao2_object_get_lockaddr(), ao2_ref, ast_debug_ice, ast_rtp_ice_add_cand(), ast_rtp_instance_get_data(), ast_rtp_instance_get_local_address(), ast_samp2tv(), ast_sockaddr_copy(), ast_sockaddr_is_ipv4(), ast_sockaddr_parse(), ast_sockaddr_port, ast_sockaddr_set_port, ast_tvadd(), ast_tvnow(), cachingpool, ast_rtp::cond, ast_rtp::ice, ast_rtp_ioqueue_thread::ioqueue, ast_rtp::ioqueue, ice_wrap::real_ice, ast_rtp::rtcp_loop, rtp_ioqueue_thread_get_or_create(), ast_rtp::rtp_loop, ast_rtp_ioqueue_thread::timerheap, ast_rtp::turn_rtcp, ast_rtp::turn_rtp, ast_rtp::turn_state, and ast_rtcp::us.
Referenced by rtp_add_candidates_to_ice().
|
static |
Definition at line 9150 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), ast_rtp::ssrc, ast_rtp::ssrc_orig, and ast_rtp::ssrc_saved.
|
static |
Definition at line 4139 of file res_rtp_asterisk.c.
References ao2_bump, ast_calloc, ast_format_none, ast_rtp_instance_set_data(), ast_sockaddr_copy(), ast_uuid_generate_str(), AST_VECTOR_INIT, ast_rtp::bind_address, ast_rtp::cname, ast_rtp::expectedrxseqno, ast_rtp::expectedseqno, ast_rtp::f, ast_frame_subclass::format, ast_rtp::owner, rtp_transport_wide_cc_statistics::packet_statistics, ast_rtp::rxstart, rtp_transport_wide_cc_statistics::schedid, ast_rtp::seqno, ast_rtp::ssrc, ast_rtp::ssrc_mapping, ast_rtp::stream_num, ast_frame::subclass, and ast_rtp::transport_wide_cc.
|
static |
Definition at line 8807 of file res_rtp_asterisk.c.
References ao2_ref, ast_bind(), ast_calloc, ast_data_buffer_alloc(), ast_data_buffer_free(), ast_debug_rtcp, ast_find_ourip(), ast_free_ptr(), ast_rtp_instance_get_channel_id(), ast_rtp_instance_get_data(), ast_rtp_instance_get_local_address(), ast_rtp_instance_get_remote_address, AST_RTP_INSTANCE_RTCP_STANDARD, AST_RTP_PROPERTY_ASYMMETRIC_CODEC, AST_RTP_PROPERTY_RETRANS_RECV, AST_RTP_PROPERTY_RETRANS_SEND, AST_RTP_PROPERTY_RTCP, ast_sched_del(), ast_sockaddr_copy(), ast_sockaddr_is_ipv4(), ast_sockaddr_is_ipv6(), ast_sockaddr_port, ast_sockaddr_set_port, ast_sockaddr_stringify(), ast_strdup, AST_VECTOR_FREE, AST_VECTOR_INIT, ast_rtp::asymmetric_codec, DEFAULT_RTP_RECV_BUFFER_SIZE, DEFAULT_RTP_SEND_BUFFER_SIZE, ast_rtp::ice, ast_rtp::missing_seqno, ast_rtp::recv_buffer, rtp_add_candidates_to_ice(), ast_rtcp::s, rtp_transport_wide_cc_statistics::schedid, ast_rtcp::schedid, ast_rtp::send_buffer, ast_rtcp::them, ast_rtp::transport_wide_cc, and ast_rtcp::us.
|
static |
Definition at line 9326 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), and ast_set_qos().
|
static |
Definition at line 8140 of file res_rtp_asterisk.c.
References ast_codec_media_type2str(), AST_CONTROL_SRCCHANGE, ast_data_buffer_count(), ast_data_buffer_get(), ast_data_buffer_max(), ast_data_buffer_put(), ast_data_buffer_remove(), ast_data_buffer_resize(), ast_debug, ast_debug_rtcp, ast_debug_rtp, ast_debug_stun, AST_FRAME_CONTROL, ast_frame_free(), ast_frdup, ast_free_ptr(), AST_FRIENDLY_OFFSET, AST_LIST_FIRST, AST_LIST_HEAD_INIT_NOLOCK, AST_LIST_INSERT_TAIL, ast_malloc, ast_null_frame, ast_rtcp_interpret(), ast_rtcp_read(), ast_rtp_codecs_get_stream_type(), ast_rtp_instance_get_codecs(), ast_rtp_instance_get_data(), ast_rtp_instance_get_prop(), ast_rtp_instance_get_remote_address, ast_rtp_instance_get_requested_target_address(), ast_rtp_instance_get_srtp(), AST_RTP_INSTANCE_RTCP_STANDARD, ast_rtp_instance_set_incoming_source_address(), ast_rtp_instance_set_remote_address, AST_RTP_PROPERTY_NAT, ast_rtp_rtcp_report_alloc(), ast_sockaddr_cmp(), ast_sockaddr_copy(), ast_sockaddr_from_sin, ast_sockaddr_ipv4_mapped(), ast_sockaddr_is_ipv4(), ast_sockaddr_isnull(), ast_sockaddr_port, ast_sockaddr_set_port, ast_sockaddr_stringify(), ast_sockaddr_to_sin, ast_stun_handle_packet(), ast_test_suite_event_notify, ast_tvdiff_ms(), ast_tvnow(), AST_VECTOR_ADD_SORTED, AST_VECTOR_ELEM_CLEANUP_NOOP, AST_VECTOR_GET_CMP, AST_VECTOR_REMOVE_CMP_ORDERED, AST_VECTOR_RESET, AST_VECTOR_SIZE, ast_rtp_rtcp_nack_payload::buf, codecs, compare_by_value(), ast_rtp::expectedrxseqno, ast_rtp::f, find_by_value(), ast_frame::frametype, ast_frame_subclass::integer, ast_rtp::lastrxseqno, MAXIMUM_RTP_RECV_BUFFER_SIZE, ast_rtp::missing_seqno, MISSING_SEQNOS_ADDED_TRIGGER, OLD_PACKET_COUNT, rtp_learning_info::packets, ast_rtp::prevrxseqno, rtp_learning_info::proposed_address, RAII_VAR, ast_rtp::recv_buffer, rtcp_sendto(), rtp_find_instance_by_packet_source_ssrc(), rtp_recvfrom(), ast_frame::seqno, SEQNO_CYCLE_OVER, ast_rtp_rtcp_nack_payload::size, ast_rtp::ssrc_mapping, rtp_learning_info::start, rtp_learning_info::stream_type, ast_rtp::strict_rtp_address, STRICT_RTP_CLOSED, STRICT_RTP_LEARN, STRICT_RTP_LEARN_TIMEOUT, ast_rtp::strict_rtp_state, ast_frame::subclass, ast_rtcp::them, and ast_rtp::themssrc_valid.
|
static |
Definition at line 9004 of file res_rtp_asterisk.c.
References ast_debug_rtcp, ast_ouraddrfor(), ast_rtp_instance_get_data(), ast_rtp_instance_get_local_address(), AST_RTP_INSTANCE_RTCP_STANDARD, ast_rtp_instance_set_local_address(), ast_rtp_instance_set_remote_address, ast_sockaddr_cmp(), ast_sockaddr_copy(), ast_sockaddr_isnull(), ast_sockaddr_port, ast_sockaddr_set_port, ast_sockaddr_stringify(), ast_strdup, AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, rtp_ssrc_mapping::instance, ast_rtp::last_end_timestamp, ast_rtp::last_seqno, rtp_learning_start(), ast_rtp::ssrc_mapping, ast_rtp::strict_rtp_address, ast_rtp::strict_rtp_state, strictrtp, ast_rtcp::them, and ast_rtcp::us.
|
static |
Definition at line 6448 of file res_rtp_asterisk.c.
References ast_data_buffer_get(), ast_data_buffer_max(), ast_data_buffer_resize(), ast_debug_rtcp, AST_RTP_EXTENSION_ABS_SEND_TIME, ast_rtp_instance_extmap_get_id(), ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, ast_tvnow(), ast_rtp_rtcp_nack_payload::buf, ast_rtp::ice, MAXIMUM_RTP_SEND_BUFFER_SIZE, rtp_sendto(), ast_rtp::send_buffer, and ast_rtp_rtcp_nack_payload::size.
Referenced by ast_rtcp_interpret().
|
static |
generate comfort noice (CNG)
Definition at line 9338 of file res_rtp_asterisk.c.
References AST_RTP_CN, ast_rtp_codecs_payload_code_tx(), 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(), rtp_sendto(), ast_rtp::seqno, and ast_rtp::ssrc.
|
static |
Definition at line 9403 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), AST_VECTOR_GET_ADDR, AST_VECTOR_SIZE, ast_rtp::bundled, rtp_ssrc_mapping::instance, rtp_ssrc_mapping::ssrc, ast_rtp::ssrc, ast_rtp::ssrc_mapping, rtp_ssrc_mapping::ssrc_valid, ast_rtp::themssrc, and ast_rtp::themssrc_valid.
|
static |
Definition at line 9275 of file res_rtp_asterisk.c.
References ao2_ref, ast_debug_rtp, ast_rtp_instance_get_channel_id(), ast_rtp_instance_get_data(), ast_rtp_instance_set_remote_address, AST_SCHED_DEL, ast_sched_del(), AST_SCHED_DEL_UNREF, rtp_transport_wide_cc_statistics::schedid, ast_rtcp::schedid, rtp_red::schedid, and ast_rtp::transport_wide_cc.
|
static |
Definition at line 9260 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), ast_sockaddr_from_sin, ast_sockaddr_to_sin, and ast_stun_request().
|
static |
Definition at line 4527 of file res_rtp_asterisk.c.
References ast_debug_rtp, and ast_rtp_instance_get_data().
|
static |
Definition at line 5474 of file res_rtp_asterisk.c.
References ao2_replace, AST_CONTROL_VIDUPDATE, ast_debug_rtp, ast_format_can_be_smoothed(), ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_default_ms(), ast_format_get_minimum_bytes(), ast_format_get_minimum_ms(), ast_format_get_name(), ast_format_get_smoother_flags(), AST_FRAME_CONTROL, AST_FRAME_RTCP, AST_FRAME_TEXT, AST_FRAME_VIDEO, AST_FRAME_VOICE, ast_frdup, ast_rtp_codecs_get_framing(), ast_rtp_codecs_payload_code_tx(), ast_rtp_instance_get_channel_id(), ast_rtp_instance_get_codecs(), ast_rtp_instance_get_data(), ast_rtp_instance_get_remote_address, AST_RTP_RTCP_PSFB, ast_sockaddr_isnull(), ast_format::codec, ast_frame::data, ast_frame::datalen, ast_frame_subclass::format, ast_frame::frametype, ast_frame_subclass::integer, ast_frame::offset, rtp_raw_write(), and ast_frame::subclass.
Referenced by red_write(), and rtp_red_buffer().
|
static |
Definition at line 7150 of file res_rtp_asterisk.c.
References ao2_replace, ast_debug_rtp, ast_format_cmp(), AST_FORMAT_CMP_NOT_EQUAL, ast_format_get_name(), ast_format_none, ast_rtp_codecs_find_payload_code(), ast_rtp_codecs_get_payload(), ast_rtp_codecs_payload_code_tx(), ast_rtp_instance_get_codecs(), ast_rtp_instance_get_data(), ast_rtp_instance_get_prop(), ast_rtp_instance_get_remote_address, AST_RTP_PROPERTY_NAT, ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_rtp::asymmetric_codec, ast_rtp::last_end_timestamp, RAII_VAR, rtp_sendto(), ast_rtp::sending_digit, and ast_rtp::ssrc.
|
static |
Calculate a "media experience score" based on given data.
Technically, a mean opinion score (MOS) cannot be calculated without the involvement of human eyes (video) and ears (audio). Thus instead we'll approximate an opinion using the given parameters, and call it a media experience score.
The tallied score is based upon recommendations and formulas from ITU-T G.107, ITU-T G.109, ITU-T G.113, and other various internet sources.
instance | RTP instance |
normdevrtt | The average round trip time |
normdev_rxjitter | The smoothed jitter |
stdev_rxjitter | The jitter standard deviation value |
normdev_rxlost | The average number of packets lost since last check |
Definition at line 6224 of file res_rtp_asterisk.c.
|
static |
Definition at line 1015 of file res_rtp_asterisk.c.
References ao2_object_get_lockaddr(), ast_debug_ice, ast_rtp_instance_get_data(), ast_samp2tv(), ast_sockaddr_stringify(), ast_tvadd(), ast_tvnow(), ast_rtp::cond, ast_rtp::ice, ast_rtp::ice_media_started, ast_rtp::ice_num_components, ast_rtp::ice_original_rtp_addr, ast_rtp::ice_port, ice_wrap::real_ice, ast_rtp::role, ast_rtp::turn_rtcp, and ast_rtp::turn_state.
Referenced by ast_rtp_ice_change_components(), and ast_rtp_ice_start().
|
static |
ao2 ICE wrapper object destructor.
vdoomed | Object being destroyed. |
Definition at line 972 of file res_rtp_asterisk.c.
References pj_thread_register_check(), and ice_wrap::real_ice.
|
static |
Write t140 redundancy frame.
data | primary data to be buffered |
Scheduler callback
Definition at line 9067 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), ast_rtp_write(), ast_frame::datalen, and rtp_red::t140.
Referenced by rtp_red_init().
|
static |
Definition at line 3373 of file res_rtp_asterisk.c.
References __rtp_recvfrom().
Referenced by ast_rtcp_read().
|
static |
Definition at line 3441 of file res_rtp_asterisk.c.
References __rtp_sendto().
Referenced by ast_rtcp_write(), and ast_rtp_read().
|
static |
Definition at line 3656 of file res_rtp_asterisk.c.
References ast_rtp_engine_ice_candidate::address, ao2_iterator_destroy(), ao2_iterator_init(), ao2_ref, ast_debug_ice, ast_inet_ntoa(), AST_LIST_TRAVERSE, ast_rtp_ice_add_cand(), ast_rtp_ice_turn_request(), AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK, ast_sockaddr_cmp(), ast_sockaddr_cmp_addr(), ast_sockaddr_from_sockaddr, ast_sockaddr_is_any(), ast_sockaddr_is_ipv4(), ast_sockaddr_isnull(), ast_sockaddr_setnull(), ast_sockaddr_to_pj_sockaddr(), ast_strdupa, ast_stun_request(), ast_rtp_ioqueue_thread::count, ast_rtp::ice_local_candidates, and ast_rtcp::s.
Referenced by ast_rtp_prop_set().
|
static |
Definition at line 6389 of file res_rtp_asterisk.c.
References __rtp_find_instance_by_ssrc().
Referenced by ast_rtcp_interpret().
|
static |
Definition at line 6382 of file res_rtp_asterisk.c.
References __rtp_find_instance_by_ssrc().
Referenced by ast_rtcp_interpret(), and ast_rtp_read().
|
static |
Start the strictrtp learning mode.
rtp | RTP session description |
Definition at line 3589 of file res_rtp_asterisk.c.
References ast_tvnow(), ast_rtp::lastrxseqno, rtp_learning_info::proposed_address, rtp_learning_info::start, STRICT_RTP_LEARN, and ast_rtp::strict_rtp_state.
Referenced by ast_rtp_remote_address_set().
|
static |
Definition at line 5077 of file res_rtp_asterisk.c.
References ao2_ref, ast_data_buffer_put(), ast_debug, ast_debug_rtcp, ast_debug_rtp, ast_format_cmp(), AST_FORMAT_CMP_EQUAL, ast_format_g722, AST_FRAME_VIDEO, AST_FRAME_VOICE, AST_FRFLAG_HAS_SEQUENCE_NUMBER, AST_FRFLAG_HAS_TIMING_INFO, ast_malloc, ast_rtcp_calc_interval(), ast_rtcp_write(), AST_RTP_EXTENSION_ABS_SEND_TIME, ast_rtp_get_rate(), ast_rtp_instance_extmap_get_id(), ast_rtp_instance_get_channel_id(), ast_rtp_instance_get_data(), ast_rtp_instance_get_prop(), ast_rtp_instance_get_remote_address, AST_RTP_PROPERTY_NAT, ast_sched_add(), ast_sockaddr_isnull(), ast_sockaddr_stringify(), ast_tvnow(), ast_tvzero(), ast_rtp_rtcp_nack_payload::buf, ast_frame::data, ast_frame::datalen, ast_frame::delivery, ast_rtp::expectedseqno, ast_frame_subclass::format, ast_frame_subclass::frame_ending, ast_frame::frametype, MAX_TIMESTAMP_SKEW, rtp_sendto(), ast_frame::samples, ast_rtcp::schedid, ast_rtp::send_buffer, ast_rtp::sending_digit, ast_frame::seqno, ast_rtp::seqno, ast_rtp_rtcp_nack_payload::size, ast_rtp::ssrc, ast_frame::subclass, and ast_frame::ts.
Referenced by ast_rtp_write(), and multicast_rtp_write().
|
static |
Definition at line 3379 of file res_rtp_asterisk.c.
References __rtp_recvfrom().
Referenced by ast_rtp_read().
|
static |
Definition at line 9115 of file res_rtp_asterisk.c.
References ast_rtp_instance_get_data(), ast_rtp_write(), rtp_red::buf_data, ast_frame::data, ast_frame::datalen, rtp_red::t140, and ast_frame::ts.
|
static |
Definition at line 9082 of file res_rtp_asterisk.c.
References ast_calloc, ast_format_t140_red, AST_FRAME_TEXT, ast_rtp_instance_get_data(), ast_sched_add(), rtp_red::buf_data, ast_frame::data, ast_frame_subclass::format, ast_frame::frametype, rtp_red::num_gen, rtp_red::pt, red_write(), rtp_red::schedid, ast_frame::subclass, rtp_red::t140, rtp_red::t140red, and rtp_red::ti.
|
static |
This resource is not "reloaded" so much as unloaded and loaded again. In the case of the TURN related variables, the memory referenced by a previously loaded instance should have been released when the corresponding pool was destroyed. If at some point in the future this resource were to support ACTUAL live reconfiguration and did NOT release the pool this will cause a small memory leak.
Definition at line 9944 of file res_rtp_asterisk.c.
References ast_append_acl(), ast_calloc, ast_cli_register_multiple, ast_cli_unregister_multiple(), ast_config_destroy(), ast_config_load2(), ast_debug_stun, ast_dns_resolve_recurring(), ast_false(), ast_free_acl_list(), ast_inet_ntoa(), AST_MODPRI_CHANNEL_DEPEND, AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, ast_named_acl_change_type(), ast_parse_arg(), ast_pjproject_caching_pool_destroy(), ast_pjproject_caching_pool_init(), AST_PJPROJECT_INIT_LOG_LEVEL, ast_rtp_engine_unregister(), AST_RWLIST_UNLOCK, AST_RWLIST_WRLOCK, ast_security_topic(), ast_skip_blanks(), ast_sockaddr_copy(), ast_sockaddr_parse(), ast_sockaddr_port, ast_sockaddr_set_port, ast_sockaddr_setnull(), ast_sockaddr_split_hostport(), ast_sockaddr_stringify_host(), ast_sockaddr_to_sin, ast_strdupa, ast_true(), ASTERISK_GPL_KEY, cachingpool, CALC_LEARNING_MIN_DURATION, CONFIG_FLAG_FILEUNCHANGED, DEFAULT_DTMF_TIMEOUT, DEFAULT_RTP_END, DEFAULT_RTP_START, DEFAULT_STRICT_RTP, host_candidate_overrides_clear(), ice_acl, learning_min_duration, learning_min_sequential, lock, MAXIMUM_RTP_PORT, MINIMUM_RTP_PORT, ast_variable::name, ast_variable::next, pj_thread_register_check(), RTCP_DEFAULT_INTERVALMS, RTCP_MAX_INTERVALMS, RTCP_MIN_INTERVALMS, rtcpinterval, rtpend, stasis_message_type(), stasis_subscription_accept_message_type(), STASIS_SUBSCRIPTION_FILTER_SELECTIVE, stasis_subscription_set_filter(), stasis_unsubscribe_and_join(), STRICT_RTP_SEQNO, STRICT_RTP_YES, strictrtp, stun_acl, timer_heap, timer_terminate, timer_thread, timer_worker_thread(), and ast_variable::value.
|
static |
Definition at line 3447 of file res_rtp_asterisk.c.
References __rtp_sendto(), ast_rtp_instance_get_data(), ast_rtp::txcount, and ast_rtp::txoctetcount.
Referenced by ast_rtp_dtmf_begin(), ast_rtp_dtmf_continuation(), ast_rtp_dtmf_end_with_duration(), ast_rtp_rtcp_handle_nack(), ast_rtp_sendcng(), bridge_p2p_rtp_write(), and rtp_raw_write().
|
static |
Definition at line 1504 of file res_rtp_asterisk.c.
|
static |
Definition at line 1438 of file res_rtp_asterisk.c.
|
static |
ACL for ICE addresses
Definition at line 240 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
|
static |
Lowest acceptable timeout between the first and the last sequential RTP frame.
Definition at line 223 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
|
static |
Number of sequential RTP frames needed from a single source during learning mode to accept new source.
Definition at line 222 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
|
static |
Debug RTCP packets to/from this host
Definition at line 215 of file res_rtp_asterisk.c.
|
static |
Debug only RTCP packets from IP or IP+Port if port is > 0
Definition at line 217 of file res_rtp_asterisk.c.
|
static |
Time between rtcp reports in millisecs
Definition at line 213 of file res_rtp_asterisk.c.
Referenced by ast_rtcp_calc_interval(), and rtp_reload().
|
static |
Are we debugging RTCP?
Definition at line 212 of file res_rtp_asterisk.c.
|
static |
Debug packets to/from this host
Definition at line 214 of file res_rtp_asterisk.c.
|
static |
Debug only RTP packets from IP or IP+Port if port is > 0
Definition at line 216 of file res_rtp_asterisk.c.
|
static |
Last port for RTP sessions (set in rtp.conf)
Definition at line 211 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
|
static |
First port for RTP sessions (set in rtp.conf)
Definition at line 210 of file res_rtp_asterisk.c.
|
static |
Only accept RTP frames from a defined source. If we receive an indication of a changing source, enter learning mode.
Definition at line 221 of file res_rtp_asterisk.c.
Referenced by ast_rtp_remote_address_set(), and rtp_reload().
|
static |
ACL for STUN requests
Definition at line 244 of file res_rtp_asterisk.c.
Referenced by rtp_reload().
|
static |
stunaddr recurring resolution
Definition at line 248 of file res_rtp_asterisk.c.