Wed Jan 8 2020 09:49:51

Asterisk developer's documentation


srtp.c
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2006 - 2007, Mikael Magnusson
5  *
6  * Mikael Magnusson <mikma@users.sourceforge.net>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 
19 /*! \file sip_srtp.c
20  *
21  * \brief SIP Secure RTP (SRTP)
22  *
23  * Specified in RFC 3711
24  *
25  * \author Mikael Magnusson <mikma@users.sourceforge.net>
26  */
27 
28 /*** MODULEINFO
29  <support_level>core</support_level>
30  ***/
31 
32 #include "asterisk.h"
33 
34 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369001 $")
35 
36 #include "asterisk/utils.h"
37 #include "include/srtp.h"
38 
39 struct sip_srtp *sip_srtp_alloc(void)
40 {
41  struct sip_srtp *srtp;
42 
43  srtp = ast_calloc(1, sizeof(*srtp));
44 
45  return srtp;
46 }
47 
48 void sip_srtp_destroy(struct sip_srtp *srtp)
49 {
50  if (srtp->crypto) {
51  sdp_crypto_destroy(srtp->crypto);
52  }
53  srtp->crypto = NULL;
54  ast_free(srtp);
55 }
Asterisk main include file. File version handling, generic pbx functions.
void sip_srtp_destroy(struct sip_srtp *srtp)
Definition: srtp.c:48
void sdp_crypto_destroy(struct sdp_crypto *crypto)
Definition: sdp_crypto.c:64
struct sip_srtp * sip_srtp_alloc(void)
Definition: srtp.c:39
#define ast_free(a)
Definition: astmm.h:97
#define ast_calloc(a, b)
Definition: astmm.h:82
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.
Definition: asterisk.h:180