summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2009-02-13 20:35:26 +0000
committerMark Michelson <mmichelson@digium.com>2009-02-13 20:35:26 +0000
commitb5bde28d9f95086930d1a218cd26079fb17c54f8 (patch)
tree940c1a1942f1e3b7266a46952d9b5ecf66e0c942 /apps
parent2800100cf718ee5794225be170f3c9cd18bf2d6d (diff)
Add manager events for chanspy starting or stopping
(closes issue #14469) Reported by: caio1982 Patches: chanspy_events2.diff uploaded by caio1982 (license 22) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 15a732c2b..9d087c4d1 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -46,6 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/say.h"
#include "asterisk/pbx.h"
#include "asterisk/translate.h"
+#include "asterisk/manager.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/options.h"
@@ -456,8 +457,9 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
}
ast_mutex_unlock(&spyee_chanspy_ds->lock);
- if (!spyee)
+ if (!spyee) {
return 0;
+ }
/* We now hold the channel lock on spyee */
@@ -467,7 +469,12 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
}
name = ast_strdupa(spyee->name);
+
ast_verb(2, "Spying on channel %s\n", name);
+ manager_event(EVENT_FLAG_CALL, "ChanSpyStart",
+ "SpyerChannel: %s\r\n"
+ "SpyeeChannel: %s\r\n",
+ spyer_name, name);
memset(&csth, 0, sizeof(csth));
@@ -627,6 +634,7 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
ast_audiohook_destroy(&csth.spy_audiohook);
ast_verb(2, "Done Spying on channel %s\n", name);
+ manager_event(EVENT_FLAG_CALL, "ChanSpyStop", "SpyeeChannel: %s\r\n", name);
return running;
}