RTS API Documentation
1.10.11
|
Typedefs | |
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 | |
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[SWITCH_RTP_FLAG_INVALID], 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[SWITCH_RTP_FLAG_INVALID], char *timer_name, const char **err, switch_memory_pool_t *pool, switch_port_t bundle_internal_ports, switch_port_t bundle_external_port) |
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) |
void | switch_rtp_set_media_timeout (switch_rtp_t *rtp_session, uint32_t ms) |
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, uint8_t want_DTLSv1_2) |
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) |
switch_core_session_t * | switch_rtp_get_core_session (switch_rtp_t *rtp_session) |
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) |
Definition at line 185 of file switch_rtp.h.
void rtp_flush_read_buffer | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flush_t | flush | ||
) |
Definition at line 5635 of file switch_rtp.c.
References switch_rtp::flags, reset_jitter_seq(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_FLUSH, SWITCH_RTP_FLAG_PROXY_MEDIA, SWITCH_RTP_FLAG_RESET, SWITCH_RTP_FLAG_STICKY_FLUSH, SWITCH_RTP_FLAG_UDPTL, SWITCH_RTP_FLUSH_STICK, SWITCH_RTP_FLUSH_UNSTICK, switch_rtp_ready(), and switch_rtp_set_flag().
Referenced by rtp_common_read(), switch_core_media_receive_message(), and switch_rtp_set_flag().
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.
rtp_session | the RTP session to read from |
frame | an RTCP frame to populate with information |
Definition at line 8172 of file switch_rtp.c.
References switch_rtp::flags, switch_rtp::rtcp_frame, switch_rtp::rtcp_fresh_frame, SWITCH_RTP_FLAG_ENABLE_RTCP, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and SWITCH_STATUS_TIMEOUT.
Referenced by switch_core_media_read_frame().
switch_status_t switch_rtp_ack_bitrate | ( | switch_rtp_t * | rtp_session, |
uint32_t | bps | ||
) |
Definition at line 5045 of file switch_rtp.c.
References rtp_write_ready(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_rtp::tmmbn.
Referenced by switch_core_media_receive_message().
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.
Definition at line 4930 of file switch_rtp.c.
References switch_rtp_ice_t::addr, switch_rtp_ice_t::cand_responsive, ice_s::cands, ice_s::chosen, icand_s::con_addr, icand_s::con_port, switch_rtp::flags, switch_rtp::ice, switch_rtp::ice_mutex, switch_rtp_ice_t::ice_params, switch_rtp_ice_t::ice_user, ICE_VANILLA, switch_rtp_ice_t::initializing, IPR_RTP, switch_rtp_ice_t::luser_ice, switch_rtp_ice_t::next_run, switch_rtp_ice_t::pass, switch_rtp::pool, switch_rtp_ice_t::proto, switch_rtp_ice_t::ready, switch_rtp::remote_addr, switch_rtp_ice_t::rpass, switch_rtp_ice_t::rready, switch_rtp::rtcp_ice, switch_rtp::rtcp_remote_addr, RTP_BUG_ACCEPT_ANY_PACKETS, switch_rtp::rtp_bugs, rtp_type, SDP_UFRAG_MAX_SIZE, switch_rtp::session, STUN_USERNAME_MAX_SIZE, SWITCH_CHANNEL_SESSION_LOG, switch_core_strdup, switch_get_addr(), SWITCH_LOG_ERROR, SWITCH_LOG_NOTICE, switch_log_printf(), switch_micro_time_now(), switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_break(), SWITCH_RTP_FLAG_MUTE, SWITCH_RTP_FLAG_PAUSE, SWITCH_RTP_FLAG_VIDEO, SWITCH_RTP_FLAG_VIDEO_BREAK, switch_snprintf(), switch_sockaddr_get_port(), switch_sockaddr_info_get(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_UNSPEC, switch_rtp_ice_t::type, and switch_rtp_ice_t::user_ice.
Referenced by check_ice(), and switch_core_media_activate_rtp().
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.
rtp_session | the rtp session |
queue_frames | the number of frames to delay |
Definition at line 4834 of file switch_rtp.c.
References switch_rtcp_numbers_t::inter_jitter, switch_rtp::jb, switch_rtp::pool, READ_DEC, READ_INC, switch_rtp_stats_t::rtcp, switch_rtp::session, SJB_AUDIO, switch_rtp::stats, switch_channel_get_variable_dup(), switch_core_session_get_channel(), SWITCH_FALSE, switch_jb_create(), switch_jb_set_frames(), switch_jb_set_jitter_estimator(), switch_jb_set_session(), switch_jb_ts_mode(), switch_rtp_ready(), SWITCH_STATUS_FALSE, and switch_true().
Referenced by check_jb().
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)
send_rate | interval in milliseconds to send at |
Definition at line 4875 of file switch_rtp.c.
References switch_rtp::eff_remote_host_str, enable_local_rtcp_socket(), enable_remote_rtcp_socket(), switch_rtp::flags, switch_rtp::from_addr, switch_rtp::local_addr, switch_rtp::ms_per_packet, switch_rtp::pool, switch_rtp::recv_msg, switch_rtp::remote_port, switch_rtp::remote_rtcp_port, switch_rtp::rtcp_from_addr, switch_rtp::rtcp_interval, switch_rtp::rtcp_local_addr, switch_rtp::rtcp_recv_msg, switch_rtp::rtcp_recv_msg_p, switch_rtp::rtcp_remote_addr, switch_rtp::rtcp_sock_input, switch_rtp::rtcp_sock_output, switch_rtp::session, switch_rtp::sock_input, switch_rtp::sock_output, SWITCH_CHANNEL_SESSION_LOG, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_RTP_FLAG_ENABLE_RTCP, SWITCH_RTP_FLAG_RTCP_MUX, SWITCH_RTP_FLAG_RTCP_PASSTHRU, switch_sockaddr_info_get(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and SWITCH_UNSPEC.
Referenced by check_ice(), and switch_core_media_activate_rtp().
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, | ||
uint8_t | want_DTLSv1_2 | ||
) |
Definition at line 3813 of file switch_rtp.c.
References BIO_dtls_filter(), switch_dtls_s::ca, switch_directories::certs_dir, DS_HANDSHAKE, switch_rtp::dtls, dtls_set_state, DTLS_SRTP_FNAME, DTLS_TYPE_CLIENT, DTLS_TYPE_RTCP, DTLS_TYPE_RTP, DTLS_TYPE_SERVER, switch_dtls_s::filter_bio, switch_rtp::flags, switch_rtp::ice_mutex, switch_dtls_s::local_fp, MAX_DTLS_MTU, switch_dtls_s::mtu, switch_dtls_s::pem, switch_rtp::pool, switch_dtls_s::pvt, switch_dtls_s::read_bio, switch_dtls_s::remote_addr, switch_rtp::remote_addr, switch_dtls_s::remote_fp, switch_dtls_s::rsa, switch_rtp::rtcp_dtls, switch_rtp::rtcp_remote_addr, switch_rtp::rtcp_sock_output, switch_dtls_s::rtp_session, rtp_type, switch_rtp::session, switch_dtls_s::sock_output, switch_rtp::sock_output, switch_dtls_s::ssl, ssl_ctx, switch_dtls_s::ssl_ctx, ssl_method, dtls_fp_s::str, switch_assert, SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE, switch_channel_get_variable, switch_channel_hangup, SWITCH_CHANNEL_SESSION_LOG, switch_core_alloc, switch_core_cert_expand_fingerprint(), switch_core_session_get_channel(), switch_core_sprintf(), switch_file_exists(), SWITCH_GLOBAL_dirs, switch_goto_status, SWITCH_LOG_CRIT, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_PATH_SEPARATOR, switch_rtp_break(), switch_rtp_del_dtls(), SWITCH_RTP_FLAG_VIDEO_BREAK, switch_rtp_ready(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_dtls_s::type, switch_dtls_s::write_bio, and zstr.
Referenced by check_dtls_reinvite(), and switch_core_media_activate_rtp().
void switch_rtp_break | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 5080 of file switch_rtp.c.
References CF_VIDEO_BREAK, switch_rtp::flag_mutex, switch_rtp::flags, ping_socket(), switch_rtp::session, switch_rtp::sock_input, switch_channel_clear_flag(), switch_channel_test_flag(), switch_core_session_get_channel(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_BREAK, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_VIDEO, SWITCH_RTP_FLAG_VIDEO_BREAK, switch_rtp_ready(), and switch_rtp_video_refresh().
Referenced by switch_core_media_break(), switch_rtp_activate_ice(), switch_rtp_add_dtls(), and switch_rtp_udptl_mode().
switch_status_t switch_rtp_change_interval | ( | switch_rtp_t * | rtp_session, |
uint32_t | ms_per_packet, | ||
uint32_t | samples_per_interval | ||
) |
Definition at line 4414 of file switch_rtp.c.
References memset(), switch_rtp::ms_per_packet, switch_rtp::pool, READ_DEC, READ_INC, switch_rtp::samples_per_interval, switch_rtp::session, SWITCH_CHANNEL_SESSION_LOG, switch_core_timer_destroy(), switch_core_timer_init(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_rtp_set_interval(), SWITCH_STATUS_SUCCESS, switch_rtp::timer, switch_timer::timer_interface, switch_rtp::timer_name, WRITE_DEC, WRITE_INC, and switch_rtp::write_timer.
Referenced by switch_core_media_set_codec().
switch_byte_t switch_rtp_check_auto_adj | ( | switch_rtp_t * | rtp_session | ) |
void switch_rtp_clear_flag | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flag_t | flag | ||
) |
Clear an RTP Flag.
rtp_session | the RTP session |
flags | the flags to clear |
Definition at line 5431 of file switch_rtp.c.
References FALSE, switch_rtp::flag_mutex, switch_rtp::flags, switch_rtp_stats_t::inbound, switch_rtp_numbers_t::last_processed_seq, reset_jitter_seq(), switch_rtp::sock_input, switch_rtp::stats, SWITCH_FALSE, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_DTMF_ON, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_PASSTHRU, SWITCH_RTP_FLAG_PAUSE, switch_rtp_pause_jitter_buffer(), SWITCH_SO_NONBLOCK, and switch_socket_opt_set().
Referenced by do_flush(), handle_ice(), read_bundle_rtp_packet(), read_rtcp_packet(), read_rtp_packet(), rtp_common_read(), rtp_common_write(), rtp_flush_read_buffer(), switch_core_media_clear_rtp_flag(), switch_core_media_negotiate_sdp(), switch_core_media_receive_message(), switch_core_media_resume(), switch_core_media_toggle_hold(), switch_core_session_passthru(), switch_rtp_clear_flags(), switch_rtp_create(), switch_rtp_disable_vad(), switch_rtp_udptl_mode(), and switch_rtp_write_raw().
void switch_rtp_clear_flags | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flag_t | flags[SWITCH_RTP_FLAG_INVALID] | ||
) |
Definition at line 5361 of file switch_rtp.c.
References switch_rtp_clear_flag(), and SWITCH_RTP_FLAG_INVALID.
Referenced by switch_core_media_receive_message().
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[SWITCH_RTP_FLAG_INVALID], | ||
char * | timer_name, | ||
const char ** | err, | ||
switch_memory_pool_t * | pool | ||
) |
create a new RTP session handle
new_rtp_session | a poiter to aim at the new session |
payload | the IANA payload number |
samples_per_interval | the default samples_per_interval |
ms_per_packet | time in microseconds per packet |
flags | flags to control behaviour |
timer_name | timer interface to use |
err | a pointer to resolve error messages |
pool | a memory pool to use for the session |
Definition at line 4473 of file switch_rtp.c.
References switch_rtp_numbers_t::burstrate, switch_rtp::cng_pt, switch_rtp::conf_samples_per_interval, switch_rtp::dtmf_data, switch_rtp_rfc2833_data::dtmf_inqueue, switch_rtp_rfc2833_data::dtmf_mutex, switch_rtp_rfc2833_data::dtmf_queue, switch_rtp::flag_mutex, switch_rtp::flags, switch_rtp::from_addr, rtp_msg_t::header, switch_rtp::ice_mutex, switch_rtp_stats_t::inbound, INVALID_PT, switch_rtp_numbers_t::jitter_add, switch_rtp_numbers_t::jitter_addsq, switch_rtp_numbers_t::jitter_n, switch_rtp_numbers_t::last_loss, switch_rtp_numbers_t::last_proc_time, switch_rtp_numbers_t::last_processed_seq, switch_rtp::last_write_ts, switch_rtp_numbers_t::loss, switch_rtp_numbers_t::lossrate, switch_rtp_numbers_t::max_variance, memset(), switch_rtp_numbers_t::min_variance, switch_rtp_numbers_t::mos, switch_rtp::payload, pool, switch_rtp::pool, switch_rtp_numbers_t::R, switch_rtp::read_mutex, switch_rtp::ready, switch_rtp::recv_msg, switch_rtp::recv_te, switch_rtp::rtcp_from_addr, switch_rtp::rtcp_last_sent, switch_rtp::rtp_from_addr, switch_rtp::send_msg, switch_rtp::seq, switch_rtp::session, switch_rtp::ssrc, switch_rtp::stats, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_private(), switch_core_alloc, switch_core_memory_pool_get_data(), switch_core_session_get_channel(), switch_core_strdup, switch_core_timer_init(), switch_epoch_time_now(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_micro_time_now(), switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_queue_create(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_ENABLE_RTCP, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_USE_TIMER, SWITCH_RTP_FLAG_VIDEO, SWITCH_RTP_MAX_BUF_LEN, switch_rtp_set_flag(), switch_rtp_set_flags(), switch_rtp_set_interval(), switch_sockaddr_create(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_rtp::te, switch_timer::tick, switch_rtp::timer, switch_rtp::timer_name, switch_rtp::write_mutex, switch_rtp::write_timer, and zstr.
Referenced by switch_rtp_new().
switch_status_t switch_rtp_deactivate_jitter_buffer | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4761 of file switch_rtp.c.
References switch_rtp::flags, SWITCH_RTP_FLAG_KILL_JB, switch_rtp_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by check_jb().
switch_status_t switch_rtp_debug_jitter_buffer | ( | switch_rtp_t * | rtp_session, |
const char * | name | ||
) |
Definition at line 4814 of file switch_rtp.c.
References switch_rtp::jb, switch_jb_debug_level(), switch_rtp_ready(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_rtp::vb.
Referenced by check_jb().
switch_status_t switch_rtp_del_dtls | ( | switch_rtp_t * | rtp_session, |
dtls_type_t | type | ||
) |
Definition at line 3736 of file switch_rtp.c.
References switch_rtp::dtls, DTLS_TYPE_RTCP, DTLS_TYPE_RTP, switch_rtp::flags, free_dtls(), switch_rtp::ice_mutex, switch_rtp::jb, switch_rtp::recv_ctx, switch_rtp::rtcp_dtls, switch_rtp::send_ctx, switch_goto_status, switch_jb_reset(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_SECURE_RECV, SWITCH_RTP_FLAG_SECURE_SEND, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_rtp::vb, and switch_rtp::vbw.
Referenced by switch_rtp_add_dtls().
switch_size_t switch_rtp_dequeue_dtmf | ( | switch_rtp_t * | rtp_session, |
switch_dtmf_t * | dtmf | ||
) |
Retrieve DTMF digits from a given RTP session.
rtp_session | RTP session to retrieve digits from |
dtmf | the dtmf |
Definition at line 8064 of file switch_rtp.c.
References switch_dtmf_t::digit, switch_rtp::dtmf_data, switch_rtp_rfc2833_data::dtmf_inqueue, switch_rtp_rfc2833_data::dtmf_mutex, switch_dtmf_t::duration, switch_rtp::session, SWITCH_CHANNEL_SESSION_LOG, switch_channel_var_true(), switch_core_session_get_channel(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_trypop(), switch_rtp_ready(), SWITCH_SENSITIVE_DTMF_VARIABLE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_read_frame().
void switch_rtp_destroy | ( | switch_rtp_t ** | rtp_session | ) |
Destroy an RTP session.
rtp_session | an RTP session to destroy |
Definition at line 5186 of file switch_rtp.c.
References free_dtls(), READ_DEC, READ_INC, switch_rtp::ready, SWITCH_CHANNEL_SESSION_LOG, switch_core_timer_destroy(), switch_jb_destroy(), switch_jb_get_nack_success(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_trypop(), switch_rtp_disable_vad(), SWITCH_RTP_FLAG_SECURE_RECV, SWITCH_RTP_FLAG_SECURE_SEND, SWITCH_RTP_FLAG_SHUTDOWN, SWITCH_RTP_FLAG_VAD, switch_rtp_kill_socket(), switch_rtp_release_port(), switch_safe_free, switch_socket_close(), SWITCH_STATUS_SUCCESS, WRITE_DEC, and WRITE_INC.
Referenced by switch_core_media_deactivate_rtp().
switch_status_t switch_rtp_disable_vad | ( | switch_rtp_t * | rtp_session | ) |
Disable VAD on an RTP Session.
rtp_session | the RTP session |
Definition at line 8815 of file switch_rtp.c.
References switch_rtp::flags, switch_core_codec_destroy(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_VAD, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_rtp_vad_data::vad_codec, and switch_rtp::vad_data.
Referenced by switch_rtp_destroy().
dtls_state_t switch_rtp_dtls_state | ( | switch_rtp_t * | rtp_session, |
dtls_type_t | type | ||
) |
Definition at line 3705 of file switch_rtp.c.
References DS_OFF, switch_rtp::dtls, DTLS_TYPE_RTCP, DTLS_TYPE_RTP, switch_rtp::ice_mutex, switch_rtp::rtcp_dtls, switch_dtls_s::state, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by check_engine().
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.
rtp_session | the RTP session |
session | the core session associated with the RTP session |
codec | the codec the channel is currenty using |
flags | flags for control |
Definition at line 8830 of file switch_rtp.c.
References switch_rtp_vad_data::bg_count, switch_rtp_vad_data::bg_len, switch_rtp_vad_data::bg_level, switch_rtp_vad_data::cng_freq, switch_rtp_vad_data::diff_level, switch_rtp_vad_data::fire_events, switch_rtp_vad_data::flags, switch_rtp::flags, switch_rtp_vad_data::hangover, switch_rtp_vad_data::hangunder, switch_codec_implementation::iananame, switch_codec::implementation, memset(), switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::modname, switch_rtp_vad_data::next_scan, switch_codec_implementation::number_of_channels, switch_rtp::pool, switch_rtp_vad_data::read_codec, switch_codec_implementation::samples_per_second, switch_rtp_vad_data::scan_freq, switch_rtp_vad_data::session, switch_rtp::session, switch_rtp_vad_data::start, switch_rtp_vad_data::start_talking, switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_init, switch_core_session_get_channel(), switch_epoch_time_now(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_micro_time_now(), SWITCH_RTP_FLAG_VAD, switch_rtp_ready(), switch_rtp_set_flag(), switch_set_flag, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_true(), SWITCH_VAD_FLAG_CNG, SWITCH_VAD_FLAG_TALKING, switch_rtp_vad_data::ts, switch_rtp_vad_data::vad_codec, switch_rtp::vad_data, VAD_FIRE_NOT_TALK, and VAD_FIRE_TALK.
Referenced by switch_core_media_activate_rtp().
void switch_rtp_flush | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 5025 of file switch_rtp.c.
References SWITCH_RTP_FLAG_FLUSH, switch_rtp_ready(), and switch_rtp_set_flag().
Referenced by switch_core_media_receive_message().
switch_core_session_t* switch_rtp_get_core_session | ( | switch_rtp_t * | rtp_session | ) |
uint32_t switch_rtp_get_default_payload | ( | switch_rtp_t * | rtp_session | ) |
Get the default payload number for a given RTP session.
rtp_session | the RTP session to get the payload number from |
Definition at line 5340 of file switch_rtp.c.
References switch_rtp::payload.
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.
rtp_session | the RTP session to get the samples per interval from |
Definition at line 5330 of file switch_rtp.c.
References switch_rtp::samples_per_interval.
switch_jb_t* switch_rtp_get_jitter_buffer | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4726 of file switch_rtp.c.
References switch_rtp::jb, switch_rtp_ready(), and switch_rtp::vb.
Referenced by switch_core_media_get_jb(), switch_core_media_read_frame(), and switch_core_media_receive_message().
switch_timer_t* switch_rtp_get_media_timer | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4712 of file switch_rtp.c.
References switch_rtp::flags, switch_core_timer_sync(), SWITCH_RTP_FLAG_VIDEO, switch_rtp::timer, and switch_timer::timer_interface.
Referenced by switch_core_media_get_timer().
void* switch_rtp_get_private | ( | switch_rtp_t * | rtp_session | ) |
Retrieve the private data from a given RTP session.
rtp_session | the RTP session to retrieve the data from |
Definition at line 9233 of file switch_rtp.c.
References switch_rtp::private_data.
void switch_rtp_get_random | ( | void * | buf, |
uint32_t | len | ||
) |
Definition at line 2542 of file switch_rtp.c.
References switch_stun_random_string().
Referenced by switch_core_media_build_crypto().
char* switch_rtp_get_remote_host | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 3034 of file switch_rtp.c.
References switch_rtp::remote_host_str, and zstr.
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_process_t38_passthru(), switch_core_media_proxy_remote_addr(), and switch_core_media_start_udptl().
switch_port_t switch_rtp_get_remote_port | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 3039 of file switch_rtp.c.
References switch_rtp::remote_port.
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_process_t38_passthru(), switch_core_media_proxy_remote_addr(), and switch_core_media_start_udptl().
switch_socket_t* switch_rtp_get_rtp_socket | ( | switch_rtp_t * | rtp_session | ) |
Retrieve the socket from an existing RTP session.
rtp_session | the RTP session to retrieve the socket from |
Definition at line 5325 of file switch_rtp.c.
References switch_rtp::sock_input.
uint32_t switch_rtp_get_ssrc | ( | switch_rtp_t * | rtp_session | ) |
Retrieve the SSRC from a given RTP session.
rtp_session | the RTP session to retrieve from |
Definition at line 9223 of file switch_rtp.c.
References switch_rtp::ssrc.
Referenced by switch_core_media_activate_rtp().
switch_rtp_stats_t* switch_rtp_get_stats | ( | switch_rtp_t * | rtp_session, |
switch_memory_pool_t * | pool | ||
) |
Definition at line 9080 of file switch_rtp.c.
References do_mos(), switch_rtp::flag_mutex, switch_rtp_stats_t::inbound, switch_rtp::jb, switch_rtp_numbers_t::largest_jb_size, switch_rtp::stats, switch_core_alloc, switch_jb_get_frames(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_media_get_stats().
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 | ||
) |
Definition at line 4773 of file switch_rtp.c.
References switch_jb_get_frames(), SWITCH_STATUS_FALSE, and switch_rtp::vb.
Referenced by check_jb_sync().
int switch_rtp_has_dtls | ( | void | ) |
Definition at line 3697 of file switch_rtp.c.
Referenced by check_dtls_reinvite(), check_ice(), switch_core_media_activate_rtp(), switch_core_media_gen_local_sdp(), switch_core_media_negotiate_sdp(), and switch_ice_direction().
switch_size_t switch_rtp_has_dtmf | ( | switch_rtp_t * | rtp_session | ) |
Test for presence of DTMF on a given RTP session.
rtp_session | session to test |
Definition at line 8051 of file switch_rtp.c.
References switch_rtp::dtmf_data, switch_rtp_rfc2833_data::dtmf_inqueue, switch_rtp_rfc2833_data::dtmf_mutex, switch_mutex_lock(), switch_mutex_unlock(), switch_queue_size(), and switch_rtp_ready().
Referenced by switch_core_media_read_frame().
void switch_rtp_init | ( | switch_memory_pool_t * | pool | ) |
Initilize the RTP System.
pool | the memory pool to use for long term allocations |
Definition at line 1522 of file switch_rtp.c.
References port_lock, SWITCH_CHANNEL_LOG, switch_core_hash_init, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_init(), SWITCH_MUTEX_NESTED, and switch_rtp_dtls_init().
Referenced by switch_core_init().
void switch_rtp_intentional_bugs | ( | switch_rtp_t * | rtp_session, |
switch_rtp_bug_flag_t | bugs | ||
) |
Definition at line 2662 of file switch_rtp.c.
References RTP_BUG_START_SEQ_AT_ZERO, switch_rtp::rtp_bugs, and switch_rtp::seq.
Referenced by switch_core_media_activate_rtp().
void switch_rtp_kill_socket | ( | switch_rtp_t * | rtp_session | ) |
Kill the socket on an existing RTP session.
rtp_session | an RTP session to kill the socket of |
Definition at line 5120 of file switch_rtp.c.
References switch_rtp::flag_mutex, switch_rtp::flags, ping_socket(), switch_rtp::rtcp_sock_input, switch_rtp::rtcp_sock_output, switch_rtp::sock_input, switch_rtp::sock_output, switch_assert, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_ENABLE_RTCP, SWITCH_RTP_FLAG_IO, SWITCH_SHUTDOWN_READWRITE, and switch_socket_shutdown().
Referenced by switch_core_media_kill_socket(), switch_rtp_destroy(), and switch_rtp_set_local_address().
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[SWITCH_RTP_FLAG_INVALID], | ||
char * | timer_name, | ||
const char ** | err, | ||
switch_memory_pool_t * | pool, | ||
switch_port_t | bundle_internal_ports, | ||
switch_port_t | bundle_external_port | ||
) |
prepare a new RTP session handle and fully initilize it
rx_host | the local address |
rx_port | the local port |
tx_host | the remote address |
tx_port | the remote port |
payload | the IANA payload number |
samples_per_interval | the default samples_per_interval |
ms_per_packet | time in microseconds per packet |
flags | flags to control behaviour |
timer_name | timer interface to use |
err | a pointer to resolve error messages |
pool | a memory pool to use for the session |
bundle_port | port used by bundled stream locally, for video thread this is the port where it will forward audio (internal bundle port on which audio is listening), and for audio this is the port where it will send RTP (external bundle port where video is listening) |
Definition at line 4623 of file switch_rtp.c.
References switch_rtp::flag_mutex, switch_rtp::pool, switch_rtp::ready, switch_rtp::rx_host, switch_rtp::rx_port, switch_core_strdup, switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_create(), SWITCH_RTP_FLAG_DETECT_SSRC, SWITCH_RTP_FLAG_FLUSH, switch_rtp_release_port(), switch_rtp_set_flag(), switch_rtp_set_local_address(), switch_rtp_set_remote_address(), SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and zstr.
Referenced by switch_core_media_activate_rtp().
switch_status_t switch_rtp_pause_jitter_buffer | ( | switch_rtp_t * | rtp_session, |
switch_bool_t | pause | ||
) |
Definition at line 4735 of file switch_rtp.c.
References switch_rtp::jb, switch_rtp::pause_jb, rtp_type, switch_rtp::session, SWITCH_CHANNEL_SESSION_LOG, switch_jb_reset(), SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_STATUS_SUCCESS, and switch_rtp::vb.
Referenced by check_jb(), switch_core_media_receive_message(), switch_rtp_clear_flag(), and switch_rtp_set_flag().
void switch_rtp_ping | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 2537 of file switch_rtp.c.
References check_rtcp_and_ice().
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.
rtp_session | the rtp session to use |
dtmf | the dtmf digits to queue |
Definition at line 8091 of file switch_rtp.c.
References switch_rtp::dtmf_data, switch_rtp_rfc2833_data::dtmf_queue, switch_dtmf_t::duration, switch_core_min_dtmf_duration(), switch_queue_trypush(), switch_rtp_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_queue_rfc2833().
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.
rtp_session | the rtp session to use |
dtmf | the dtmf digits to queue |
Definition at line 8117 of file switch_rtp.c.
References switch_rtp::dtmf_data, switch_rtp_rfc2833_data::dtmf_inqueue, switch_dtmf_t::duration, switch_core_min_dtmf_duration(), switch_queue_trypush(), switch_rtp_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by handle_rfc2833(), and switch_core_media_queue_rfc2833_in().
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.
rtp_session | the RTP session to read from |
data | the data to read |
datalen | a pointer to the datalen |
payload_type | the IANA payload of the packet |
flags | flags |
io_flags | i/o flags |
Definition at line 8142 of file switch_rtp.c.
References RTP_BODY, rtp_common_read(), rtp_header_len, switch_rtp_ready(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, and SWITCH_STATUS_TIMEOUT.
uint8_t switch_rtp_ready | ( | switch_rtp_t * | rtp_session | ) |
Test if an RTP session is ready.
rtp_session | an RTP session to test |
Definition at line 5147 of file switch_rtp.c.
References switch_rtp::flag_mutex, switch_rtp::flags, switch_rtp::ready, switch_rtp::remote_addr, switch_rtp::sock_input, switch_rtp::sock_output, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_IO, and SWITCH_RTP_FLAG_SHUTDOWN.
Referenced by check_ice(), check_media_timeout_params(), do_flush(), handle_ice(), handle_rfc2833(), rtp_common_read(), rtp_common_write(), rtp_flush_read_buffer(), switch_core_media_activate_rtp(), switch_core_media_break(), switch_core_media_check_udptl_mode(), switch_core_media_clear_rtp_flag(), switch_core_media_get_jb(), switch_core_media_kill_socket(), switch_core_media_negotiate_sdp(), switch_core_media_patch_sdp(), switch_core_media_proxy_remote_addr(), switch_core_media_queue_rfc2833(), switch_core_media_queue_rfc2833_in(), switch_core_media_read_frame(), switch_core_media_read_lock_unlock(), switch_core_media_ready(), switch_core_media_receive_message(), switch_core_media_reset_jb(), switch_core_media_set_codec(), switch_core_media_set_rtp_flag(), switch_core_media_set_telephony_event(), switch_core_media_set_telephony_recv_event(), switch_core_media_set_video_codec(), switch_core_media_start_udptl(), switch_core_media_udptl_mode(), switch_core_media_write_frame(), switch_core_session_check_incoming_crypto(), switch_core_session_passthru(), switch_rtp_activate_jitter_buffer(), switch_rtp_add_dtls(), switch_rtp_break(), switch_rtp_deactivate_jitter_buffer(), switch_rtp_debug_jitter_buffer(), switch_rtp_dequeue_dtmf(), switch_rtp_enable_vad(), switch_rtp_flush(), switch_rtp_get_jitter_buffer(), switch_rtp_has_dtmf(), switch_rtp_queue_rfc2833(), switch_rtp_queue_rfc2833_in(), switch_rtp_read(), switch_rtp_reset_jb(), switch_rtp_set_local_address(), switch_rtp_set_max_missed_packets(), switch_rtp_set_media_timeout(), switch_rtp_set_video_buffer_size(), switch_rtp_udptl_mode(), switch_rtp_write_frame(), switch_rtp_write_manual(), switch_rtp_write_raw(), switch_rtp_zerocopy_read(), and switch_rtp_zerocopy_read_frame().
void switch_rtp_release_port | ( | const char * | ip, |
switch_port_t | port | ||
) |
Definition at line 2610 of file switch_rtp.c.
References port_lock, switch_core_hash_find(), switch_core_port_allocator_free_port(), switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_media_choose_port(), switch_core_media_deactivate_rtp(), switch_rtp_destroy(), and switch_rtp_new().
switch_status_t switch_rtp_req_bitrate | ( | switch_rtp_t * | rtp_session, |
uint32_t | bps | ||
) |
Definition at line 5034 of file switch_rtp.c.
References rtp_write_ready(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_rtp::tmmbr.
Referenced by switch_core_media_receive_message().
switch_port_t switch_rtp_request_port | ( | const char * | ip | ) |
Request a new port to be used for media.
ip | the ip to request a port from |
Definition at line 2626 of file switch_rtp.c.
References END_PORT, port_lock, SPF_EVEN, START_PORT, switch_core_hash_find(), switch_core_hash_insert, switch_core_port_allocator_new(), switch_core_port_allocator_request_port(), switch_mutex_lock(), switch_mutex_unlock(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_choose_port().
void switch_rtp_reset | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 3000 of file switch_rtp.c.
References switch_rtp_ice_t::cand_responsive, switch_rtp::first_stun, switch_rtp::ice, switch_rtp::last_adj, switch_rtp::last_stun, memset(), switch_rtp_ice_t::ready, switch_rtp_ice_t::rready, switch_rtp::rtcp_last_sent, switch_rtp::rtcp_sent_packets, rtcp_stats_init(), SWITCH_RTP_FLAG_MUTE, SWITCH_RTP_FLAG_PAUSE, switch_rtp_reset_vb(), switch_rtp_set_flag(), and switch_rtp::ts_norm.
Referenced by clear_ice(), and switch_core_session_stop_media().
void switch_rtp_reset_jb | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 2979 of file switch_rtp.c.
References switch_rtp::jb, switch_jb_reset(), and switch_rtp_ready().
Referenced by switch_core_media_receive_message(), switch_core_media_reset_jb(), and switch_core_media_set_codec().
void switch_rtp_reset_media_timer | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 3028 of file switch_rtp.c.
References switch_rtp::last_media, switch_rtp::missed_count, and switch_micro_time_now().
Referenced by rtp_common_read(), switch_core_media_activate_rtp(), switch_core_media_toggle_hold(), and switch_rtp_set_media_timeout().
void switch_rtp_set_cng_pt | ( | switch_rtp_t * | rtp_session, |
switch_payload_t | pt | ||
) |
Set the payload type for comfort noise.
rtp_session | the RTP session to modify |
pt | the payload type |
Definition at line 4706 of file switch_rtp.c.
References switch_rtp::cng_pt, switch_rtp::flags, and SWITCH_RTP_FLAG_AUTO_CNG.
Referenced by switch_core_media_activate_rtp(), and switch_core_media_negotiate_sdp().
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.
rtp_session | the RTP session to set the payload number on |
payload | the new default payload number |
Definition at line 5335 of file switch_rtp.c.
References switch_rtp::payload.
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), switch_core_session_start_text_thread(), and switch_core_session_start_video_thread().
switch_port_t switch_rtp_set_end_port | ( | switch_port_t | port | ) |
Set/Get RTP end port.
port | new value (if > 0) |
Definition at line 2596 of file switch_rtp.c.
References END_PORT, port_lock, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_get_rtp_port_range_end_port(), and switch_load_core_config().
void switch_rtp_set_flag | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flag_t | flag | ||
) |
Set an RTP Flag.
rtp_session | the RTP session |
flags | the flags to set |
Definition at line 5372 of file switch_rtp.c.
References switch_rtp::autoadj_tally, switch_rtp::autoadj_threshold, switch_rtp::autoadj_window, switch_rtp::flag_mutex, switch_rtp::flags, switch_rtp_stats_t::inbound, switch_rtp::jb, switch_rtp_numbers_t::last_processed_seq, reset_jitter_seq(), switch_rtp::rtcp_autoadj_tally, switch_rtp::rtcp_autoadj_threshold, switch_rtp::rtcp_autoadj_window, rtp_flush_read_buffer(), switch_rtp::session, switch_rtp::sock_input, switch_rtp::stats, switch_channel_get_variable, switch_core_session_get_channel(), switch_jb_reset(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_AUTOADJ, SWITCH_RTP_FLAG_DTMF_ON, SWITCH_RTP_FLAG_FLUSH, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_PASSTHRU, SWITCH_RTP_FLAG_RTCP_AUTOADJ, SWITCH_RTP_FLUSH_ONCE, switch_rtp_pause_jitter_buffer(), SWITCH_SO_NONBLOCK, switch_socket_opt_set(), SWITCH_TRUE, and TRUE.
Referenced by do_flush(), handle_ice(), process_rtcp_report(), read_rtcp_packet(), read_rtp_packet(), rtp_common_read(), rtp_flush_read_buffer(), switch_core_media_activate_rtp(), switch_core_media_check_autoadj(), switch_core_media_negotiate_sdp(), switch_core_media_pause(), switch_core_media_proxy_remote_addr(), switch_core_media_receive_message(), switch_core_media_set_rtp_flag(), switch_core_media_start_udptl(), switch_core_media_toggle_hold(), switch_core_session_passthru(), switch_rtp_create(), switch_rtp_enable_vad(), switch_rtp_flush(), switch_rtp_new(), switch_rtp_reset(), switch_rtp_set_flags(), switch_rtp_set_local_address(), and switch_rtp_udptl_mode().
void switch_rtp_set_flags | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flag_t | flags[SWITCH_RTP_FLAG_INVALID] | ||
) |
Definition at line 5350 of file switch_rtp.c.
References SWITCH_RTP_FLAG_INVALID, and switch_rtp_set_flag().
Referenced by switch_core_media_receive_message(), and switch_rtp_create().
void switch_rtp_set_interdigit_delay | ( | switch_rtp_t * | rtp_session, |
uint32_t | delay | ||
) |
Definition at line 5320 of file switch_rtp.c.
References switch_rtp::interdigit_delay.
Referenced by switch_core_media_activate_rtp().
switch_status_t switch_rtp_set_interval | ( | switch_rtp_t * | rtp_session, |
uint32_t | ms_per_packet, | ||
uint32_t | samples_per_interval | ||
) |
Definition at line 4401 of file switch_rtp.c.
References switch_rtp::conf_samples_per_interval, switch_rtp::missed_count, switch_rtp::ms_per_packet, switch_rtp::one_second, switch_rtp::samples_per_interval, switch_rtp::samples_per_second, and SWITCH_STATUS_SUCCESS.
Referenced by switch_rtp_change_interval(), and switch_rtp_create().
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.
rtp_session | the RTP session |
on_invalid | the function to set |
Definition at line 5345 of file switch_rtp.c.
References switch_rtp::invalid_handler.
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.
rtp_session | an RTP session to assign the local address to |
host | the ip or fqhn of the local address |
port | the local port |
change_adv_addr | change the advertised address for doing compare |
err | pointer for error messages |
Definition at line 2780 of file switch_rtp.c.
References enable_local_rtcp_socket(), FALSE, switch_rtp::flags, switch_rtp::from_addr, switch_rtp::local_addr, switch_rtp::local_host_str, switch_rtp::local_port, switch_rtp::pool, READ_DEC, READ_INC, switch_rtp::read_pollfd, switch_rtp::ready, switch_rtp::session, switch_rtp::sock_input, switch_channel_get_variable, switch_cond_next(), switch_core_session_get_channel(), switch_core_sprintf(), switch_core_strdup, switch_mcast_hops(), switch_mcast_interface(), switch_mcast_join(), SWITCH_POLLERR, SWITCH_POLLIN, SWITCH_RTP_FLAG_ENABLE_RTCP, SWITCH_RTP_FLAG_IO, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_USE_TIMER, SWITCH_RTP_FLAG_VIDEO, switch_rtp_kill_socket(), switch_rtp_ready(), switch_rtp_set_flag(), SWITCH_SO_NONBLOCK, SWITCH_SO_RCVBUF, SWITCH_SO_REUSEADDR, SWITCH_SO_SNDBUF, switch_sockaddr_get_family(), switch_sockaddr_info_get(), switch_socket_bind(), switch_socket_close(), switch_socket_create(), switch_socket_create_pollset(), switch_socket_opt_set(), switch_socket_recvfrom(), switch_socket_sendto(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_UNSPEC, TRUE, WRITE_DEC, WRITE_INC, and zstr.
Referenced by switch_rtp_new().
void switch_rtp_set_max_missed_packets | ( | switch_rtp_t * | rtp_session, |
uint32_t | max | ||
) |
Definition at line 2963 of file switch_rtp.c.
References switch_rtp::flags, switch_rtp::max_missed_packets, switch_rtp::missed_count, switch_rtp::session, SWITCH_CHANNEL_SESSION_LOG, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_RTP_FLAG_UDPTL, and switch_rtp_ready().
Referenced by check_media_timeout_params(), switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_read_frame(), switch_core_media_receive_message(), and switch_core_media_toggle_hold().
void switch_rtp_set_media_timeout | ( | switch_rtp_t * | rtp_session, |
uint32_t | ms | ||
) |
Definition at line 2951 of file switch_rtp.c.
References switch_rtp::flags, switch_rtp::media_timeout, rtp_type, switch_rtp::session, SWITCH_CHANNEL_SESSION_LOG, switch_core_session_get_name, SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_RTP_FLAG_UDPTL, switch_rtp_ready(), and switch_rtp_reset_media_timer().
Referenced by check_media_timeout_params(), switch_core_media_negotiate_sdp(), switch_core_media_receive_message(), and switch_core_media_toggle_hold().
switch_status_t switch_rtp_set_payload_map | ( | switch_rtp_t * | rtp_session, |
payload_map_t ** | pmap | ||
) |
Definition at line 2649 of file switch_rtp.c.
References switch_rtp::flag_mutex, switch_rtp::pmaps, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_activate_rtp().
void switch_rtp_set_private | ( | switch_rtp_t * | rtp_session, |
void * | private_data | ||
) |
Associate an arbitrary data pointer with and RTP session.
rtp_session | the RTP session to assign the pointer to |
private_data | the private data to assign |
Definition at line 9228 of file switch_rtp.c.
References switch_rtp::private_data.
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.
rtp_session | an RTP session to assign the remote address to |
host | the ip or fqhn of the remote address |
port | the remote port |
err | pointer for error messages |
Definition at line 3125 of file switch_rtp.c.
References switch_rtp::dtls, switch_rtp::eff_remote_host_str, switch_rtp::eff_remote_port, switch_rtp::flags, switch_rtp::local_addr, switch_rtp::pool, switch_dtls_s::remote_addr, switch_rtp::remote_addr, switch_rtp::remote_host_str, switch_rtp::remote_port, switch_rtp::rtcp_remote_addr, switch_rtp::rtcp_sock_output, switch_rtp::sock_input, switch_dtls_s::sock_output, switch_rtp::sock_output, switch_core_strdup, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_ENABLE_RTCP, SWITCH_RTP_FLAG_RTCP_MUX, switch_sockaddr_get_family(), switch_sockaddr_info_get(), switch_socket_close(), switch_socket_create(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_UNSPEC, and switch_rtp::write_mutex.
Referenced by handle_ice(), rtp_common_read(), switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_process_t38_passthru(), switch_core_media_proxy_remote_addr(), switch_core_media_start_udptl(), switch_rtp_change_ice_dest(), and switch_rtp_new().
switch_status_t switch_rtp_set_remote_ssrc | ( | switch_rtp_t * | rtp_session, |
uint32_t | ssrc | ||
) |
Definition at line 4466 of file switch_rtp.c.
References switch_rtp::flags, switch_rtp::remote_ssrc, switch_rtcp_report_block_frame::ssrc, SWITCH_RTP_FLAG_DETECT_SSRC, and SWITCH_STATUS_SUCCESS.
Referenced by check_ice(), and switch_core_media_activate_rtp().
switch_status_t switch_rtp_set_ssrc | ( | switch_rtp_t * | rtp_session, |
uint32_t | ssrc | ||
) |
Definition at line 4458 of file switch_rtp.c.
References rtp_msg_t::header, switch_rtp::send_msg, switch_rtcp_report_block_frame::ssrc, switch_rtp::ssrc, and SWITCH_STATUS_SUCCESS.
Referenced by rtp_common_write(), and switch_core_media_activate_rtp().
switch_port_t switch_rtp_set_start_port | ( | switch_port_t | port | ) |
Set/Get RTP start port.
port | new value (if > 0) |
Definition at line 2582 of file switch_rtp.c.
References port_lock, START_PORT, switch_mutex_lock(), and switch_mutex_unlock().
Referenced by switch_core_get_rtp_port_range_start_port(), and switch_load_core_config().
void switch_rtp_set_telephony_event | ( | switch_rtp_t * | rtp_session, |
switch_payload_t | te | ||
) |
Set the payload type to consider RFC2833 DTMF.
rtp_session | the RTP session to modify |
te | the payload type |
Definition at line 4690 of file switch_rtp.c.
References switch_rtp::te.
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_recover_session(), and switch_core_media_set_telephony_event().
void switch_rtp_set_telephony_recv_event | ( | switch_rtp_t * | rtp_session, |
switch_payload_t | te | ||
) |
Definition at line 4698 of file switch_rtp.c.
References switch_rtp::recv_te.
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_recover_session(), and switch_core_media_set_telephony_recv_event().
switch_status_t switch_rtp_set_video_buffer_size | ( | switch_rtp_t * | rtp_session, |
uint32_t | frames, | ||
uint32_t | max_frames | ||
) |
Definition at line 4783 of file switch_rtp.c.
References switch_rtp::flags, switch_rtp::last_max_vb_frames, switch_rtp::pool, switch_rtp::session, SJB_TEXT, SJB_VIDEO, SWITCH_CHANNEL_SESSION_LOG, switch_core_session_request_video_refresh, switch_jb_create(), switch_jb_set_frames(), switch_jb_set_session(), SWITCH_LOG_DEBUG1, switch_log_printf(), SWITCH_RTP_FLAG_TEXT, switch_rtp_ready(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_rtp::vb.
Referenced by check_jb(), and switch_core_media_activate_rtp().
void switch_rtp_shutdown | ( | void | ) |
Definition at line 2552 of file switch_rtp.c.
References port_lock, SWITCH_CHANNEL_LOG, switch_core_hash_destroy(), switch_core_hash_first, switch_core_hash_next(), switch_core_hash_this(), switch_core_port_allocator_destroy(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), and switch_rtp_dtls_destroy().
Referenced by switch_core_destroy().
switch_status_t switch_rtp_sync_stats | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 5163 of file switch_rtp.c.
References do_mos(), switch_rtp_numbers_t::error_log, switch_rtp::flags, switch_rtp_stats_t::inbound, switch_rtp_vad_data::session, switch_rtp::stats, error_period::stop, switch_channel_set_variable_printf(), switch_core_session_get_channel(), switch_micro_time_now(), SWITCH_RTP_FLAG_VAD, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_rtp_vad_data::total_talk_time, and switch_rtp::vad_data.
Referenced by switch_core_media_sync_stats().
uint32_t switch_rtp_test_flag | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flag_t | flags | ||
) |
Test an RTP Flag.
rtp_session | the RTP session |
flags | the flags to test |
Definition at line 5426 of file switch_rtp.c.
References switch_rtp::flags.
Referenced by check_rtcp_and_ice(), get_next_write_ts(), process_rtcp_report(), rtp_common_read(), rtp_common_write(), switch_core_media_check_udptl_mode(), switch_core_media_receive_message(), and switch_rtp_udptl_mode().
switch_status_t switch_rtp_udptl_mode | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 3055 of file switch_rtp.c.
References FALSE, switch_rtp::flags, switch_rtp::max_missed_packets, memset(), switch_rtp::missed_count, ping_socket(), READ_DEC, READ_INC, switch_rtp::rtcp_sock_input, switch_rtp::rtcp_sock_output, switch_rtp::sock_input, switch_core_timer_destroy(), switch_rtp_break(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_ENABLE_RTCP, SWITCH_RTP_FLAG_FLUSH, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_PROXY_MEDIA, SWITCH_RTP_FLAG_RTCP_MUX, SWITCH_RTP_FLAG_STICKY_FLUSH, SWITCH_RTP_FLAG_UDPTL, SWITCH_RTP_FLAG_USE_TIMER, switch_rtp_ready(), switch_rtp_set_flag(), switch_rtp_test_flag(), SWITCH_SHUTDOWN_READWRITE, SWITCH_SO_NONBLOCK, switch_socket_close(), switch_socket_opt_set(), switch_socket_shutdown(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_rtp::timer, switch_timer::timer_interface, WRITE_DEC, and WRITE_INC.
Referenced by switch_core_media_start_udptl(), and switch_core_media_udptl_mode().
void switch_rtp_video_loss | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 5068 of file switch_rtp.c.
References switch_rtp::flags, switch_rtp::ice, switch_rtp_ice_t::ice_user, switch_rtp::pli_count, rtp_write_ready(), SWITCH_RTP_FLAG_PLI, and SWITCH_RTP_FLAG_VIDEO.
Referenced by switch_core_media_receive_message().
void switch_rtp_video_refresh | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 5056 of file switch_rtp.c.
References switch_rtp::fir_count, switch_rtp::flags, switch_rtp::ice, switch_rtp_ice_t::ice_user, rtp_write_ready(), SWITCH_RTP_FLAG_FIR, SWITCH_RTP_FLAG_OLD_FIR, and SWITCH_RTP_FLAG_VIDEO.
Referenced by read_rtp_packet(), switch_core_media_receive_message(), and switch_rtp_break().
int switch_rtp_write_frame | ( | switch_rtp_t * | rtp_session, |
switch_frame_t * | frame | ||
) |
Write data to a given RTP session.
rtp_session | the RTP session to write to |
frame | the frame to write |
Definition at line 8887 of file switch_rtp.c.
References CF_AUDIO_VIDEO_BUNDLE, switch_rtp::cng_pt, payload_map_s::current, switch_frame::data, switch_frame::datalen, switch_rtp::flag_mutex, switch_frame::flags, switch_rtp::flags, payload_map_s::hash, rtp_msg_t::header, INVALID_PT, switch_rtp::local_addr, switch_frame::m, switch_rtp_numbers_t::media_bytes, switch_rtp_numbers_t::media_packet_count, payload_map_s::negotiated, payload_map_s::next, switch_rtp_stats_t::outbound, switch_frame::packet, switch_rtp_numbers_t::packet_count, switch_frame::packetlen, switch_frame::payload, switch_rtp::payload, switch_frame::pmap, switch_rtp::pmaps, payload_map_s::pt, switch_rtp::queue_delay, switch_rtp_numbers_t::raw_bytes, payload_map_s::recv_pt, switch_rtp::remote_addr, switch_rtp::remote_port, RTP_BUG_GEN_ONE_GEN_ALL, switch_rtp::rtp_bugs, rtp_common_write(), switch_rtp::rtp_from_addr, rtp_write_ready(), switch_rtp::sending_dtmf, switch_rtp::seq, switch_rtp::session, SFF_CNG, SFF_PROXY_PACKET, SFF_RAW_RTP, SFF_RAW_RTP_PARSE_FRAME, SFF_RTP_HEADER, SFF_UDPTL_PACKET, switch_rtp::sock_output, switch_frame::ssrc, switch_rtp::ssrc, switch_rtp::stats, switch_assert, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, SWITCH_CHANNEL_SESSION_LOG_CLEAN, switch_channel_test_flag(), switch_core_session_get_channel(), switch_get_addr(), SWITCH_LOG_CONSOLE, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_DEBUG_RTP_WRITE, SWITCH_RTP_FLAG_PROXY_MEDIA, SWITCH_RTP_FLAG_RAW_WRITE, SWITCH_RTP_FLAG_RESET, SWITCH_RTP_FLAG_TEXT, SWITCH_RTP_FLAG_UDPTL, SWITCH_RTP_FLAG_VIDEO, switch_rtp_ready(), switch_rtp_write_manual(), SWITCH_SIZE_T_FMT, switch_sockaddr_get_port(), switch_socket_sendto(), SWITCH_STATUS_SUCCESS, switch_test_flag, and switch_frame::timestamp.
Referenced by switch_core_media_write_frame().
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.
rtp_session | the RTP session to write to |
data | data to write |
datalen | the size of the data |
m | set mark bit or not |
payload | the IANA payload number |
ts | then number of bytes to increment the timestamp by |
flags | frame flags |
Definition at line 9107 of file switch_rtp.c.
References rtp_msg_t::body, switch_rtp::flags, rtp_msg_t::header, INVALID_PT, switch_rtp::last_write_ts, switch_rtp::remote_addr, rtp_header_len, rtp_write_ready(), switch_rtp::send_msg, switch_rtp::seq, SFF_RTP_HEADER, SWITCH_RTP_FLAG_RESET, SWITCH_RTP_MAX_BUF_LEN, switch_rtp_ready(), switch_rtp_write_raw(), SWITCH_STATUS_SUCCESS, SWITCH_TRUE, WRITE_DEC, WRITE_INC, and switch_rtp::write_msg.
Referenced by check_rtcp_and_ice(), do_2833(), and switch_rtp_write_frame().
switch_status_t switch_rtp_write_raw | ( | switch_rtp_t * | rtp_session, |
void * | data, | ||
switch_size_t * | bytes, | ||
switch_bool_t | process_encryption | ||
) |
Definition at line 9158 of file switch_rtp.c.
References switch_rtp::flags, rtp_msg_t::header, switch_rtp::ice_mutex, switch_rtp::remote_addr, rtp_write_ready(), switch_rtp::send_ctx, switch_rtp::send_policy, switch_rtp::session, switch_rtp::sock_output, switch_rtp::srtp_idx_rtp, switch_assert, SWITCH_CHANNEL_SESSION_LOG, SWITCH_CRYPTO_MKI_INDEX, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_SECURE_SEND, SWITCH_RTP_FLAG_SECURE_SEND_MKI, SWITCH_RTP_FLAG_SECURE_SEND_RESET, SWITCH_RTP_MAX_BUF_LEN, switch_rtp_ready(), switch_socket_sendto(), SWITCH_STATUS_FALSE, SWITCH_STATUS_NOT_INITALIZED, WRITE_DEC, WRITE_INC, and switch_rtp::write_msg.
Referenced by handle_nack(), and switch_rtp_write_manual().
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.
rtp_session | the RTP session to read from |
data | a pointer to point directly to the RTP read buffer |
datalen | a pointer to the datalen |
payload_type | the IANA payload of the packet |
flags | flags |
io_flags | i/o flags |
Definition at line 8244 of file switch_rtp.c.
References RTP_BODY, rtp_common_read(), rtp_header_len, switch_rtp_ready(), SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
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.
rtp_session | the RTP session to read from |
frame | a frame to populate with information |
io_flags | i/o flags |
Definition at line 8192 of file switch_rtp.c.
References switch_frame::data, switch_frame::datalen, switch_frame::flags, switch_rtp::flags, switch_rtp::last_rtp_hdr, switch_frame::m, switch_frame::packet, switch_frame::packetlen, switch_frame::payload, switch_frame::pmap, switch_rtp::recv_msg, switch_rtp::recv_te, RTP_BODY, rtp_common_read(), rtp_header_len, switch_frame::seq, SFF_CNG, SFF_EXTERNAL, SFF_RAW_RTP, SFF_RFC2833, switch_frame::source, switch_frame::ssrc, SWITCH_FALSE, SWITCH_RTP_FLAG_UDPTL, switch_rtp_ready(), switch_set_flag, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, switch_test_flag, SWITCH_TRUE, and switch_frame::timestamp.
Referenced by check_engine(), and switch_core_media_read_frame().