2008-12-19 22:26:16 +00:00
|
|
|
/*
|
|
|
|
* Asterisk -- An open source telephony toolkit.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008, Digium, Inc.
|
|
|
|
*
|
|
|
|
* Mark Michelson <mmichelson@digium.com>
|
|
|
|
*
|
|
|
|
* See http://www.asterisk.org for more information about
|
|
|
|
* the Asterisk project. Please do not directly contact
|
|
|
|
* any of the maintainers of this project for assistance;
|
|
|
|
* the project provides a web site, mailing lists and IRC
|
|
|
|
* channels for your use.
|
|
|
|
*
|
|
|
|
* This program is free software, distributed under the terms of
|
|
|
|
* the GNU General Public License Version 2. See the LICENSE file
|
|
|
|
* at the top of the source tree.
|
|
|
|
*
|
|
|
|
* Please follow coding guidelines
|
|
|
|
* http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*! \file
|
|
|
|
*
|
|
|
|
* \brief Audiohook inheritance function
|
|
|
|
*
|
2008-12-19 22:40:57 +00:00
|
|
|
* \author Mark Michelson <mmichelson@digium.com>
|
2008-12-19 22:26:16 +00:00
|
|
|
*
|
|
|
|
* \ingroup functions
|
|
|
|
*/
|
|
|
|
|
2011-07-14 20:28:54 +00:00
|
|
|
/*** MODULEINFO
|
2014-07-18 16:28:10 +00:00
|
|
|
<support_level>deprecated</support_level>
|
2011-07-14 20:28:54 +00:00
|
|
|
***/
|
|
|
|
|
2008-12-19 22:26:16 +00:00
|
|
|
#include "asterisk.h"
|
|
|
|
#include "asterisk/channel.h"
|
|
|
|
#include "asterisk/logger.h"
|
|
|
|
#include "asterisk/pbx.h"
|
|
|
|
#include "asterisk/module.h"
|
|
|
|
|
|
|
|
/*** DOCUMENTATION
|
2014-07-18 16:28:10 +00:00
|
|
|
<function name = "AUDIOHOOK_INHERIT" language="en_US">
|
2008-12-19 22:26:16 +00:00
|
|
|
<synopsis>
|
2014-07-18 16:28:10 +00:00
|
|
|
DEPRECATED: Used to set whether an audiohook may be inherited to another
|
|
|
|
channel. Due to architectural changes in Asterisk 12, audiohook inheritance
|
|
|
|
is performed automatically and this function now lacks function.
|
2008-12-28 15:36:25 +00:00
|
|
|
</synopsis>
|
2008-12-19 22:26:16 +00:00
|
|
|
<description>
|
2014-07-18 16:28:10 +00:00
|
|
|
<para>Prior to Asterisk 12, masquerades would occur under all sorts of
|
|
|
|
situations which were hard to predict. In Asterisk 12, masquerades now only
|
|
|
|
occur as a result of small set of similar operations for which inheriting
|
|
|
|
all audiohooks from the original channel is now safe, so in Asterisk 12.5+,
|
|
|
|
all audiohooks are inherited without needing other controls expressing
|
|
|
|
which audiohooks should be inherited under which which conditions.</para>
|
2008-12-19 22:26:16 +00:00
|
|
|
</description>
|
|
|
|
</function>
|
|
|
|
***/
|
|
|
|
|
|
|
|
static int func_inheritance_write(struct ast_channel *chan, const char *function, char *data, const char *value)
|
|
|
|
{
|
2014-07-18 16:28:10 +00:00
|
|
|
static int warned = 0;
|
2008-12-19 22:26:16 +00:00
|
|
|
|
2014-07-18 16:28:10 +00:00
|
|
|
if (!warned) {
|
|
|
|
ast_log(LOG_NOTICE, "AUDIOHOOK_INHERIT is deprecated and now does nothing.\n");
|
|
|
|
warned++;
|
2008-12-19 22:26:16 +00:00
|
|
|
}
|
|
|
|
|
2014-07-18 16:28:10 +00:00
|
|
|
return 0;
|
2008-12-19 22:26:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct ast_custom_function inheritance_function = {
|
|
|
|
.name = "AUDIOHOOK_INHERIT",
|
|
|
|
.write = func_inheritance_write,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int unload_module(void)
|
|
|
|
{
|
|
|
|
return ast_custom_function_unregister(&inheritance_function);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int load_module(void)
|
|
|
|
{
|
|
|
|
if (ast_custom_function_register(&inheritance_function)) {
|
|
|
|
return AST_MODULE_LOAD_DECLINE;
|
|
|
|
} else {
|
|
|
|
return AST_MODULE_LOAD_SUCCESS;
|
|
|
|
}
|
|
|
|
}
|
2014-07-18 16:28:10 +00:00
|
|
|
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Audiohook inheritance placeholder function");
|