aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-03 23:48:04 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-03 23:48:04 +0000
commita6114c7c8425ad728ccd6ae430196286953f7969 (patch)
tree8745208639115d8f1a4fa8a803c5f00d93028dad /res
parent13d1f2b914722f30d845a3326929f89e39c7a48e (diff)
Add manager events for when a monitor is started or stopped.
Closes issue #10191, patch by dgradecak. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90738 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_monitor.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c
index 0db821e22..94d3a6056 100644
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -233,6 +233,13 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
ast_monitor_set_state(chan, AST_MONITOR_RUNNING);
/* so we know this call has been monitored in case we need to bill for it or something */
pbx_builtin_setvar_helper(chan, "__MONITORED","true");
+
+ manager_event(EVENT_FLAG_CALL, "MonitorStart",
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n",
+ chan->name,
+ chan->uniqueid
+ );
} else {
ast_debug(1,"Cannot start monitoring %s, already monitored\n", chan->name);
res = -1;
@@ -341,6 +348,13 @@ int ast_monitor_stop(struct ast_channel *chan, int need_lock)
ast_free(chan->monitor->format);
ast_free(chan->monitor);
chan->monitor = NULL;
+
+ manager_event(EVENT_FLAG_CALL, "MonitorStop",
+ "Channel: %s\r\n"
+ "Uniqueid: %s\r\n",
+ chan->name,
+ chan->uniqueid
+ );
}
UNLOCK_IF_NEEDED(chan, need_lock);