summaryrefslogtreecommitdiff
path: root/main/manager.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-11-08 19:33:48 +0000
committerJonathan Rose <jrose@digium.com>2013-11-08 19:33:48 +0000
commitbf5492abd2f0bc4edf386bf06d8728843f5eb3d3 (patch)
tree2ad8ca7a22ba106258cbda46a8b6b3705108eef6 /main/manager.c
parent518f091a1addb6ccd161e7afd5d8ef674a4d1ad3 (diff)
security_events: Push out security events over AMI events
Security Events will now be written to any listener of the new 'security' class Review: https://reviewboard.asterisk.org/r/2998/ ........ Merged revisions 402584 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/manager.c b/main/manager.c
index 01cc75474..f2590b1bb 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -1129,6 +1129,9 @@ static struct stasis_message_router *stasis_router;
/*! \brief The \ref stasis_subscription for forwarding the RTP topic to the AMI topic */
static struct stasis_forward *rtp_topic_forwarder;
+/*! \brief The \ref stasis_subscription for forwarding the Security topic to the AMI topic */
+static struct stasis_forward *security_topic_forwarder;
+
#define MGR_SHOW_TERMINAL_WIDTH 80
#define MAX_VARS 128
@@ -1593,6 +1596,7 @@ static const struct permalias {
{ EVENT_FLAG_CC, "cc" },
{ EVENT_FLAG_AOC, "aoc" },
{ EVENT_FLAG_TEST, "test" },
+ { EVENT_FLAG_SECURITY, "security" },
{ EVENT_FLAG_MESSAGE, "message" },
{ INT_MAX, "all" },
{ 0, "none" },
@@ -7774,6 +7778,8 @@ static void manager_shutdown(void)
}
stasis_forward_cancel(rtp_topic_forwarder);
rtp_topic_forwarder = NULL;
+ stasis_forward_cancel(security_topic_forwarder);
+ security_topic_forwarder = NULL;
ao2_cleanup(manager_topic);
manager_topic = NULL;
STASIS_MESSAGE_TYPE_CLEANUP(ast_manager_get_generic_type);
@@ -7817,6 +7823,11 @@ static int manager_subscriptions_init(void)
return -1;
}
+ security_topic_forwarder = stasis_forward_all(ast_security_topic(), manager_topic);
+ if (!security_topic_forwarder) {
+ return -1;
+ }
+
stasis_router = stasis_message_router_create(manager_topic);
if (!stasis_router) {
return -1;