func_audiohookinherit.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2008, 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. * Please follow coding guidelines
  19. * http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES
  20. */
  21. /*! \file
  22. *
  23. * \brief Audiohook inheritance function
  24. *
  25. * \author Mark Michelson <mmichelson@digium.com>
  26. *
  27. * \ingroup functions
  28. */
  29. /*** MODULEINFO
  30. <defaultenabled>no</defaultenabled>
  31. <support_level>deprecated</support_level>
  32. ***/
  33. #include "asterisk.h"
  34. #include "asterisk/channel.h"
  35. #include "asterisk/logger.h"
  36. #include "asterisk/pbx.h"
  37. #include "asterisk/module.h"
  38. /*** DOCUMENTATION
  39. <function name = "AUDIOHOOK_INHERIT" language="en_US">
  40. <synopsis>
  41. DEPRECATED: Used to set whether an audiohook may be inherited to another
  42. channel. Due to architectural changes in Asterisk 12, audiohook inheritance
  43. is performed automatically and this function now lacks function.
  44. </synopsis>
  45. <description>
  46. <para>Prior to Asterisk 12, masquerades would occur under all sorts of
  47. situations which were hard to predict. In Asterisk 12, masquerades only
  48. occur as a result of a small set of operations for which inheriting all
  49. audiohooks from the original channel is now safe. So in Asterisk 12.5+,
  50. all audiohooks are inherited without needing other controls expressing
  51. which audiohooks should be inherited under which conditions.</para>
  52. </description>
  53. </function>
  54. ***/
  55. static int func_inheritance_write(struct ast_channel *chan, const char *function, char *data, const char *value)
  56. {
  57. static int warned = 0;
  58. if (!warned) {
  59. ast_log(LOG_NOTICE, "AUDIOHOOK_INHERIT is deprecated and now does nothing.\n");
  60. warned++;
  61. }
  62. return 0;
  63. }
  64. static struct ast_custom_function inheritance_function = {
  65. .name = "AUDIOHOOK_INHERIT",
  66. .write = func_inheritance_write,
  67. };
  68. static int unload_module(void)
  69. {
  70. return ast_custom_function_unregister(&inheritance_function);
  71. }
  72. static int load_module(void)
  73. {
  74. if (ast_custom_function_register(&inheritance_function)) {
  75. return AST_MODULE_LOAD_DECLINE;
  76. } else {
  77. return AST_MODULE_LOAD_SUCCESS;
  78. }
  79. }
  80. AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Audiohook inheritance placeholder function");