func_audiohookinherit.c

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2008, Digium, Inc.
00005  *
00006  * Mark Michelson <mmichelson@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  *
00018  * Please follow coding guidelines
00019  * http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES
00020  */
00021 
00022 /*! \file
00023  *
00024  * \brief Audiohook inheritance function
00025  *
00026  * \author Mark Michelson <mmichelson@digium.com>
00027  *
00028  * \ingroup functions
00029  */
00030 
00031 /*** MODULEINFO
00032    <support_level>deprecated</support_level>
00033  ***/
00034 
00035 #include "asterisk.h"
00036 #include "asterisk/channel.h"
00037 #include "asterisk/logger.h"
00038 #include "asterisk/pbx.h"
00039 #include "asterisk/module.h"
00040 
00041 /*** DOCUMENTATION
00042    <function name = "AUDIOHOOK_INHERIT" language="en_US">
00043       <synopsis>
00044          DEPRECATED: Used to set whether an audiohook may be inherited to another
00045          channel. Due to architectural changes in Asterisk 12, audiohook inheritance
00046          is performed automatically and this function now lacks function.
00047       </synopsis>
00048       <description>
00049          <para>Prior to Asterisk 12, masquerades would occur under all sorts of
00050          situations which were hard to predict.  In Asterisk 12, masquerades only
00051          occur as a result of a small set of operations for which inheriting all
00052          audiohooks from the original channel is now safe.  So in Asterisk 12.5+,
00053          all audiohooks are inherited without needing other controls expressing
00054          which audiohooks should be inherited under which conditions.</para>
00055       </description>
00056    </function>
00057  ***/
00058 
00059 static int func_inheritance_write(struct ast_channel *chan, const char *function, char *data, const char *value)
00060 {
00061    static int warned = 0;
00062 
00063    if (!warned) {
00064       ast_log(LOG_NOTICE, "AUDIOHOOK_INHERIT is deprecated and now does nothing.\n");
00065       warned++;
00066    }
00067 
00068    return 0;
00069 }
00070 
00071 static struct ast_custom_function inheritance_function = {
00072    .name = "AUDIOHOOK_INHERIT",
00073    .write = func_inheritance_write,
00074 };
00075 
00076 static int unload_module(void)
00077 {
00078    return ast_custom_function_unregister(&inheritance_function);
00079 }
00080 
00081 static int load_module(void)
00082 {
00083    if (ast_custom_function_register(&inheritance_function)) {
00084       return AST_MODULE_LOAD_DECLINE;
00085    } else {
00086       return AST_MODULE_LOAD_SUCCESS;
00087    }
00088 }
00089 AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Audiohook inheritance placeholder function");
00090 

Generated on Thu Apr 16 06:27:35 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6