func_audiohookinherit.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. <support_level>deprecated</support_level>
  31. ***/
  32. #include "asterisk.h"
  33. #include "asterisk/channel.h"
  34. #include "asterisk/logger.h"
  35. #include "asterisk/pbx.h"
  36. #include "asterisk/module.h"
  37. /*** DOCUMENTATION
  38. <function name = "AUDIOHOOK_INHERIT" language="en_US">
  39. <synopsis>
  40. DEPRECATED: Used to set whether an audiohook may be inherited to another
  41. channel. Due to architectural changes in Asterisk 12, audiohook inheritance
  42. is performed automatically and this function now lacks function.
  43. </synopsis>
  44. <description>
  45. <para>Prior to Asterisk 12, masquerades would occur under all sorts of
  46. situations which were hard to predict. In Asterisk 12, masquerades only
  47. occur as a result of a small set of operations for which inheriting all
  48. audiohooks from the original channel is now safe. So in Asterisk 12.5+,
  49. all audiohooks are inherited without needing other controls expressing
  50. which audiohooks should be inherited under which conditions.</para>
  51. </description>
  52. </function>
  53. ***/
  54. static int func_inheritance_write(struct ast_channel *chan, const char *function, char *data, const char *value)
  55. {
  56. static int warned = 0;
  57. if (!warned) {
  58. ast_log(LOG_NOTICE, "AUDIOHOOK_INHERIT is deprecated and now does nothing.\n");
  59. warned++;
  60. }
  61. return 0;
  62. }
  63. static struct ast_custom_function inheritance_function = {
  64. .name = "AUDIOHOOK_INHERIT",
  65. .write = func_inheritance_write,
  66. };
  67. static int unload_module(void)
  68. {
  69. return ast_custom_function_unregister(&inheritance_function);
  70. }
  71. static int load_module(void)
  72. {
  73. if (ast_custom_function_register(&inheritance_function)) {
  74. return AST_MODULE_LOAD_DECLINE;
  75. } else {
  76. return AST_MODULE_LOAD_SUCCESS;
  77. }
  78. }
  79. AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Audiohook inheritance placeholder function");