00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 2006 - 2007, Mikael Magnusson 00005 * 00006 * Mikael Magnusson <mikma@users.sourceforge.net> 00007 * 00008 * See http://www.asterisk.org for more information about 00009 * the Asterisk project. Please do not directly contact 00010 * any of the maintainers of this project for assistance; 00011 * the project provides a web site, mailing lists and IRC 00012 * channels for your use. 00013 * 00014 * This program is free software, distributed under the terms of 00015 * the GNU General Public License Version 2. See the LICENSE file 00016 * at the top of the source tree. 00017 */ 00018 00019 /*! \file sip_srtp.c 00020 * 00021 * \brief SIP Secure RTP (SRTP) 00022 * 00023 * Specified in RFC 3711 00024 * 00025 * \author Mikael Magnusson <mikma@users.sourceforge.net> 00026 */ 00027 00028 /*** MODULEINFO 00029 <support_level>core</support_level> 00030 ***/ 00031 00032 #include "asterisk.h" 00033 00034 ASTERISK_FILE_VERSION(__FILE__, "$Revision: 369001 $") 00035 00036 #include "asterisk/utils.h" 00037 #include "include/srtp.h" 00038 00039 struct sip_srtp *sip_srtp_alloc(void) 00040 { 00041 struct sip_srtp *srtp; 00042 00043 srtp = ast_calloc(1, sizeof(*srtp)); 00044 00045 return srtp; 00046 } 00047 00048 void sip_srtp_destroy(struct sip_srtp *srtp) 00049 { 00050 if (srtp->crypto) { 00051 sdp_crypto_destroy(srtp->crypto); 00052 } 00053 srtp->crypto = NULL; 00054 ast_free(srtp); 00055 }