2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2010, Digium, Inc.
6 * Mark Michelson <mmichelson@digium.com>
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.
20 * \brief Call Completion Supplementary Services implementation
21 * \author Mark Michelson <mmichelson@digium.com>
25 <support_level>core</support_level>
30 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
32 #include "asterisk/module.h"
33 #include "asterisk/channel.h"
34 #include "asterisk/ccss.h"
35 #include "asterisk/pbx.h"
38 <function name="CALLCOMPLETION" language="en_US">
40 Get or set a call completion configuration parameter for a channel.
43 <parameter name="option" required="true">
44 <para>The allowable options are:</para>
46 <enum name="cc_agent_policy" />
47 <enum name="cc_monitor_policy" />
48 <enum name="cc_offer_timer" />
49 <enum name="ccnr_available_timer" />
50 <enum name="ccbs_available_timer" />
51 <enum name="cc_recall_timer" />
52 <enum name="cc_max_agents" />
53 <enum name="cc_max_monitors" />
54 <enum name="cc_callback_macro" />
55 <enum name="cc_agent_dialstring" />
60 <para>The CALLCOMPLETION function can be used to get or set a call
61 completion configuration parameter for a channel. Note that setting
62 a configuration parameter will only change the parameter for the
65 For more information see <filename>doc/AST.pdf</filename>.
66 For more information on call completion parameters, see <filename>configs/ccss.conf.sample</filename>.</para>
71 static int acf_cc_read(struct ast_channel *chan, const char *name, char *data,
72 char *buf, size_t buf_len)
74 struct ast_cc_config_params *cc_params;
77 ast_channel_lock(chan);
78 if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
79 ast_channel_unlock(chan);
83 res = ast_cc_get_param(cc_params, data, buf, buf_len);
84 ast_channel_unlock(chan);
88 static int acf_cc_write(struct ast_channel *chan, const char *cmd, char *data,
91 struct ast_cc_config_params *cc_params;
94 ast_channel_lock(chan);
95 if (!(cc_params = ast_channel_get_cc_config_params(chan))) {
96 ast_channel_unlock(chan);
100 res = ast_cc_set_param(cc_params, data, value);
101 ast_channel_unlock(chan);
105 static struct ast_custom_function cc_function = {
106 .name = "CALLCOMPLETION",
108 .write = acf_cc_write,
111 static int unload_module(void)
113 return ast_custom_function_unregister(&cc_function);
116 static int load_module(void)
118 return ast_custom_function_register(&cc_function) == 0 ? AST_MODULE_LOAD_SUCCESS : AST_MODULE_LOAD_DECLINE;
121 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call Control Configuration Function");