FreeSWITCH API Documentation
1.7.0
|
RTP. More...
Go to the source code of this file.
Data Structures | |
struct | switch_rtp_packet_t |
struct | switch_srtp_crypto_suite_s |
struct | switch_rtp_crypto_key |
struct | icand_s |
struct | ice_s |
Macros | |
#define | SWITCH_RTP_MAX_BUF_LEN 16384 |
#define | SWITCH_RTCP_MAX_BUF_LEN 16384 |
#define | SWITCH_RTP_MAX_BUF_LEN_WORDS 4094 /* (max / 4) - 2 */ |
#define | SWITCH_RTP_MAX_CRYPTO_LEN 64 |
#define | SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80" |
#define | MAX_CAND 50 |
Typedefs | |
typedef struct switch_srtp_crypto_suite_s | switch_srtp_crypto_suite_t |
typedef struct switch_rtp_crypto_key | switch_rtp_crypto_key_t |
typedef struct icand_s | icand_t |
typedef struct ice_s | ice_t |
typedef void(* | switch_rtp_invalid_handler_t )(switch_rtp_t *rtp_session, switch_socket_t *sock, void *data, switch_size_t datalen, switch_sockaddr_t *from_addr) |
Functions | |
switch_status_t | switch_rtp_add_crypto_key (switch_rtp_t *rtp_session, switch_rtp_crypto_direction_t direction, uint32_t index, switch_rtp_crypto_key_type_t type, unsigned char *key, switch_size_t keylen) |
void | switch_rtp_get_random (void *buf, uint32_t len) |
void | switch_rtp_init (switch_memory_pool_t *pool) |
Initilize the RTP System. More... | |
void | switch_rtp_shutdown (void) |
switch_port_t | switch_rtp_set_start_port (switch_port_t port) |
Set/Get RTP start port. More... | |
switch_status_t | switch_rtp_set_ssrc (switch_rtp_t *rtp_session, uint32_t ssrc) |
switch_status_t | switch_rtp_set_remote_ssrc (switch_rtp_t *rtp_session, uint32_t ssrc) |
switch_port_t | switch_rtp_set_end_port (switch_port_t port) |
Set/Get RTP end port. More... | |
switch_port_t | switch_rtp_request_port (const char *ip) |
Request a new port to be used for media. More... | |
void | switch_rtp_release_port (const char *ip, switch_port_t port) |
switch_status_t | switch_rtp_set_interval (switch_rtp_t *rtp_session, uint32_t ms_per_packet, uint32_t samples_per_interval) |
switch_status_t | switch_rtp_change_interval (switch_rtp_t *rtp_session, uint32_t ms_per_packet, uint32_t samples_per_interval) |
switch_status_t | switch_rtp_create (switch_rtp_t **new_rtp_session, switch_payload_t payload, uint32_t samples_per_interval, uint32_t ms_per_packet, switch_rtp_flag_t flags[], char *timer_name, const char **err, switch_memory_pool_t *pool) |
create a new RTP session handle More... | |
switch_rtp_t * | switch_rtp_new (const char *rx_host, switch_port_t rx_port, const char *tx_host, switch_port_t tx_port, switch_payload_t payload, uint32_t samples_per_interval, uint32_t ms_per_packet, switch_rtp_flag_t flags[], char *timer_name, const char **err, switch_memory_pool_t *pool) |
prepare a new RTP session handle and fully initilize it More... | |
switch_status_t | switch_rtp_set_remote_address (switch_rtp_t *rtp_session, const char *host, switch_port_t port, switch_port_t remote_rtcp_port, switch_bool_t change_adv_addr, const char **err) |
Assign a remote address to the RTP session. More... | |
void | switch_rtp_reset_jb (switch_rtp_t *rtp_session) |
char * | switch_rtp_get_remote_host (switch_rtp_t *rtp_session) |
switch_port_t | switch_rtp_get_remote_port (switch_rtp_t *rtp_session) |
void | switch_rtp_reset_media_timer (switch_rtp_t *rtp_session) |
void | switch_rtp_set_max_missed_packets (switch_rtp_t *rtp_session, uint32_t max) |
switch_status_t | switch_rtp_udptl_mode (switch_rtp_t *rtp_session) |
void | switch_rtp_reset (switch_rtp_t *rtp_session) |
switch_status_t | switch_rtp_set_local_address (switch_rtp_t *rtp_session, const char *host, switch_port_t port, const char **err) |
Assign a local address to the RTP session. More... | |
void | switch_rtp_kill_socket (switch_rtp_t *rtp_session) |
Kill the socket on an existing RTP session. More... | |
void | switch_rtp_break (switch_rtp_t *rtp_session) |
void | switch_rtp_flush (switch_rtp_t *rtp_session) |
uint8_t | switch_rtp_ready (switch_rtp_t *rtp_session) |
Test if an RTP session is ready. More... | |
void | switch_rtp_destroy (switch_rtp_t **rtp_session) |
Destroy an RTP session. More... | |
switch_status_t | switch_rtp_sync_stats (switch_rtp_t *rtp_session) |
switch_status_t | switch_rtp_activate_ice (switch_rtp_t *rtp_session, char *login, char *rlogin, const char *password, const char *rpassword, ice_proto_t proto, switch_core_media_ice_type_t type, ice_t *ice_params) |
Acvite ICE on an RTP session. More... | |
switch_status_t | switch_rtp_activate_rtcp (switch_rtp_t *rtp_session, int send_rate, switch_port_t remote_port, switch_bool_t mux) |
Activate sending RTCP Sender Reports (SR's) More... | |
switch_timer_t * | switch_rtp_get_media_timer (switch_rtp_t *rtp_session) |
switch_status_t | switch_rtp_set_video_buffer_size (switch_rtp_t *rtp_session, uint32_t frames, uint32_t max_frames) |
switch_status_t | switch_rtp_get_video_buffer_size (switch_rtp_t *rtp_session, uint32_t *min_frame_len, uint32_t *max_frame_len, uint32_t *cur_frame_len, uint32_t *highest_frame_len) |
switch_status_t | switch_rtp_activate_jitter_buffer (switch_rtp_t *rtp_session, uint32_t queue_frames, uint32_t max_queue_frames, uint32_t samples_per_packet, uint32_t samples_per_second) |
Acvite a jitter buffer on an RTP session. More... | |
switch_status_t | switch_rtp_debug_jitter_buffer (switch_rtp_t *rtp_session, const char *name) |
switch_status_t | switch_rtp_deactivate_jitter_buffer (switch_rtp_t *rtp_session) |
switch_status_t | switch_rtp_pause_jitter_buffer (switch_rtp_t *rtp_session, switch_bool_t pause) |
switch_jb_t * | switch_rtp_get_jitter_buffer (switch_rtp_t *rtp_session) |
void | switch_rtp_set_flag (switch_rtp_t *rtp_session, switch_rtp_flag_t flag) |
Set an RTP Flag. More... | |
void | switch_rtp_set_flags (switch_rtp_t *rtp_session, switch_rtp_flag_t flags[SWITCH_RTP_FLAG_INVALID]) |
void | switch_rtp_clear_flags (switch_rtp_t *rtp_session, switch_rtp_flag_t flags[SWITCH_RTP_FLAG_INVALID]) |
uint32_t | switch_rtp_test_flag (switch_rtp_t *rtp_session, switch_rtp_flag_t flags) |
Test an RTP Flag. More... | |
void | switch_rtp_clear_flag (switch_rtp_t *rtp_session, switch_rtp_flag_t flag) |
Clear an RTP Flag. More... | |
switch_socket_t * | switch_rtp_get_rtp_socket (switch_rtp_t *rtp_session) |
Retrieve the socket from an existing RTP session. More... | |
void | switch_rtp_ping (switch_rtp_t *rtp_session) |
uint32_t | switch_rtp_get_default_samples_per_interval (switch_rtp_t *rtp_session) |
Get the default samples per interval for a given RTP session. More... | |
void | switch_rtp_set_default_payload (switch_rtp_t *rtp_session, switch_payload_t payload) |
Set the default payload number for a given RTP session. More... | |
uint32_t | switch_rtp_get_default_payload (switch_rtp_t *rtp_session) |
Get the default payload number for a given RTP session. More... | |
void | switch_rtp_set_invalid_handler (switch_rtp_t *rtp_session, switch_rtp_invalid_handler_t on_invalid) |
Set a callback function to execute when an invalid RTP packet is encountered. More... | |
switch_status_t | switch_rtp_read (switch_rtp_t *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) |
Read data from a given RTP session. More... | |
switch_status_t | switch_rtp_queue_rfc2833 (switch_rtp_t *rtp_session, const switch_dtmf_t *dtmf) |
Queue RFC2833 DTMF data into an RTP Session. More... | |
switch_status_t | switch_rtp_queue_rfc2833_in (switch_rtp_t *rtp_session, const switch_dtmf_t *dtmf) |
Queue RFC2833 DTMF data into an RTP Session. More... | |
switch_size_t | switch_rtp_has_dtmf (switch_rtp_t *rtp_session) |
Test for presence of DTMF on a given RTP session. More... | |
switch_size_t | switch_rtp_dequeue_dtmf (switch_rtp_t *rtp_session, switch_dtmf_t *dtmf) |
Retrieve DTMF digits from a given RTP session. More... | |
switch_status_t | switch_rtp_zerocopy_read (switch_rtp_t *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags) |
Read data from a given RTP session without copying. More... | |
switch_status_t | switch_rtp_zerocopy_read_frame (switch_rtp_t *rtp_session, switch_frame_t *frame, switch_io_flag_t io_flags) |
Read data from a given RTP session without copying. More... | |
switch_status_t | switch_rtcp_zerocopy_read_frame (switch_rtp_t *rtp_session, switch_rtcp_frame_t *frame) |
Read RTCP data from a given RTP session without copying. More... | |
void | rtp_flush_read_buffer (switch_rtp_t *rtp_session, switch_rtp_flush_t flush) |
switch_status_t | switch_rtp_enable_vad (switch_rtp_t *rtp_session, switch_core_session_t *session, switch_codec_t *codec, switch_vad_flag_t flags) |
Enable VAD on an RTP Session. More... | |
switch_status_t | switch_rtp_disable_vad (switch_rtp_t *rtp_session) |
Disable VAD on an RTP Session. More... | |
int | switch_rtp_write_frame (switch_rtp_t *rtp_session, switch_frame_t *frame) |
Write data to a given RTP session. More... | |
int | switch_rtp_write_manual (switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint8_t m, switch_payload_t payload, uint32_t ts, switch_frame_flag_t *flags) |
Write data with a specified payload and sequence number to a given RTP session. More... | |
switch_status_t | switch_rtp_write_raw (switch_rtp_t *rtp_session, void *data, switch_size_t *bytes, switch_bool_t process_encryption) |
uint32_t | switch_rtp_get_ssrc (switch_rtp_t *rtp_session) |
Retrieve the SSRC from a given RTP session. More... | |
void | switch_rtp_set_private (switch_rtp_t *rtp_session, void *private_data) |
Associate an arbitrary data pointer with and RTP session. More... | |
void | switch_rtp_set_telephony_event (switch_rtp_t *rtp_session, switch_payload_t te) |
Set the payload type to consider RFC2833 DTMF. More... | |
void | switch_rtp_set_telephony_recv_event (switch_rtp_t *rtp_session, switch_payload_t te) |
void | switch_rtp_set_cng_pt (switch_rtp_t *rtp_session, switch_payload_t pt) |
Set the payload type for comfort noise. More... | |
void * | switch_rtp_get_private (switch_rtp_t *rtp_session) |
Retrieve the private data from a given RTP session. More... | |
switch_status_t | switch_rtp_set_payload_map (switch_rtp_t *rtp_session, payload_map_t **pmap) |
void | switch_rtp_intentional_bugs (switch_rtp_t *rtp_session, switch_rtp_bug_flag_t bugs) |
switch_rtp_stats_t * | switch_rtp_get_stats (switch_rtp_t *rtp_session, switch_memory_pool_t *pool) |
switch_byte_t | switch_rtp_check_auto_adj (switch_rtp_t *rtp_session) |
void | switch_rtp_set_interdigit_delay (switch_rtp_t *rtp_session, uint32_t delay) |
switch_status_t | switch_rtp_add_dtls (switch_rtp_t *rtp_session, dtls_fingerprint_t *local_fp, dtls_fingerprint_t *remote_fp, dtls_type_t type) |
switch_status_t | switch_rtp_del_dtls (switch_rtp_t *rtp_session, dtls_type_t type) |
dtls_state_t | switch_rtp_dtls_state (switch_rtp_t *rtp_session, dtls_type_t type) |
int | switch_rtp_has_dtls (void) |
switch_status_t | switch_rtp_req_bitrate (switch_rtp_t *rtp_session, uint32_t bps) |
switch_status_t | switch_rtp_ack_bitrate (switch_rtp_t *rtp_session, uint32_t bps) |
void | switch_rtp_video_refresh (switch_rtp_t *rtp_session) |
void | switch_rtp_video_loss (switch_rtp_t *rtp_session) |
RTP.
Definition in file switch_rtp.h.
#define MAX_CAND 50 |
Definition at line 102 of file switch_rtp.h.
Referenced by check_ice().
#define SWITCH_RTCP_MAX_BUF_LEN 16384 |
Definition at line 45 of file switch_rtp.h.
#define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80" |
Definition at line 50 of file switch_rtp.h.
#define SWITCH_RTP_MAX_BUF_LEN 16384 |
Definition at line 44 of file switch_rtp.h.
Referenced by find_free_frame(), switch_frame_dup(), switch_media_handle_create(), switch_rtp_create(), switch_rtp_write_manual(), switch_rtp_write_raw(), video_bug_thread(), video_helper_thread(), and video_write_thread().
#define SWITCH_RTP_MAX_BUF_LEN_WORDS 4094 /* (max / 4) - 2 */ |
Definition at line 46 of file switch_rtp.h.
Referenced by read_rtp_packet().
#define SWITCH_RTP_MAX_CRYPTO_LEN 64 |
Definition at line 47 of file switch_rtp.h.
Referenced by switch_core_media_add_crypto(), and switch_rtp_add_crypto_key().
typedef struct switch_rtp_crypto_key switch_rtp_crypto_key_t |
Definition at line 79 of file switch_rtp.h.
typedef struct switch_srtp_crypto_suite_s switch_srtp_crypto_suite_t |
enum ice_proto_t |
Enumerator | |
---|---|
IPR_RTP | |
IPR_RTCP |
Definition at line 81 of file switch_rtp.h.
enum rtcp_psfb_t |
Enumerator | |
---|---|
_RTCP_PSFB_PLI | |
_RTCP_PSFB_SLI | |
_RTCP_PSFB_RPSI | |
_RTCP_PSFB_FIR | |
_RTCP_PSFB_TSTR | |
_RTCP_PSFB_TSTN | |
_RTCP_PSFB_VBCM | |
_RTCP_PSFB_PSLEI | |
_RTCP_PSFB_AFB |
Definition at line 156 of file switch_rtp.h.
enum rtcp_pt_t |
Enumerator | |
---|---|
_RTCP_PT_IJ | |
_RTCP_PT_SR | |
_RTCP_PT_RR | |
_RTCP_PT_SDES | |
_RTCP_PT_BYE | |
_RTCP_PT_APP | |
_RTCP_PT_RTPFB | |
_RTCP_PT_PSFB | |
_RTCP_PT_XR | |
_RTCP_PT_AVB | |
_RTCP_PT_RSI | |
_RTCP_PT_TOKEN | |
_RTCP_PT_IDMS | |
_RTCP_PT_LAST |
Definition at line 115 of file switch_rtp.h.
enum rtcp_rtpfb_t |
Enumerator | |
---|---|
_RTCP_RTPFB_NACK | |
_RTCP_RTPFB_TMMBR | |
_RTCP_RTPFB_TMMBN | |
_RTCP_RTPFB_SR_REQ | |
_RTCP_RTPFB_RAMS | |
_RTCP_RTPFB_TLLEI | |
_RTCP_RTPFB_ECN_FB |
Definition at line 146 of file switch_rtp.h.
enum rtcp_sdes_t |
Enumerator | |
---|---|
_RTCP_SDES_END | |
_RTCP_SDES_CNAME | |
_RTCP_SDES_NAME | |
_RTCP_SDES_EMAIL | |
_RTCP_SDES_PHONE | |
_RTCP_SDES_LOC | |
_RTCP_SDES_TOOL | |
_RTCP_SDES_NOTE | |
_RTCP_SDES_PRIV | |
_RTCP_SDES_H323 | |
_RTCP_SDES_APSI |
Definition at line 132 of file switch_rtp.h.
Enumerator | |
---|---|
SWITCH_RTP_CRYPTO_SEND | |
SWITCH_RTP_CRYPTO_RECV | |
SWITCH_RTP_CRYPTO_SEND_RTCP | |
SWITCH_RTP_CRYPTO_RECV_RTCP | |
SWITCH_RTP_CRYPTO_MAX |
Definition at line 57 of file switch_rtp.h.
switch_status_t switch_rtp_add_crypto_key | ( | switch_rtp_t * | rtp_session, |
switch_rtp_crypto_direction_t | direction, | ||
uint32_t | index, | ||
switch_rtp_crypto_key_type_t | type, | ||
unsigned char * | key, | ||
switch_size_t | keylen | ||
) |
Definition at line 3468 of file switch_rtp.c.
References AEAD_AES_128_GCM_8, AEAD_AES_256_GCM_8, AES_CM_128_HMAC_SHA1_32, AES_CM_128_HMAC_SHA1_80, AES_CM_128_NULL_AUTH, AES_CM_256_HMAC_SHA1_80, switch_rtp_crypto_key::index, switch_rtp_crypto_key::key, memset(), switch_rtp_crypto_key::next, switch_b64_encode(), SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), switch_channel_get_uuid(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_core_alloc, switch_core_get_variable(), switch_core_session_get_channel(), switch_event_add_header(), switch_event_add_header_string(), SWITCH_EVENT_CALL_SECURE, switch_event_create, switch_event_fire, SWITCH_LOG_CRIT, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), SWITCH_RTP_CRYPTO_MAX, SWITCH_RTP_CRYPTO_RECV, SWITCH_RTP_CRYPTO_RECV_RTCP, SWITCH_RTP_CRYPTO_SEND, SWITCH_RTP_CRYPTO_SEND_RTCP, SWITCH_RTP_FLAG_SECURE_RECV, SWITCH_RTP_FLAG_SECURE_RECV_RESET, SWITCH_RTP_FLAG_SECURE_SEND, SWITCH_RTP_FLAG_SECURE_SEND_RESET, SWITCH_RTP_FLAG_VIDEO, SWITCH_RTP_MAX_CRYPTO_LEN, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_true(), and switch_rtp_crypto_key::type.
Referenced by dtls_state_setup(), switch_core_media_recover_session(), switch_core_session_apply_crypto(), and switch_core_session_check_incoming_crypto().