2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2006, Digium, Inc.
6 * Russell Bryant <russelb@clemson.edu>
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.
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.
21 * \brief Functions for reading or setting the MusicOnHold class
23 * \author Russell Bryant <russelb@clemson.edu>
28 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
33 #include "asterisk/module.h"
34 #include "asterisk/channel.h"
35 #include "asterisk/pbx.h"
36 #include "asterisk/utils.h"
37 #include "asterisk/stringfields.h"
39 static int depwarning = 0;
41 static int moh_read(struct ast_channel *chan, char *cmd, char *data,
42 char *buf, size_t len)
46 ast_log(LOG_WARNING, "MUSICCLASS() is deprecated; use CHANNEL(musicclass) instead.\n");
49 ast_copy_string(buf, chan->musicclass, len);
54 static int moh_write(struct ast_channel *chan, char *cmd, char *data,
59 ast_log(LOG_WARNING, "MUSICCLASS() is deprecated; use CHANNEL(musicclass) instead.\n");
62 ast_string_field_set(chan, musicclass, value);
67 static struct ast_custom_function moh_function = {
69 .synopsis = "Read or Set the MusicOnHold class",
70 .syntax = "MUSICCLASS()",
71 .desc = "Deprecated. Use CHANNEL(musicclass) instead.\n",
76 static int unload_module(void)
78 return ast_custom_function_unregister(&moh_function);
81 static int load_module(void)
83 return ast_custom_function_register(&moh_function);
86 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Music-on-hold dialplan function");