summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-06-25 17:59:34 +0000
committerMatthew Jordan <mjordan@digium.com>2012-06-25 17:59:34 +0000
commit82a7409c15cf943ebc12cc8453424350628732bf (patch)
treefd06e7c2248dae47e019c76bef0b4865c284e00d /apps/app_voicemail.c
parentd0fda07d74b0e73ea563e3b90361faf5f20965e3 (diff)
Add AMI event documentation
This patch adds the core changes necessary to support AMI event documentation in the source files of Asterisk, and adds documentation to those AMI events defined in the core application modules. Event documentation is built from the source by two new python scripts, located in build_tools: get_documentation.py and post_process_documentation.py. The get_documentation.py script mirrors the actions of the existing AWK get_documentation scripts, except that it will scan the entirety of a source file for Asterisk documentation. Upon encountering it, if the documentation happens to be an AMI event, it will attempt to extract information about the event directly from the manager event macro calls that raise the event. The post_process_documentation.py script combines manager event instances that are the same event but documented in multiple source files. It generates the final core-[lang].xml file. As this process can take longer to complete than a typical 'make all', it is only performed if a new make target, 'full', is chosen. Review: https://reviewboard.asterisk.org/r/1967/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r--apps/app_voicemail.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 1a9f73810..c9d2f7199 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -7753,7 +7753,30 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
queue_mwi_event(ext_context, urgentmsgs, newmsgs, oldmsgs);
- ast_manager_event(chan, EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\nNew: %d\r\nOld: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when a new message has been left in a voicemail mailbox.</synopsis>
+ <syntax>
+ <parameter name="Mailbox">
+ <para>The mailbox with the new message, specified as <emphasis>mailbox</emphasis>@<emphasis>context</emphasis></para>
+ </parameter>
+ <parameter name="Waiting">
+ <para>Whether or not the mailbox has access to a voicemail application.</para>
+ </parameter>
+ <parameter name="New">
+ <para>The number of new messages.</para>
+ </parameter>
+ <parameter name="Old">
+ <para>The number of old messages.</para>
+ </parameter>
+ </syntax>
+ </managerEventInstance>
+ ***/
+ ast_manager_event(chan, EVENT_FLAG_CALL, "MessageWaiting",
+ "Mailbox: %s@%s\r\n"
+ "Waiting: %d\r\n"
+ "New: %d\r\n"
+ "Old: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs);
run_externnotify(vmu->context, vmu->mailbox, flag);
#ifdef IMAP_STORAGE
@@ -11396,6 +11419,11 @@ out:
if (valid) {
int new = 0, old = 0, urgent = 0;
snprintf(ext_context, sizeof(ext_context), "%s@%s", vms.username, vmu->context);
+ /*** DOCUMENTATION
+ <managerEventInstance>
+ <synopsis>Raised when a user has finished listening to their messages.</synopsis>
+ </managerEventInstance>
+ ***/
ast_manager_event(chan, EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s\r\nWaiting: %d\r\n", ext_context, has_voicemail(ext_context, NULL));
/* Urgent flag not passwd to externnotify here */
run_externnotify(vmu->context, vmu->mailbox, NULL);