2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2006, Digium, Inc.
6 * See http://www.asterisk.org for more information about
7 * the Asterisk project. Please do not directly contact
8 * any of the maintainers of this project for assistance;
9 * the project provides a web site, mailing lists and IRC
10 * channels for your use.
12 * This program is free software, distributed under the terms of
13 * the GNU General Public License Version 2. See the LICENSE file
14 * at the top of the source tree.
19 * \brief Language related dialplan functions
25 ASTERISK_FILE_VERSION(__FILE__
, "$Revision$")
30 #include <sys/types.h>
32 #include "asterisk/module.h"
33 #include "asterisk/channel.h"
34 #include "asterisk/pbx.h"
35 #include "asterisk/logger.h"
36 #include "asterisk/utils.h"
37 #include "asterisk/app.h"
38 #include "asterisk/stringfields.h"
40 static int depwarning
= 0;
42 static int language_read(struct ast_channel
*chan
, char *cmd
, char *data
,
43 char *buf
, size_t len
)
48 "LANGUAGE() is deprecated; use CHANNEL(language) instead.\n");
51 ast_copy_string(buf
, chan
? chan
->language
: "", len
);
56 static int language_write(struct ast_channel
*chan
, char *cmd
, char *data
,
62 "LANGUAGE() is deprecated; use CHANNEL(language) instead.\n");
66 ast_string_field_set(chan
, language
, value
);
71 static struct ast_custom_function language_function
= {
73 .synopsis
= "Gets or sets the channel's language.",
74 .syntax
= "LANGUAGE()",
75 .desc
= "Deprecated. Use CHANNEL(language) instead.\n",
76 .read
= language_read
,
77 .write
= language_write
,
80 static int unload_module(void)
82 return ast_custom_function_unregister(&language_function
);
85 static int load_module(void)
87 return ast_custom_function_register(&language_function
);
90 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY
, "Channel language dialplan function");