Skip to content
Snippets Groups Projects
Commit b5bde28d authored by Mark Michelson's avatar Mark Michelson
Browse files

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
parent 2800100c
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") ...@@ -46,6 +46,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/say.h" #include "asterisk/say.h"
#include "asterisk/pbx.h" #include "asterisk/pbx.h"
#include "asterisk/translate.h" #include "asterisk/translate.h"
#include "asterisk/manager.h"
#include "asterisk/module.h" #include "asterisk/module.h"
#include "asterisk/lock.h" #include "asterisk/lock.h"
#include "asterisk/options.h" #include "asterisk/options.h"
...@@ -456,8 +457,9 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp ...@@ -456,8 +457,9 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
} }
ast_mutex_unlock(&spyee_chanspy_ds->lock); ast_mutex_unlock(&spyee_chanspy_ds->lock);
if (!spyee) if (!spyee) {
return 0; return 0;
}
/* We now hold the channel lock on spyee */ /* 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 ...@@ -467,7 +469,12 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
} }
name = ast_strdupa(spyee->name); name = ast_strdupa(spyee->name);
ast_verb(2, "Spying on channel %s\n", 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)); memset(&csth, 0, sizeof(csth));
...@@ -627,6 +634,7 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp ...@@ -627,6 +634,7 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
ast_audiohook_destroy(&csth.spy_audiohook); ast_audiohook_destroy(&csth.spy_audiohook);
ast_verb(2, "Done Spying on channel %s\n", name); ast_verb(2, "Done Spying on channel %s\n", name);
manager_event(EVENT_FLAG_CALL, "ChanSpyStop", "SpyeeChannel: %s\r\n", name);
return running; return running;
} }
......
...@@ -337,6 +337,21 @@ Changes to manager version 1.1: ...@@ -337,6 +337,21 @@ Changes to manager version 1.1:
If an actionID was specified for the SipShowRegistry action, it will be appended as the If an actionID was specified for the SipShowRegistry action, it will be appended as the
last line of the RegistrationsComplete event. last line of the RegistrationsComplete event.
- Event: ChanSpyStart
Modules: app_chanspy
Purpose: Reports when an active channel starts to be monitored by someone.
Example:
Event: ChanSpyStart
SpyerChannel: SIP/4321-13bba124
SpyeeChannel: SIP/1234-56ecc098
- Event: ChanSpyStop
Modules: app_chanspy
Purpose: Reports when an active channel stops to be monitored by someone.
Example:
Event: ChanSpyStop
SpyeeChannel: SIP/1234-56ecc098
* TODO * TODO
------ ------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment