[asterisk-commits] mmichelson: trunk r175655 - in /trunk: apps/app_chanspy.c doc/manager_1_1.txt
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Feb 13 14:35:28 CST 2009
Author: mmichelson
Date: Fri Feb 13 14:35:26 2009
New Revision: 175655
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=175655
Log:
Add manager events for chanspy starting or stopping
(closes issue #14469)
Reported by: caio1982
Patches:
chanspy_events2.diff uploaded by caio1982 (license 22)
Modified:
trunk/apps/app_chanspy.c
trunk/doc/manager_1_1.txt
Modified: trunk/apps/app_chanspy.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=175655&r1=175654&r2=175655
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Fri Feb 13 14:35:26 2009
@@ -46,6 +46,7 @@
#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 @@
}
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 @@
}
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 @@
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;
}
Modified: trunk/doc/manager_1_1.txt
URL: http://svn.digium.com/svn-view/asterisk/trunk/doc/manager_1_1.txt?view=diff&rev=175655&r1=175654&r2=175655
==============================================================================
--- trunk/doc/manager_1_1.txt (original)
+++ trunk/doc/manager_1_1.txt Fri Feb 13 14:35:26 2009
@@ -337,6 +337,21 @@
If an actionID was specified for the SipShowRegistry action, it will be appended as the
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
------
More information about the asterisk-commits
mailing list