RTS API Documentation  1.10.11
Data Structures | Macros | Typedefs | Enumerations | Functions
switch_rtp.h File Reference

RTP. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  switch_rtp_packet_t
 
struct  switch_srtp_crypto_suite_s
 
struct  switch_rtp_crypto_key
 
struct  icand_s
 
struct  ice_s
 

Macros

#define SWITCH_RTP_HEADER_LEN   sizeof(switch_rtp_hdr_t)
 
#define SWITCH_RTP_MAX_BUF_LEN   16384
 
#define SWITCH_RTCP_MAX_BUF_LEN   16384
 
#define SWITCH_RTP_MAX_BUF_LEN_WORDS   4094 /* (max / 4) - 2 */
 
#define SWITCH_RTP_MAX_PACKET_LEN   (SWITCH_RTP_MAX_BUF_LEN + SWITCH_RTP_HEADER_LEN)
 
#define SWITCH_RTP_CRYPTO_KEY_80   "AES_CM_128_HMAC_SHA1_80"
 
#define SWITCH_RTP_BUNDLE_INTERNAL_PT   21
 
#define MAX_CAND   50
 
#define MAX_CAND_IDX_COUNT   2
 

Typedefs

typedef struct switch_srtp_crypto_suite_s switch_srtp_crypto_suite_t
 
typedef struct switch_rtp_crypto_key switch_rtp_crypto_key_t
 
typedef struct icand_s icand_t
 
typedef struct ice_s ice_t
 
typedef void(* switch_rtp_invalid_handler_t) (switch_rtp_t *rtp_session, switch_socket_t *sock, void *data, switch_size_t datalen, switch_sockaddr_t *from_addr)
 

Enumerations

enum  switch_rtp_crypto_direction_t {
  SWITCH_RTP_CRYPTO_SEND, SWITCH_RTP_CRYPTO_RECV, SWITCH_RTP_CRYPTO_SEND_RTCP, SWITCH_RTP_CRYPTO_RECV_RTCP,
  SWITCH_RTP_CRYPTO_MAX
}
 
enum  ice_proto_t { IPR_RTP, IPR_RTCP }
 
enum  rtcp_pt_t {
  _RTCP_PT_FIR = 192, _RTCP_PT_IJ = 195, _RTCP_PT_SR = 200, _RTCP_PT_RR = 201,
  _RTCP_PT_SDES = 202, _RTCP_PT_BYE = 203, _RTCP_PT_APP = 204, _RTCP_PT_RTPFB = 205,
  _RTCP_PT_PSFB = 206, _RTCP_PT_XR = 207, _RTCP_PT_AVB = 208, _RTCP_PT_RSI = 209,
  _RTCP_PT_TOKEN = 210, _RTCP_PT_IDMS = 211, _RTCP_PT_LAST = 255
}
 
enum  rtcp_sdes_t {
  _RTCP_SDES_END = 0, _RTCP_SDES_CNAME = 1, _RTCP_SDES_NAME = 2, _RTCP_SDES_EMAIL = 3,
  _RTCP_SDES_PHONE = 4, _RTCP_SDES_LOC = 5, _RTCP_SDES_TOOL = 6, _RTCP_SDES_NOTE = 7,
  _RTCP_SDES_PRIV = 8, _RTCP_SDES_H323 = 9, _RTCP_SDES_APSI = 10
}
 
enum  rtcp_rtpfb_t {
  _RTCP_RTPFB_NACK = 1, _RTCP_RTPFB_TMMBR = 3, _RTCP_RTPFB_TMMBN = 4, _RTCP_RTPFB_SR_REQ = 5,
  _RTCP_RTPFB_RAMS = 6, _RTCP_RTPFB_TLLEI = 7, _RTCP_RTPFB_ECN_FB = 8
}
 
enum  rtcp_psfb_t {
  _RTCP_PSFB_PLI = 1, _RTCP_PSFB_SLI = 2, _RTCP_PSFB_RPSI = 3, _RTCP_PSFB_FIR = 4,
  _RTCP_PSFB_TSTR = 5, _RTCP_PSFB_TSTN = 6, _RTCP_PSFB_VBCM = 7, _RTCP_PSFB_PSLEI = 8,
  _RTCP_PSFB_AFB = 15
}
 

Functions

switch_status_t switch_rtp_add_crypto_key (switch_rtp_t *rtp_session, switch_rtp_crypto_direction_t direction, uint32_t index, switch_secure_settings_t *ssec)
 
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_tswitch_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_tswitch_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_tswitch_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_tswitch_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_tswitch_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_tswitch_rtp_get_core_session (switch_rtp_t *rtp_session)
 

Detailed Description

RTP.

Definition in file switch_rtp.h.

Macro Definition Documentation

◆ MAX_CAND

#define MAX_CAND   50

Definition at line 110 of file switch_rtp.h.

Referenced by check_ice().

◆ MAX_CAND_IDX_COUNT

#define MAX_CAND_IDX_COUNT   2

Definition at line 111 of file switch_rtp.h.

Referenced by check_ice().

◆ SWITCH_RTCP_MAX_BUF_LEN

#define SWITCH_RTCP_MAX_BUF_LEN   16384

Definition at line 46 of file switch_rtp.h.

◆ SWITCH_RTP_BUNDLE_INTERNAL_PT

#define SWITCH_RTP_BUNDLE_INTERNAL_PT   21

Definition at line 53 of file switch_rtp.h.

◆ SWITCH_RTP_CRYPTO_KEY_80

#define SWITCH_RTP_CRYPTO_KEY_80   "AES_CM_128_HMAC_SHA1_80"

Definition at line 51 of file switch_rtp.h.

◆ SWITCH_RTP_HEADER_LEN

#define SWITCH_RTP_HEADER_LEN   sizeof(switch_rtp_hdr_t)

Definition at line 44 of file switch_rtp.h.

Referenced by switch_jb_peek_frame().

◆ SWITCH_RTP_MAX_BUF_LEN

#define SWITCH_RTP_MAX_BUF_LEN   16384

◆ SWITCH_RTP_MAX_BUF_LEN_WORDS

#define SWITCH_RTP_MAX_BUF_LEN_WORDS   4094 /* (max / 4) - 2 */

Definition at line 47 of file switch_rtp.h.

Referenced by read_rtp_packet().

◆ SWITCH_RTP_MAX_PACKET_LEN

#define SWITCH_RTP_MAX_PACKET_LEN   (SWITCH_RTP_MAX_BUF_LEN + SWITCH_RTP_HEADER_LEN)

Definition at line 48 of file switch_rtp.h.

Referenced by switch_jb_put_packet().

Typedef Documentation

◆ icand_t

typedef struct icand_s icand_t

◆ ice_t

typedef struct ice_s ice_t

◆ switch_rtp_crypto_key_t

Definition at line 85 of file switch_rtp.h.

◆ switch_srtp_crypto_suite_t

Enumeration Type Documentation

◆ ice_proto_t

Enumerator
IPR_RTP 
IPR_RTCP 

Definition at line 87 of file switch_rtp.h.

87  {
88  IPR_RTP,
89  IPR_RTCP
90 } ice_proto_t;
ice_proto_t
Definition: switch_rtp.h:87

◆ rtcp_psfb_t

Enumerator
_RTCP_PSFB_PLI 
_RTCP_PSFB_SLI 
_RTCP_PSFB_RPSI 
_RTCP_PSFB_FIR 
_RTCP_PSFB_TSTR 
_RTCP_PSFB_TSTN 
_RTCP_PSFB_VBCM 
_RTCP_PSFB_PSLEI 
_RTCP_PSFB_AFB 

Definition at line 166 of file switch_rtp.h.

166  { /* FMT Values for PSFB Payload Types http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-9 */
167  _RTCP_PSFB_PLI = 1, /* PLI: Picture Loss Indication RFC4585 */
168  _RTCP_PSFB_SLI = 2, /* SLI: Slice Loss Indication RFC4585 */
169  _RTCP_PSFB_RPSI = 3, /* RPSI: Reference Picture Selection Indication RFC4585 */
170  _RTCP_PSFB_FIR = 4, /* FIR: Full Intra Request Command RFC5104 */
171  _RTCP_PSFB_TSTR = 5, /* TSTR: Temporal-Spatial Trade-off Request RFC5104 */
172  _RTCP_PSFB_TSTN = 6, /* TSTN: Temporal-Spatial Trade-off Notification RFC5104 */
173  _RTCP_PSFB_VBCM = 7, /* VBCM: Video Back Channel Message RFC5104 */
174  _RTCP_PSFB_PSLEI = 8, /* PSLEI: Payload-Specific Third-Party Loss Early Indication RFC6642*/
175  _RTCP_PSFB_AFB = 15 /* AFB Application layer FB */
176 } rtcp_psfb_t;
rtcp_psfb_t
Definition: switch_rtp.h:166

◆ rtcp_pt_t

enum rtcp_pt_t
Enumerator
_RTCP_PT_FIR 
_RTCP_PT_IJ 
_RTCP_PT_SR 
_RTCP_PT_RR 
_RTCP_PT_SDES 
_RTCP_PT_BYE 
_RTCP_PT_APP 
_RTCP_PT_RTPFB 
_RTCP_PT_PSFB 
_RTCP_PT_XR 
_RTCP_PT_AVB 
_RTCP_PT_RSI 
_RTCP_PT_TOKEN 
_RTCP_PT_IDMS 
_RTCP_PT_LAST 

Definition at line 124 of file switch_rtp.h.

124  { /* RTCP Control Packet types (PT) http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-4 */
125  _RTCP_PT_FIR = 192, /* [RFC 2032] RTP Payload Format for H.261 Video Streams. types 192 (FIR) section 5.2.1 */
126  _RTCP_PT_IJ = 195, /* IJ: Extended inter-arrival jitter report RFC5450*/
127  _RTCP_PT_SR = 200, /* SR: sender report RFC3550 */
128  _RTCP_PT_RR = 201, /* RR: receiver report RFC3550 */
129  _RTCP_PT_SDES = 202, /* SDES: source description RFC3550 */
130  _RTCP_PT_BYE = 203, /* BYE: goodbye RFC3550 */
131  _RTCP_PT_APP = 204, /* APP: application-defined RFC3550 */
132  _RTCP_PT_RTPFB = 205, /* RTPFB: RTCP Transport layer FB message RFC4585 */
133  _RTCP_PT_PSFB = 206, /* PSFB: RTCP Payload-specific FB message RFC4585 */
134  _RTCP_PT_XR = 207, /* XR: extended report RFC3611 */
135  _RTCP_PT_AVB = 208, /* AVB: "Standard for Layer 3 Transport Protocol for Time Sensitive Applications in Local Area Networks." Work in progress. */
136  _RTCP_PT_RSI = 209, /* RSI: Receiver Summary Information RFC5760 */
137  _RTCP_PT_TOKEN = 210, /* TOKEN: Port Mapping RFC6284 */
138  _RTCP_PT_IDMS = 211, /* IDMS: IDMS Settings RFC7272 */
139  _RTCP_PT_LAST = 255 /* RESERVED */
140 } rtcp_pt_t;
rtcp_pt_t
Definition: switch_rtp.h:124

◆ rtcp_rtpfb_t

Enumerator
_RTCP_RTPFB_NACK 
_RTCP_RTPFB_TMMBR 
_RTCP_RTPFB_TMMBN 
_RTCP_RTPFB_SR_REQ 
_RTCP_RTPFB_RAMS 
_RTCP_RTPFB_TLLEI 
_RTCP_RTPFB_ECN_FB 

Definition at line 156 of file switch_rtp.h.

156  { /* FMT Values for RTPFB Payload Types http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-8 */
157  _RTCP_RTPFB_NACK = 1, /* Generic NACK: Generic negative acknowledgement RFC4585 */
158  _RTCP_RTPFB_TMMBR = 3, /* TMMBR: Temporary Maximum Media Stream Bit Rate Request RFC5104 */
159  _RTCP_RTPFB_TMMBN = 4, /* TMMBN: Temporary Maximum Media Stream Bit Rate Notification RFC5104 */
160  _RTCP_RTPFB_SR_REQ = 5, /* RTCP-SR-REQ: TCP Rapid Resynchronisation Request RFC6051*/
161  _RTCP_RTPFB_RAMS = 6, /* RAMS: Rapid Acquisition of Multicast Sessions RFC6285 */
162  _RTCP_RTPFB_TLLEI = 7, /* TLLEI: Transport-Layer Third-Party Loss Early Indication RFC6642 */
163  _RTCP_RTPFB_ECN_FB = 8 /* RTCP-ECN-FB: RTCP ECN Feedback RFC6679*/
164 } rtcp_rtpfb_t;
rtcp_rtpfb_t
Definition: switch_rtp.h:156

◆ rtcp_sdes_t

Enumerator
_RTCP_SDES_END 
_RTCP_SDES_CNAME 
_RTCP_SDES_NAME 
_RTCP_SDES_EMAIL 
_RTCP_SDES_PHONE 
_RTCP_SDES_LOC 
_RTCP_SDES_TOOL 
_RTCP_SDES_NOTE 
_RTCP_SDES_PRIV 
_RTCP_SDES_H323 
_RTCP_SDES_APSI 

Definition at line 142 of file switch_rtp.h.

142  { /* RTP SDES item types http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-5 */
143  _RTCP_SDES_END = 0, /* END: end of sdes list RFC3550 */
144  _RTCP_SDES_CNAME = 1, /* CNAME: canonical name RFC3550 */
145  _RTCP_SDES_NAME = 2, /* NAME: user name RFC3550 */
146  _RTCP_SDES_EMAIL = 3, /* EMAIL: user's electronic mail address RFC3550 */
147  _RTCP_SDES_PHONE = 4, /* PHONE: user's phone number RFC3550 */
148  _RTCP_SDES_LOC = 5, /* LOC: geographic user location RFC3550 */
149  _RTCP_SDES_TOOL = 6, /* TOOL: name of application or tool RFC3550 */
150  _RTCP_SDES_NOTE = 7, /* NOTE: notice about the source RFC3550 */
151  _RTCP_SDES_PRIV = 8, /* PRIV: private extensions RFC3550 */
152  _RTCP_SDES_H323 = 9, /* H323-CADDR: H.323 callable address [Vineet Kumar] */
153  _RTCP_SDES_APSI = 10 /* APSI: Application specific identifer RFC6776 */
154 } rtcp_sdes_t;
rtcp_sdes_t
Definition: switch_rtp.h:142

◆ switch_rtp_crypto_direction_t

Enumerator
SWITCH_RTP_CRYPTO_SEND 
SWITCH_RTP_CRYPTO_RECV 
SWITCH_RTP_CRYPTO_SEND_RTCP 
SWITCH_RTP_CRYPTO_RECV_RTCP 
SWITCH_RTP_CRYPTO_MAX 

Definition at line 62 of file switch_rtp.h.

Function Documentation

◆ switch_rtp_add_crypto_key()

switch_status_t switch_rtp_add_crypto_key ( switch_rtp_t rtp_session,
switch_rtp_crypto_direction_t  direction,
uint32_t  index,
switch_secure_settings_t ssec 
)

Definition at line 4059 of file switch_rtp.c.

References AEAD_AES_128_GCM, AEAD_AES_128_GCM_8, AEAD_AES_256_GCM, AEAD_AES_256_GCM_8, AES_CM_128_HMAC_SHA1_32, AES_CM_128_HMAC_SHA1_80, AES_CM_128_NULL_AUTH, AES_CM_192_HMAC_SHA1_32, AES_CM_192_HMAC_SHA1_80, AES_CM_256_HMAC_SHA1_32, AES_CM_256_HMAC_SHA1_80, switch_rtp::crypto_keys, secure_settings_s::crypto_type, switch_rtp::dtls, switch_rtp::flags, switch_rtp_crypto_key::index, index, switch_rtp_crypto_key::keysalt, secure_settings_s::local_key_material_n, secure_settings_s::local_key_material_next, secure_settings_s::local_raw_key, memset(), switch_crypto_key_material_s::mki_id, switch_crypto_key_material_s::mki_size, switch_rtp_crypto_key::next, switch_crypto_key_material_s::next, switch_rtp::pool, switch_crypto_key_material_s::raw_key, switch_rtp::recv_ctx, switch_rtp::recv_policy, secure_settings_s::remote_key_material_n, secure_settings_s::remote_key_material_next, secure_settings_s::remote_raw_key, rtp_type, switch_rtp::send_ctx, switch_rtp::send_policy, switch_rtp::session, switch_rtp::srtp_idx_rtcp, switch_b64_encode(), SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), switch_channel_get_uuid(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_core_alloc, switch_core_get_variable(), switch_core_media_crypto_keysalt_len(), switch_core_session_get_channel(), switch_event_add_header(), switch_event_add_header_string(), SWITCH_EVENT_CALL_SECURE, switch_event_create, switch_event_fire, SWITCH_LOG_CRIT, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), SWITCH_RTP_CRYPTO_MAX, SWITCH_RTP_CRYPTO_RECV, SWITCH_RTP_CRYPTO_RECV_RTCP, SWITCH_RTP_CRYPTO_SEND, SWITCH_RTP_CRYPTO_SEND_RTCP, SWITCH_RTP_FLAG_SECURE_RECV, SWITCH_RTP_FLAG_SECURE_RECV_MKI, SWITCH_RTP_FLAG_SECURE_RECV_RESET, SWITCH_RTP_FLAG_SECURE_SEND, SWITCH_RTP_FLAG_SECURE_SEND_MKI, SWITCH_RTP_FLAG_SECURE_SEND_RESET, SWITCH_RTP_FLAG_VIDEO, SWITCH_RTP_MAX_CRYPTO_LEN, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_true(), and switch_rtp_crypto_key::type.

Referenced by dtls_state_setup(), switch_core_media_recover_session(), switch_core_session_apply_crypto(), and switch_core_session_check_incoming_crypto().

4060 {
4061 #ifndef ENABLE_SRTP
4062  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_CRIT, "SRTP NOT SUPPORTED IN THIS BUILD!\n");
4063  return SWITCH_STATUS_FALSE;
4064 #else
4065 
4066  switch_rtp_crypto_key_t *crypto_key;
4067  srtp_policy_t *policy;
4068  srtp_err_status_t stat;
4070 
4071  switch_channel_t *channel = switch_core_session_get_channel(rtp_session->session);
4072  switch_event_t *fsevent = NULL;
4073  int idx = 0;
4074  const char *var;
4075  unsigned char b64_key[512] = "";
4076 
4077  unsigned char *keysalt = NULL;
4078  switch_size_t keysalt_len = 0;
4079 
4080  switch_crypto_key_material_t *key_material = NULL;
4081  unsigned long *key_material_n = NULL;
4082  srtp_master_key_t **mkis = NULL;
4083  srtp_master_key_t *mki = NULL;
4084  int mki_idx = 0;
4085 
4087 
4088  if (direction >= SWITCH_RTP_CRYPTO_MAX || keysalt_len > SWITCH_RTP_MAX_CRYPTO_LEN) {
4089  return SWITCH_STATUS_FALSE;
4090  }
4091 
4092  if (direction == SWITCH_RTP_CRYPTO_RECV_RTCP) {
4093  direction = SWITCH_RTP_CRYPTO_RECV;
4094  rtp_session->srtp_idx_rtcp = idx = 1;
4095  } else if (direction == SWITCH_RTP_CRYPTO_SEND_RTCP) {
4096  direction = SWITCH_RTP_CRYPTO_SEND;
4097  rtp_session->srtp_idx_rtcp = idx = 1;
4098  }
4099 
4100  if (direction == SWITCH_RTP_CRYPTO_RECV) {
4101  policy = &rtp_session->recv_policy[idx];
4102  keysalt = ssec->remote_raw_key;
4103  key_material = ssec->remote_key_material_next;
4104  key_material_n = &ssec->remote_key_material_n;
4105  } else {
4106  policy = &rtp_session->send_policy[idx];
4107  keysalt = ssec->local_raw_key;
4108  key_material = ssec->local_key_material_next;
4109  key_material_n = &ssec->local_key_material_n;
4110  }
4111 
4112  switch_b64_encode(keysalt, keysalt_len, b64_key, sizeof(b64_key));
4113 
4114  if (switch_true(switch_core_get_variable("rtp_retain_crypto_keys"))) {
4115  switch(direction) {
4117  switch_channel_set_variable(channel, "srtp_local_crypto_key", (const char *)b64_key);
4118  break;
4120  switch_channel_set_variable(channel, "srtp_remote_crypto_key", (const char *)b64_key);
4121  break;
4122  default:
4123  break;
4124  }
4125 
4126  if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
4127  switch(direction) {
4129  switch_channel_set_variable(channel, "srtp_local_video_crypto_key", (const char *)b64_key);
4130  break;
4132  switch_channel_set_variable(channel, "srtp_remote_video_crypto_key", (const char *)b64_key);
4133  break;
4134  default:
4135  break;
4136  }
4137 
4138  } else {
4139  switch(direction) {
4141  switch_channel_set_variable(channel, "srtp_local_audio_crypto_key", (const char *)b64_key);
4142  break;
4144  switch_channel_set_variable(channel, "srtp_remote_audio_crypto_key", (const char *)b64_key);
4145  break;
4146  default:
4147  break;
4148  }
4149  }
4150  }
4151 
4152  crypto_key = switch_core_alloc(rtp_session->pool, sizeof(*crypto_key));
4153 
4154  crypto_key->type = ssec->crypto_type;
4155  crypto_key->index = index;
4156  memcpy(crypto_key->keysalt, keysalt, keysalt_len);
4157  crypto_key->next = rtp_session->crypto_keys[direction];
4158  rtp_session->crypto_keys[direction] = crypto_key;
4159 
4160  memset(policy, 0, sizeof(*policy));
4161 
4162  /* many devices can't handle gaps in SRTP streams */
4163  if (!((var = switch_channel_get_variable(channel, "srtp_allow_idle_gaps"))
4164  && switch_true(var))
4165  && (!(var = switch_channel_get_variable(channel, "send_silence_when_idle"))
4166  || !(atoi(var)))) {
4167  switch_channel_set_variable(channel, "send_silence_when_idle", "-1");
4168  }
4169 
4170  switch (crypto_key->type) {
4172  srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy->rtp);
4173  srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80(&policy->rtcp);
4174 
4176  switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_128_HMAC_SHA1_80");
4177  }
4178  break;
4180  srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(&policy->rtp);
4181  srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32(&policy->rtcp);
4182 
4183 
4185  switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_128_HMAC_SHA1_32");
4186  }
4187  break;
4188 
4189  case AEAD_AES_256_GCM_8:
4190  srtp_crypto_policy_set_aes_gcm_256_8_auth(&policy->rtp);
4191  srtp_crypto_policy_set_aes_gcm_256_8_auth(&policy->rtcp);
4192 
4194  switch_channel_set_variable(channel, "rtp_has_crypto", "AEAD_AES_256_GCM_8");
4195  }
4196  break;
4197 
4198  case AEAD_AES_256_GCM:
4199  srtp_crypto_policy_set_aes_gcm_256_16_auth(&policy->rtp);
4200  srtp_crypto_policy_set_aes_gcm_256_16_auth(&policy->rtcp);
4201 
4203  switch_channel_set_variable(channel, "rtp_has_crypto", "AEAD_AES_256_GCM");
4204  }
4205  break;
4206 
4207  case AEAD_AES_128_GCM_8:
4208  srtp_crypto_policy_set_aes_gcm_128_8_auth(&policy->rtp);
4209  srtp_crypto_policy_set_aes_gcm_128_8_auth(&policy->rtcp);
4210 
4212  switch_channel_set_variable(channel, "rtp_has_crypto", "AEAD_AES_128_GCM_8");
4213  }
4214  break;
4215 
4216  case AEAD_AES_128_GCM:
4217  srtp_crypto_policy_set_aes_gcm_128_16_auth(&policy->rtp);
4218  srtp_crypto_policy_set_aes_gcm_128_16_auth(&policy->rtcp);
4219 
4221  switch_channel_set_variable(channel, "rtp_has_crypto", "AEAD_AES_128_GCM");
4222  }
4223  break;
4224 
4226  srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80(&policy->rtp);
4227  srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80(&policy->rtcp);
4229  switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_256_HMAC_SHA1_80");
4230  }
4231  break;
4233  srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32(&policy->rtp);
4234  srtp_crypto_policy_set_aes_cm_256_hmac_sha1_32(&policy->rtcp);
4236  switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_256_HMAC_SHA1_32");
4237  }
4238  break;
4240  srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80(&policy->rtp);
4241  srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80(&policy->rtcp);
4243  switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_192_HMAC_SHA1_80");
4244  }
4245  break;
4247  srtp_crypto_policy_set_aes_cm_192_hmac_sha1_32(&policy->rtp);
4248  srtp_crypto_policy_set_aes_cm_192_hmac_sha1_32(&policy->rtcp);
4250  switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_192_HMAC_SHA1_32");
4251  }
4252  break;
4253  case AES_CM_128_NULL_AUTH:
4254  srtp_crypto_policy_set_aes_cm_128_null_auth(&policy->rtp);
4255  srtp_crypto_policy_set_aes_cm_128_null_auth(&policy->rtcp);
4256 
4258  switch_channel_set_variable(channel, "rtp_has_crypto", "AES_CM_128_NULL_AUTH");
4259  }
4260  break;
4261  default:
4262  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Missing crypto type!\n");
4263  break;
4264  }
4265 
4266  /* Setup the policy with MKI if they are used. Number of key materials must be positive to use MKI. */
4267  if (key_material && (*key_material_n > 0)) {
4268 
4269  if (direction == SWITCH_RTP_CRYPTO_RECV) {
4270  rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] = 1; /* tell the rest of the environment MKI is used */
4271  } else {
4272  rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] = 1; /* tell the rest of the environment MKI is used */
4273  }
4274 
4275  /* key must be NULL for libsrtp to work correctly with MKI. */
4276  policy->key = NULL;
4277 
4278  /* Allocate array for MKIs. */
4279  mkis = switch_core_alloc(rtp_session->pool, *key_material_n * sizeof(srtp_master_key_t*));
4280  if (!mkis) {
4281  return SWITCH_STATUS_FALSE;
4282  }
4283 
4284  /* Build array of MKIs. */
4285  mki_idx = 0;
4286 
4287  while (key_material && (mki_idx < *key_material_n)) {
4288 
4289  if (key_material->mki_size < 1) {
4290  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "MKI bad key size at MKI %d\n", mki_idx);
4291  return SWITCH_STATUS_FALSE;
4292  }
4293 
4294  mki = switch_core_alloc(rtp_session->pool, sizeof(srtp_master_key_t));
4295  if (!mki) {
4296  return SWITCH_STATUS_FALSE;
4297  }
4298 
4299  /* Setup MKI. */
4300  mki->mki_id = switch_core_alloc(rtp_session->pool, sizeof(key_material->mki_size));
4301  if (!mki->mki_id) {
4302  return SWITCH_STATUS_FALSE;
4303  }
4304 
4305  mki->key = switch_core_alloc(rtp_session->pool, keysalt_len);
4306  if (!mki->key) {
4307  return SWITCH_STATUS_FALSE;
4308  }
4309 
4310  memcpy(mki->mki_id, &key_material->mki_id, key_material->mki_size);
4311  mki->mki_size = key_material->mki_size;
4312  memcpy(mki->key, key_material->raw_key, keysalt_len);
4313 
4314  mkis[mki_idx] = mki;
4315 
4316  key_material = key_material->next;
4317  ++mki_idx;
4318  }
4319 
4320  /* And pass the array of MKIs to libsrtp. */
4321  policy->keys = mkis;
4322  policy->num_master_keys = mki_idx;
4323 
4324  } else {
4325  policy->key = (uint8_t *) crypto_key->keysalt;
4326  }
4327 
4328  policy->next = NULL;
4329 
4330  policy->window_size = 1024;
4331  policy->allow_repeat_tx = 1;
4332 
4333  //policy->rtp.sec_serv = sec_serv_conf_and_auth;
4334  //policy->rtcp.sec_serv = sec_serv_conf_and_auth;
4335 
4336  switch (direction) {
4338  policy->ssrc.type = ssrc_any_inbound;
4339 
4340  if (rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV] && idx == 0 && rtp_session->recv_ctx[idx]) {
4341  rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_RESET] = 1;
4342  } else {
4343  if ((stat = srtp_create(&rtp_session->recv_ctx[idx], policy)) || !rtp_session->recv_ctx[idx]) {
4344  status = SWITCH_STATUS_FALSE;
4345  }
4346 
4347  if (status == SWITCH_STATUS_SUCCESS) {
4348  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Activating %s Secure %s RECV%s\n",
4349  rtp_type(rtp_session), idx ? "RTCP" : "RTP", rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV_MKI] ? " (with MKI)" : "");
4350  rtp_session->flags[SWITCH_RTP_FLAG_SECURE_RECV] = 1;
4351  } else {
4352  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error allocating srtp [%d]\n", stat);
4353  return status;
4354  }
4355  }
4356  break;
4358  policy->ssrc.type = ssrc_any_outbound;
4359  //policy->ssrc.type = ssrc_specific;
4360  //policy->ssrc.value = rtp_session->ssrc;
4361 
4362  if (rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND] && idx == 0 && rtp_session->send_ctx[idx]) {
4363  rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_RESET] = 1;
4364  } else {
4365  if ((stat = srtp_create(&rtp_session->send_ctx[idx], policy)) || !rtp_session->send_ctx[idx]) {
4366  status = SWITCH_STATUS_FALSE;
4367  }
4368 
4369  if (status == SWITCH_STATUS_SUCCESS) {
4370  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_INFO, "Activating %s Secure %s SEND%s\n",
4371  rtp_type(rtp_session), idx ? "RTCP" : "RTP", rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_MKI] ? " (with MKI)" : "");
4372  rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND] = 1;
4373  } else {
4374  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_ERROR, "Error allocating SRTP [%d]\n", stat);
4375  return status;
4376  }
4377  }
4378 
4379  break;
4380  default:
4381  abort();
4382  break;
4383  }
4384 
4386  if (rtp_session->dtls) {
4387  switch_event_add_header(fsevent, SWITCH_STACK_BOTTOM, "secure_type", "srtp:dtls:AES_CM_128_HMAC_SHA1_80");
4388  switch_channel_set_variable(channel, "rtp_has_crypto", "srtp:dtls:AES_CM_128_HMAC_SHA1_80");
4389  } else {
4390  switch_event_add_header(fsevent, SWITCH_STACK_BOTTOM, "secure_type", "srtp:sdes:%s", switch_channel_get_variable(channel, "rtp_has_crypto"));
4391  }
4392  switch_event_add_header_string(fsevent, SWITCH_STACK_BOTTOM, "caller-unique-id", switch_channel_get_uuid(channel));
4393  switch_event_fire(&fsevent);
4394  }
4395 
4396 
4397  return SWITCH_STATUS_SUCCESS;
4398 #endif
4399 }
#define switch_event_fire(event)
Fire an event filling in most of the arguements with obvious values.
Definition: switch_event.h:413
unsigned char remote_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]
static switch_bool_t switch_true(const char *expr)
Evaluate the truthfullness of a string expression.
Definition: switch_utils.h:519
#define SWITCH_CHANNEL_SESSION_LOG(x)
unsigned char keysalt[SWITCH_RTP_MAX_CRYPTO_LEN]
Definition: switch_rtp.h:81
int srtp_idx_rtcp
Definition: switch_rtp.c:364
switch_status_t switch_event_add_header(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *fmt,...) PRINTF_FUNCTION(4
Add a header to an event.
Representation of an event.
Definition: switch_event.h:80
srtp_policy_t send_policy[2]
Definition: switch_rtp.c:356
switch_rtp_crypto_key_t * crypto_keys[SWITCH_RTP_CRYPTO_MAX]
Definition: switch_rtp.c:442
struct switch_crypto_key_material_s * local_key_material_next
struct switch_crypto_key_material_s * next
#define rtp_type(rtp_session)
Definition: switch_rtp.c:540
int switch_core_media_crypto_keysalt_len(switch_rtp_crypto_key_type_t type)
_Ret_ switch_channel_t * switch_core_session_get_channel(_In_ switch_core_session_t *session)
Retrieve a pointer to the channel object associated with a given session.
srtp_ctx_t * send_ctx[2]
Definition: switch_rtp.c:353
unsigned char local_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]
switch_status_t switch_b64_encode(unsigned char *in, switch_size_t ilen, unsigned char *out, switch_size_t olen)
uint32_t flags[SWITCH_RTP_FLAG_INVALID]
Definition: switch_rtp.c:392
unsigned long local_key_material_n
#define switch_core_alloc(_pool, _mem)
Allocate memory directly from a memory pool.
Definition: switch_core.h:684
#define switch_channel_get_variable(_c, _v)
int index
Definition: switch_cJSON.h:160
srtp_ctx_t * recv_ctx[2]
Definition: switch_rtp.c:354
switch_status_t switch_event_add_header_string(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *data)
Add a string header to an event.
#define SWITCH_RTP_MAX_CRYPTO_LEN
switch_rtp_crypto_key_type_t type
Definition: switch_rtp.h:80
uintptr_t switch_size_t
switch_dtls_t * dtls
Definition: switch_rtp.c:366
char * switch_core_get_variable(_In_z_ const char *varname)
Retrieve a global variable from the core.
unsigned long remote_key_material_n
char * switch_channel_get_uuid(switch_channel_t *channel)
Retrieve the given channel&#39;s unique id.
switch_memory_pool_t * pool
Definition: switch_rtp.c:393
switch_status_t
Common return values.
srtp_policy_t recv_policy[2]
Definition: switch_rtp.c:357
switch_core_session_t * session
Definition: switch_rtp.c:472
#define switch_event_create(event, id)
Create a new event assuming it will not be custom event and therefore hiding the unused parameters...
Definition: switch_event.h:384
switch_call_direction_t switch_channel_direction(switch_channel_t *channel)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
unsigned char raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]
#define switch_channel_set_variable(_channel, _var, _val)
switch_rtp_crypto_key_type_t crypto_type
struct switch_rtp_crypto_key * next
Definition: switch_rtp.h:83
memset(buf, 0, buflen)
struct switch_crypto_key_material_s * remote_key_material_next