[svn-commits] tilghman: trunk r127169 - /trunk/res/res_musiconhold.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Jul 1 16:21:26 CDT 2008
Author: tilghman
Date: Tue Jul 1 16:21:26 2008
New Revision: 127169
URL: http://svn.digium.com/view/asterisk?view=rev&rev=127169
Log:
Add AMI events for start/stop of MOH
(closes issue #12909)
Reported by: chris-mac
Patches:
res_musiconhold-event.patch uploaded by chris-mac (license 506)
Modified:
trunk/res/res_musiconhold.c
Modified: trunk/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=127169&r1=127168&r2=127169
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Tue Jul 1 16:21:26 2008
@@ -64,6 +64,7 @@
#include "asterisk/cli.h"
#include "asterisk/stringfields.h"
#include "asterisk/linkedlists.h"
+#include "asterisk/manager.h"
#define INITIAL_NUM_FILES 8
@@ -1292,6 +1293,12 @@
if (!mohclass)
return -1;
+ manager_event(EVENT_FLAG_CALL, "MusicOnHold",
+ "State: Start\r\n"
+ "Channel: %s\r\n"
+ "UniqueID: %s\r\n",
+ chan->name, chan->uniqueid);
+
ast_set_flag(chan, AST_FLAG_MOH);
if (mohclass->total_files) {
return ast_activate_generator(chan, &moh_file_stream, mohclass);
@@ -1311,6 +1318,12 @@
chan->stream = NULL;
}
}
+
+ manager_event(EVENT_FLAG_CALL, "MusicOnHold",
+ "State: Stop\r\n"
+ "Channel: %s\r\n"
+ "UniqueID: %s\r\n",
+ chan->name, chan->uniqueid);
}
static int load_moh_classes(int reload)
More information about the svn-commits
mailing list