FreeSWITCH API Documentation
1.7.0
|
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[], 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) |
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 177 of file switch_rtp.h.
void rtp_flush_read_buffer | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flush_t | flush | ||
) |
Definition at line 4940 of file switch_rtp.c.
References 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(), switch_rtp_set_flag(), and switch_rtp_set_flags().
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 7016 of file switch_rtp.c.
References 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 4351 of file switch_rtp.c.
References rtp_write_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
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 4241 of file switch_rtp.c.
References switch_rtp_ice_t::addr, ice_s::cands, ice_s::chosen, icand_s::con_addr, icand_s::con_port, switch_rtp_ice_t::ice_params, switch_rtp_ice_t::ice_user, ICE_VANILLA, IPR_RTP, switch_rtp_ice_t::luser_ice, switch_rtp_ice_t::next_run, switch_rtp_ice_t::pass, switch_rtp_ice_t::proto, switch_rtp_ice_t::ready, switch_rtp_ice_t::rpass, switch_rtp_ice_t::rready, RTP_BUG_ACCEPT_ANY_PACKETS, rtp_type, 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 4146 of file switch_rtp.c.
References READ_DEC, READ_INC, SJB_AUDIO, switch_channel_get_variable_dup(), switch_core_session_get_channel(), SWITCH_FALSE, switch_jb_create(), switch_jb_set_frames(), 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 4186 of file switch_rtp.c.
References enable_local_rtcp_socket(), enable_remote_rtcp_socket(), 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 | ||
) |
Definition at line 3294 of file switch_rtp.c.
References switch_dtls_s::ca, switch_directories::certs_dir, DS_HANDSHAKE, dtls_set_state, DTLS_SRTP_FNAME, DTLS_TYPE_CLIENT, DTLS_TYPE_RTCP, DTLS_TYPE_RTP, DTLS_TYPE_SERVER, switch_dtls_s::local_fp, switch_dtls_s::pem, switch_dtls_s::pvt, switch_dtls_s::read_bio, switch_dtls_s::remote_addr, switch_dtls_s::remote_fp, switch_dtls_s::rsa, switch_dtls_s::rtp_session, rtp_type, switch_dtls_s::sock_output, switch_dtls_s::ssl, switch_dtls_s::ssl_ctx, switch_assert, SWITCH_CHANNEL_SESSION_LOG, switch_core_alloc, switch_core_cert_expand_fingerprint(), switch_core_sprintf(), switch_file_exists(), SWITCH_GLOBAL_dirs, SWITCH_LOG_CRIT, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), SWITCH_LOG_WARNING, 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 4385 of file switch_rtp.c.
References CF_VIDEO_BREAK, ping_socket(), 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 3687 of file switch_rtp.c.
References memset(), READ_DEC, READ_INC, 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, WRITE_DEC, and WRITE_INC.
Referenced by switch_core_media_set_codec().
switch_byte_t switch_rtp_check_auto_adj | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 6893 of file switch_rtp.c.
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 4747 of file switch_rtp.c.
References FALSE, reset_jitter_seq(), switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_DTMF_ON, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLAG_PAUSE, SWITCH_SO_NONBLOCK, and switch_socket_opt_set().
Referenced by do_flush(), handle_ice(), read_rtp_packet(), rtp_common_read(), rtp_common_write(), rtp_flush_read_buffer(), switch_core_media_clear_rtp_flag(), switch_core_media_receive_message(), switch_core_media_resume(), switch_core_media_toggle_hold(), switch_rtp_create(), switch_rtp_disable_vad(), switch_rtp_udptl_mode(), switch_rtp_write_frame(), switch_rtp_write_raw(), and switch_rtp_zerocopy_read_frame().
void switch_rtp_clear_flags | ( | switch_rtp_t * | rtp_session, |
switch_rtp_flag_t | flags[SWITCH_RTP_FLAG_INVALID] | ||
) |
Definition at line 4691 of file switch_rtp.c.
References 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[], | ||
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 |
switch_status_t switch_rtp_deactivate_jitter_buffer | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4079 of file switch_rtp.c.
References 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 4126 of file switch_rtp.c.
References switch_jb_debug_level(), switch_rtp_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by check_jb().
switch_status_t switch_rtp_del_dtls | ( | switch_rtp_t * | rtp_session, |
dtls_type_t | type | ||
) |
Definition at line 3232 of file switch_rtp.c.
References DTLS_TYPE_RTCP, DTLS_TYPE_RTP, free_dtls(), switch_jb_reset(), SWITCH_RTP_FLAG_SECURE_RECV, SWITCH_RTP_FLAG_SECURE_SEND, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
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 6911 of file switch_rtp.c.
References SWITCH_CHANNEL_SESSION_LOG, SWITCH_LOG_DEBUG, switch_log_printf(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_trypop(), switch_rtp_ready(), 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 4491 of file switch_rtp.c.
References free_dtls(), READ_DEC, READ_INC, switch_core_timer_destroy(), switch_jb_destroy(), switch_mutex_lock(), switch_mutex_unlock(), switch_queue_trypop(), switch_rtp_disable_vad(), SWITCH_RTP_FLAG_PROXY_MEDIA, 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, SWITCH_ZRTP_FLAG_SECURE_RECV, SWITCH_ZRTP_FLAG_SECURE_SEND, 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 7654 of file switch_rtp.c.
References switch_core_codec_destroy(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_VAD, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, and SWITCH_STATUS_SUCCESS.
Referenced by switch_rtp_destroy().
dtls_state_t switch_rtp_dtls_state | ( | switch_rtp_t * | rtp_session, |
dtls_type_t | type | ||
) |
Definition at line 3215 of file switch_rtp.c.
References DS_OFF, DTLS_TYPE_RTCP, and DTLS_TYPE_RTP.
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 7669 of file switch_rtp.c.
References memset(), 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_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_time_now(), switch_true(), SWITCH_VAD_FLAG_CNG, SWITCH_VAD_FLAG_TALKING, 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 4331 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().
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 4650 of file switch_rtp.c.
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 4640 of file switch_rtp.c.
switch_jb_t* switch_rtp_get_jitter_buffer | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4050 of file switch_rtp.c.
References switch_rtp_ready().
Referenced by switch_core_media_get_jb().
switch_timer_t* switch_rtp_get_media_timer | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4036 of file switch_rtp.c.
References switch_core_timer_sync(), and SWITCH_RTP_FLAG_VIDEO.
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 8099 of file switch_rtp.c.
void switch_rtp_get_random | ( | void * | buf, |
uint32_t | len | ||
) |
Definition at line 2338 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 2822 of file switch_rtp.c.
References 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 2827 of file switch_rtp.c.
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 4635 of file switch_rtp.c.
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 8089 of file switch_rtp.c.
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 7928 of file switch_rtp.c.
References do_mos(), switch_rtp_stats_t::inbound, switch_rtp_numbers_t::largest_jb_size, switch_core_alloc, SWITCH_FALSE, 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 4091 of file switch_rtp.c.
References switch_jb_get_frames(), and SWITCH_STATUS_FALSE.
Referenced by check_jb_sync().
int switch_rtp_has_dtls | ( | void | ) |
Definition at line 3207 of file switch_rtp.c.
Referenced by check_dtls_reinvite(), check_ice(), switch_core_media_activate_rtp(), switch_core_media_gen_local_sdp(), and switch_core_media_negotiate_sdp().
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 6898 of file switch_rtp.c.
References 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 1442 of file switch_rtp.c.
References switch_directories::db_dir, port_lock, SSHF_NO_DEL, SSHF_NONE, SWITCH_CHANNEL_LOG, switch_core_get_variable_pdup(), switch_core_hash_init, switch_core_set_variable(), switch_epoch_time_now(), SWITCH_GLOBAL_dirs, SWITCH_LOG_CRIT, switch_log_printf(), switch_mutex_init(), SWITCH_MUTEX_NESTED, SWITCH_PATH_SEPARATOR, switch_scheduler_add_task(), switch_snprintf(), and switch_true().
Referenced by switch_core_init().
void switch_rtp_intentional_bugs | ( | switch_rtp_t * | rtp_session, |
switch_rtp_bug_flag_t | bugs | ||
) |
Definition at line 2467 of file switch_rtp.c.
References RTP_BUG_START_SEQ_AT_ZERO.
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 4425 of file switch_rtp.c.
References ping_socket(), 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[], | ||
char * | timer_name, | ||
const char ** | err, | ||
switch_memory_pool_t * | pool | ||
) |
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 |
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 4059 of file switch_rtp.c.
References switch_jb_reset(), switch_rtp_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by check_jb(), and switch_core_media_receive_message().
void switch_rtp_ping | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 2333 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 6935 of file switch_rtp.c.
References 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 6961 of file switch_rtp.c.
References 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 6986 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 4452 of file switch_rtp.c.
References switch_mutex_lock(), switch_mutex_unlock(), SWITCH_RTP_FLAG_IO, and SWITCH_RTP_FLAG_SHUTDOWN.
Referenced by check_ice(), 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_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_pause_jitter_buffer(), 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_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 2415 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 4340 of file switch_rtp.c.
References rtp_write_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
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 2431 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 2789 of file switch_rtp.c.
References memset(), rtcp_stats_init(), SWITCH_RTP_FLAG_MUTE, SWITCH_RTP_FLAG_PAUSE, switch_rtp_reset_vb(), and switch_rtp_set_flag().
Referenced by clear_ice(), and switch_core_session_stop_media().
void switch_rtp_reset_jb | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 2769 of file switch_rtp.c.
References 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 2817 of file switch_rtp.c.
Referenced by rtp_common_read(), switch_core_media_activate_rtp(), and switch_core_media_toggle_hold().
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 4030 of file switch_rtp.c.
References 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 4645 of file switch_rtp.c.
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_set_codec(), switch_core_media_set_video_codec(), 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 2401 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 4702 of file switch_rtp.c.
References reset_jitter_seq(), rtp_flush_read_buffer(), 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_FLUSH_ONCE, SWITCH_SO_NONBLOCK, switch_socket_opt_set(), and TRUE.
Referenced by do_flush(), handle_ice(), read_rtp_packet(), rtp_common_read(), rtp_flush_read_buffer(), switch_core_media_activate_rtp(), switch_core_media_check_autoadj(), 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_rtp_create(), switch_rtp_enable_vad(), switch_rtp_flush(), switch_rtp_new(), switch_rtp_reset(), 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 4660 of file switch_rtp.c.
References rtp_flush_read_buffer(), switch_channel_get_variable, switch_core_session_get_channel(), SWITCH_RTP_FLAG_AUTOADJ, SWITCH_RTP_FLAG_INVALID, SWITCH_RTP_FLAG_NOBLOCK, SWITCH_RTP_FLUSH_ONCE, SWITCH_SO_NONBLOCK, switch_socket_opt_set(), and TRUE.
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 | ||
) |
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 3674 of file switch_rtp.c.
References 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 4655 of file switch_rtp.c.
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 2585 of file switch_rtp.c.
References enable_local_rtcp_socket(), FALSE, READ_DEC, READ_INC, 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 2753 of file switch_rtp.c.
References SWITCH_CHANNEL_SESSION_LOG, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_RTP_FLAG_UDPTL, and switch_rtp_ready().
Referenced by switch_core_media_activate_rtp(), switch_core_media_negotiate_sdp(), switch_core_media_read_frame(), 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 2454 of file switch_rtp.c.
References 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 8094 of file switch_rtp.c.
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 2913 of file switch_rtp.c.
References enable_remote_rtcp_socket(), switch_core_strdup, switch_cp_addr(), 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, and SWITCH_UNSPEC.
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 3733 of file switch_rtp.c.
References 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 3725 of file switch_rtp.c.
References 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 2387 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 4014 of file switch_rtp.c.
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 4022 of file switch_rtp.c.
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 4101 of file switch_rtp.c.
References 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_ready(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by check_jb(), and check_jb_sync().
void switch_rtp_shutdown | ( | void | ) |
Definition at line 2348 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(), and switch_mutex_unlock().
Referenced by switch_core_destroy().
switch_status_t switch_rtp_sync_stats | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4468 of file switch_rtp.c.
References do_mos(), switch_channel_set_variable_printf(), switch_core_session_get_channel(), switch_micro_time_now(), SWITCH_RTP_FLAG_VAD, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and SWITCH_TRUE.
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 4742 of file switch_rtp.c.
Referenced by check_rtcp_and_ice(), get_next_write_ts(), 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 2843 of file switch_rtp.c.
References FALSE, memset(), ping_socket(), READ_DEC, READ_INC, 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, WRITE_DEC, and WRITE_INC.
Referenced by switch_core_media_activate_rtp(), switch_core_media_start_udptl(), and switch_core_media_udptl_mode().
void switch_rtp_video_loss | ( | switch_rtp_t * | rtp_session | ) |
Definition at line 4374 of file switch_rtp.c.
References 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 4362 of file switch_rtp.c.
References rtp_write_ready(), SWITCH_RTP_FLAG_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 7726 of file switch_rtp.c.
References payload_map_s::current, payload_map_s::hash, rtp_msg_t::header, INVALID_PT, payload_map_s::negotiated, payload_map_s::next, payload_map_s::pt, payload_map_s::recv_pt, RTP_BUG_GEN_ONE_GEN_ALL, rtp_common_write(), rtp_write_ready(), SFF_CNG, SFF_PROXY_PACKET, SFF_RAW_RTP, SFF_RAW_RTP_PARSE_FRAME, SFF_RTP_HEADER, SFF_UDPTL_PACKET, switch_assert, switch_channel_get_partner_uuid(), switch_channel_get_private(), SWITCH_CHANNEL_SESSION_LOG, switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_rwunlock(), switch_log_printf(), SWITCH_LOG_WARNING, switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_PROXY_MEDIA, SWITCH_RTP_FLAG_RAW_WRITE, SWITCH_RTP_FLAG_RESET, SWITCH_RTP_FLAG_UDPTL, SWITCH_RTP_FLAG_VIDEO, switch_rtp_ready(), switch_rtp_write_manual(), switch_socket_sendto(), SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV, and SWITCH_ZRTP_FLAG_SECURE_MITM_SEND.
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 7955 of file switch_rtp.c.
References INVALID_PT, rtp_header_len, rtp_write_ready(), 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, and WRITE_INC.
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 8006 of file switch_rtp.c.
References rtp_write_ready(), switch_assert, SWITCH_CHANNEL_LOG, SWITCH_CHANNEL_SESSION_LOG, SWITCH_FALSE, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), switch_rtp_clear_flag(), SWITCH_RTP_FLAG_PROXY_MEDIA, SWITCH_RTP_FLAG_SECURE_SEND, SWITCH_RTP_FLAG_SECURE_SEND_RESET, SWITCH_RTP_MAX_BUF_LEN, switch_rtp_ready(), switch_socket_sendto(), SWITCH_STATUS_FALSE, SWITCH_STATUS_NOT_INITALIZED, SWITCH_STATUS_SUCCESS, WRITE_DEC, and WRITE_INC.
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 7135 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 7036 of file switch_rtp.c.
References switch_rtp::read_mutex, RTP_BODY, rtp_common_read(), rtp_header_len, SFF_CNG, SFF_RAW_RTP, SFF_RFC2833, SWITCH_CALL_DIRECTION_INBOUND, switch_channel_direction(), switch_channel_get_partner_uuid(), switch_channel_get_private(), switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_rwunlock(), SWITCH_FALSE, switch_mutex_lock(), switch_mutex_unlock(), switch_rtp_clear_flag(), 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, SWITCH_ZRTP_FLAG_SECURE_MITM_RECV, and SWITCH_ZRTP_FLAG_SECURE_MITM_SEND.
Referenced by check_engine(), and switch_core_media_read_frame().