diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-01 21:21:26 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-01 21:21:26 +0000 |
commit | 1767cce49722f08de9f1496e88b4a1094dd71e6d (patch) | |
tree | d956bdad3e50569a994267af21ba0d7df58b8773 /res/res_musiconhold.c | |
parent | 570198189a42633755fb1013a182419542d9b07a (diff) |
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
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r-- | res/res_musiconhold.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index a23c8c47b..ce1643b5e 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -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) |