Asterisk - The Open Source Telephony Project GIT-master-f36a736
manager_system.c
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2013, Digium, Inc.
5 *
6 * Jason Parker <jparker@digium.com>
7 *
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.
13 *
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.
17 */
18
19/*! \file
20 *
21 * \brief System AMI event handling
22 *
23 * \author Jason Parker <jparker@digium.com>
24 */
25
26#include "asterisk.h"
27
28#include "asterisk/stasis.h"
31
32/*! \brief The \ref stasis subscription returned by the forwarding of the system topic
33 * to the manager topic
34 */
36
37static void manager_system_shutdown(void)
38{
41}
42
44{
47 struct stasis_message_router *message_router;
48
50 if (!manager_topic) {
51 return -1;
52 }
53 message_router = ast_manager_get_message_router();
54 if (!message_router) {
55 return -1;
56 }
58 if (!system_topic) {
59 return -1;
60 }
61
63 if (!topic_forwarder) {
64 return -1;
65 }
66
68
69 return 0;
70}
Asterisk main include file. File version handling, generic pbx functions.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
Definition: clicompat.c:19
struct stasis_message_router * ast_manager_get_message_router(void)
Get the stasis_message_router for AMI.
Definition: manager.c:458
struct stasis_topic * ast_manager_get_topic(void)
Get the Stasis Message Bus API topic for AMI.
Definition: manager.c:453
static struct stasis_topic * manager_topic
A stasis_topic that all topics AMI cares about will be forwarded to.
Definition: manager.c:185
int manager_system_init(void)
Initialize support for AMI system events.
static void manager_system_shutdown(void)
static struct stasis_forward * topic_forwarder
The Stasis Message Bus API subscription returned by the forwarding of the system topic to the manager...
#define NULL
Definition: resample.c:96
Stasis Message Bus API. See Stasis Message Bus API for detailed documentation.
struct stasis_forward * stasis_forward_cancel(struct stasis_forward *forward)
Definition: stasis.c:1549
struct stasis_forward * stasis_forward_all(struct stasis_topic *from_topic, struct stasis_topic *to_topic)
Create a subscription which forwards all messages from one topic to another.
Definition: stasis.c:1579
static struct stasis_topic * system_topic
The Stasis Message Bus API topic for system level changes.
Definition: stasis_system.c:68
struct stasis_topic * ast_system_topic(void)
A Stasis Message Bus API topic which publishes messages regarding system changes.
Forwarding information.
Definition: stasis.c:1532