srtp.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /*! \file sip_srtp.c
  19. *
  20. * \brief SIP Secure RTP (SRTP)
  21. *
  22. * Specified in RFC 3711
  23. *
  24. * \author Mikael Magnusson <mikma@users.sourceforge.net>
  25. */
  26. /*** MODULEINFO
  27. <support_level>core</support_level>
  28. ***/
  29. #include "asterisk.h"
  30. ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  31. #include "asterisk/utils.h"
  32. #include "include/srtp.h"
  33. struct sip_srtp *sip_srtp_alloc(void)
  34. {
  35. struct sip_srtp *srtp;
  36. srtp = ast_calloc(1, sizeof(*srtp));
  37. return srtp;
  38. }
  39. void sip_srtp_destroy(struct sip_srtp *srtp)
  40. {
  41. if (srtp->crypto) {
  42. sdp_crypto_destroy(srtp->crypto);
  43. }
  44. srtp->crypto = NULL;
  45. ast_free(srtp);
  46. }