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
? 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");
63 ast_string_field_set(chan
, musicclass
, value
);
68 static struct ast_custom_function moh_function
= {
70 .synopsis
= "Read or Set the MusicOnHold class",
71 .syntax
= "MUSICCLASS()",
72 .desc
= "Deprecated. Use CHANNEL(musicclass) instead.\n",
77 static int unload_module(void)
79 return ast_custom_function_unregister(&moh_function
);
82 static int load_module(void)
84 return ast_custom_function_register(&moh_function
);
87 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY
, "Music-on-hold dialplan function");