dect
/
asterisk
Archived
13
0
Fork 0

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)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127169 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
tilghman 2008-07-01 21:21:26 +00:00
parent 570198189a
commit 1767cce497
1 changed files with 13 additions and 0 deletions

View File

@ -64,6 +64,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#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 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
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 @@ static void local_ast_moh_stop(struct ast_channel *chan)
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)