global_datastores.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 1999 - 2007, Digium, Inc.
  5. *
  6. * Mark Michelson <mmichelson@digium.com>
  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
  19. *
  20. * \brief globally-accessible datastore information and callbacks
  21. *
  22. * \author Mark Michelson <mmichelson@digium.com>
  23. */
  24. /*** MODULEINFO
  25. <support_level>core</support_level>
  26. ***/
  27. #include "asterisk.h"
  28. ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  29. #include "asterisk/global_datastores.h"
  30. static void secure_call_store_destroy(void *data)
  31. {
  32. struct ast_secure_call_store *store = data;
  33. ast_free(store);
  34. }
  35. static void *secure_call_store_duplicate(void *data)
  36. {
  37. struct ast_secure_call_store *old = data;
  38. struct ast_secure_call_store *new;
  39. if (!(new = ast_calloc(1, sizeof(*new)))) {
  40. return NULL;
  41. }
  42. new->signaling = old->signaling;
  43. new->media = old->media;
  44. return new;
  45. }
  46. const struct ast_datastore_info secure_call_info = {
  47. .type = "encrypt-call",
  48. .destroy = secure_call_store_destroy,
  49. .duplicate = secure_call_store_duplicate,
  50. };