2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 2014, 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 <support_level>core</support_level>
24 #include "asterisk/module.h"
25 #include "asterisk/stasis.h"
26 #include "asterisk/devicestate.h"
28 static struct stasis_forward *topic_forwarder;
30 static int unload_module(void)
32 topic_forwarder = stasis_forward_cancel(topic_forwarder);
36 static int load_module(void)
38 struct stasis_topic *manager_topic;
40 manager_topic = ast_manager_get_topic();
42 return AST_MODULE_LOAD_DECLINE;
45 topic_forwarder = stasis_forward_all(ast_device_state_topic_all(), manager_topic);
47 return AST_MODULE_LOAD_SUCCESS;
50 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Manager Device State Topic Forwarder",
51 .support_level = AST_MODULE_SUPPORT_CORE,
53 .unload = unload_module,
54 .load_pri = AST_MODPRI_DEVSTATE_CONSUMER,