44 ast_debug(1,
"No SRTP module loaded, can't setup SRTP session.\n");
67 sdp_crypto_api->
dtor(crypto);
73 if (!sdp_crypto_api) {
76 return sdp_crypto_api->
alloc();
81 if (!sdp_crypto_api) {
84 return sdp_crypto_api->
parse_offer(rtp, srtp, attr);
89 if (!sdp_crypto_api) {
97 if (!sdp_crypto_api) {
100 return sdp_crypto_api->
get_attr(srtp, dtls_enabled, default_taglen_32);
104 unsigned int force_avp)
110 return using_avpf ?
"RTP/SAVPF" :
"RTP/SAVP";
112 return using_avpf ?
"UDP/TLS/RTP/SAVPF" :
"UDP/TLS/RTP/SAVP";
116 return sdes_active ?
"RTP/SAVPF" :
"RTP/AVPF";
118 return sdes_active ?
"RTP/SAVP" :
"RTP/AVP";
125 if (sdp_crypto_api) {
128 sdp_crypto_api = api;
134 if (sdp_crypto_api == api) {
135 sdp_crypto_api =
NULL;
structure for secure RTP audio
static struct ast_sdp_crypto_api * sdp_crypto_api
Asterisk main include file. File version handling, generic pbx functions.
sdp_crypto_parse_offer_cb parse_offer
void ast_sdp_srtp_destroy(struct ast_sdp_srtp *srtp)
free a ast_sdp_srtp structure
sdp_crypto_build_offer_cb build_offer
int ast_sdp_crypto_process(struct ast_rtp_instance *rtp, struct ast_sdp_srtp *srtp, const char *attr)
Parse the a=crypto line from SDP and set appropriate values on the ast_sdp_crypto struct...
char * ast_sdp_get_rtp_profile(unsigned int sdes_active, struct ast_rtp_instance *instance, unsigned int using_avpf, unsigned int force_avp)
Get the RTP profile in use by a media session.
#define AST_LIST_NEXT(elm, field)
Returns the next entry in the list after the given entry.
void ast_sdp_crypto_unregister(struct ast_sdp_crypto_api *api)
Unregister SDP SRTP crypto processing routines.
void ast_sdp_crypto_destroy(struct ast_sdp_crypto *crypto)
Destroy a previously allocated ast_sdp_crypto struct.
struct ast_sdp_srtp * next
int ast_sdp_crypto_build_offer(struct ast_sdp_crypto *p, int taglen)
Generate an SRTP a=crypto offer.
sdp_crypto_alloc_cb alloc
struct ast_sdp_srtp * ast_sdp_srtp_alloc(void)
allocate a ast_sdp_srtp structure
sdp_crypto_destroy_cb dtor
#define ast_debug(level,...)
Log a DEBUG message.
SRTP and SDP Security descriptions.
struct ast_sdp_crypto * crypto
A set of macros to manage forward-linked lists.
Structure that represents the optional DTLS SRTP support within an RTP engine.
struct ast_rtp_engine_dtls * ast_rtp_instance_get_dtls(struct ast_rtp_instance *instance)
Obtain a pointer to the DTLS support present on an RTP instance.
#define ast_calloc(num, len)
A wrapper for calloc()
int ast_sdp_crypto_register(struct ast_sdp_crypto_api *api)
Register SDP SRTP crypto processing routines.
struct ast_sdp_srtp::@318 sdp_srtp_list
Support for logging to various files, console and syslog Configuration in file logger.conf.
const char * ast_sdp_srtp_get_attrib(struct ast_sdp_srtp *srtp, int dtls_enabled, int default_taglen_32)
Get the crypto attribute line for the srtp structure.
int(* active)(struct ast_rtp_instance *instance)
int ast_rtp_engine_srtp_is_registered(void)
struct ast_sdp_crypto * ast_sdp_crypto_alloc(void)
Initialize an return an ast_sdp_crypto struct.
sdp_srtp_get_attr_cb get_attr