Add some additional documentation for core AMI events
authorMatthew Jordan <mjordan@digium.com>
Tue, 10 Jul 2012 22:26:27 +0000 (22:26 +0000)
committerMatthew Jordan <mjordan@digium.com>
Tue, 10 Jul 2012 22:26:27 +0000 (22:26 +0000)
This patch adds some basic documentation for a number of modules.  This
includes core source files in Asterisk (those in main), as well as
chan_agent, chan_dahdi, chan_local, sig_analog, and sig_pri.  The DTD
has also been updated to allow referencing of AMI commands.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369905 65c4cc65-6c06-0410-ace0-fbb531ad65f3

14 files changed:
channels/chan_agent.c
channels/chan_dahdi.c
channels/chan_local.c
channels/sig_analog.c
channels/sig_pri.c
doc/appdocsxml.dtd
main/asterisk.c
main/cdr.c
main/channel.c
main/features.c
main/loader.c
main/logger.c
main/manager.c
main/pbx.c

index 2468b09..888f068 100644 (file)
@@ -2133,6 +2133,20 @@ static int login_exec(struct ast_channel *chan, const char *data)
                                                        !ast_strlen_zero(p->moh) ? strlen(p->moh) + 1 : 0);
                                                if (p->loginstart == 0)
                                                        time(&p->loginstart);
+                                               /*** DOCUMENTATION
+                                                       <managerEventInstance>
+                                                               <synopsis>Raised when an Agent has logged in.</synopsis>
+                                                               <syntax>
+                                                                       <parameter name="Agent">
+                                                                               <para>The name of the agent.</para>
+                                                                       </parameter>
+                                                               </syntax>
+                                                               <see-also>
+                                                                       <ref type="application">AgentLogin</ref>
+                                                                       <ref type="managerEvent">Agentlogoff</ref>
+                                                               </see-also>
+                                                       </managerEventInstance>
+                                               ***/
                                                manager_event(EVENT_FLAG_AGENT, "Agentlogin",
                                                              "Agent: %s\r\n"
                                                              "Channel: %s\r\n"
@@ -2225,6 +2239,17 @@ static int login_exec(struct ast_channel *chan, const char *data)
                                                logintime = time(NULL) - p->loginstart;
                                                p->loginstart = 0;
                                                ast_mutex_unlock(&p->lock);
+                                               /*** DOCUMENTATION
+                                                       <managerEventInstance>
+                                                               <synopsis>Raised when an Agent has logged off.</synopsis>
+                                                               <syntax>
+                                                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='Agentlogin']/managerEventInstance/syntax/parameter[@name='Agent'])" />
+                                                               </syntax>
+                                                               <see-also>
+                                                                       <ref type="managerEvent">Agentlogin</ref>
+                                                               </see-also>
+                                                       </managerEventInstance>
+                                               ***/
                                                manager_event(EVENT_FLAG_AGENT, "Agentlogoff",
                                                              "Agent: %s\r\n"
                                                              "Logintime: %ld\r\n"
index 59841d1..b15caa5 100644 (file)
@@ -2175,6 +2175,11 @@ static void dahdi_ami_channel_event(struct dahdi_pvt *p, struct ast_channel *cha
                /* Real channel */
                snprintf(ch_name, sizeof(ch_name), "%d", p->channel);
        }
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a DAHDI channel is created or an underlying technology is associated with a DAHDI channel.</synopsis>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "DAHDIChannel",
                "Channel: %s\r\n"
                "Uniqueid: %s\r\n"
@@ -3866,10 +3871,20 @@ static void handle_clear_alarms(struct dahdi_pvt *p)
 
        if (report_alarms & REPORT_CHANNEL_ALARMS) {
                ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", p->channel);
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when an alarm is cleared on a DAHDI channel.</synopsis>
+                       </managerEventInstance>
+               ***/
                manager_event(EVENT_FLAG_SYSTEM, "AlarmClear", "Channel: %d\r\n", p->channel);
        }
        if (report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
                ast_log(LOG_NOTICE, "Alarm cleared on span %d\n", p->span);
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when an alarm is cleared on a DAHDI span.</synopsis>
+                       </managerEventInstance>
+               ***/
                manager_event(EVENT_FLAG_SYSTEM, "SpanAlarmClear", "Span: %d\r\n", p->span);
        }
 }
@@ -7972,6 +7987,11 @@ static void handle_alarms(struct dahdi_pvt *p, int alms)
        alarm_str = alarm2str(alms);
        if (report_alarms & REPORT_CHANNEL_ALARMS) {
                ast_log(LOG_WARNING, "Detected alarm on channel %d: %s\n", p->channel, alarm_str);
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when an alarm is set on a DAHDI channel.</synopsis>
+                       </managerEventInstance>
+               ***/
                manager_event(EVENT_FLAG_SYSTEM, "Alarm",
                                          "Alarm: %s\r\n"
                                          "Channel: %d\r\n",
@@ -7980,6 +8000,11 @@ static void handle_alarms(struct dahdi_pvt *p, int alms)
 
        if (report_alarms & REPORT_SPAN_ALARMS && p->manages_span_alarms) {
                ast_log(LOG_WARNING, "Detected alarm on span %d: %s\n", p->span, alarm_str);
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when an alarm is set on a DAHDI span.</synopsis>
+                       </managerEventInstance>
+               ***/
                manager_event(EVENT_FLAG_SYSTEM, "SpanAlarm",
                                          "Alarm: %s\r\n"
                                          "Span: %d\r\n",
@@ -10027,6 +10052,19 @@ static int dahdi_dnd(struct dahdi_pvt *dahdichan, int flag)
        ast_verb(3, "%s DND on channel %d\n",
                        flag? "Enabled" : "Disabled",
                        dahdichan->channel);
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when the Do Not Disturb state is changed on a DAHDI channel.</synopsis>
+                       <syntax>
+                               <parameter name="Status">
+                                       <enumlist>
+                                               <enum name="enabled"/>
+                                               <enum name="disabled"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_SYSTEM, "DNDState",
                        "Channel: DAHDI/%d\r\n"
                        "Status: %s\r\n", dahdichan->channel,
index 5e72a61..20e46c9 100644 (file)
@@ -955,6 +955,31 @@ static int local_call(struct ast_channel *ast, const char *dest, int timeout)
                goto return_cleanup;
        }
 
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when two halves of a Local Channel form a bridge.</synopsis>
+                       <syntax>
+                               <parameter name="Channel1">
+                                       <para>The name of the Local Channel half that bridges to another channel.</para>
+                               </parameter>
+                               <parameter name="Channel2">
+                                       <para>The name of the Local Channel half that executes the dialplan.</para>
+                               </parameter>
+                               <parameter name="Context">
+                                       <para>The context in the dialplan that Channel2 starts in.</para>
+                               </parameter>
+                               <parameter name="Exten">
+                                       <para>The extension in the dialplan that Channel2 starts in.</para>
+                               </parameter>
+                               <parameter name="LocalOptimization">
+                                       <enumlist>
+                                               <enum name="Yes"/>
+                                               <enum name="No"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_CALL, "LocalBridge",
                      "Channel1: %s\r\n"
                      "Channel2: %s\r\n"
index cf51e97..e84bbc6 100644 (file)
@@ -3138,6 +3138,11 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
        case ANALOG_EVENT_NOALARM:
                analog_set_alarm(p, 0);
                ast_log(LOG_NOTICE, "Alarm cleared on channel %d\n", p->channel);
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when an Alarm is cleared on an Analog channel.</synopsis>
+                       </managerEventInstance>
+               ***/
                manager_event(EVENT_FLAG_SYSTEM, "AlarmClear",
                        "Channel: %d\r\n", p->channel);
                break;
@@ -4013,6 +4018,19 @@ int analog_dnd(struct analog_pvt *p, int flag)
        ast_verb(3, "%s DND on channel %d\n",
                        flag ? "Enabled" : "Disabled",
                        p->channel);
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when the Do Not Disturb state is changed on an Analog channel.</synopsis>
+                       <syntax>
+                               <parameter name="Status">
+                                       <enumlist>
+                                               <enum name="enabled"/>
+                                               <enum name="disabled"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_SYSTEM, "DNDState",
                        "Channel: DAHDI/%d\r\n"
                        "Status: %s\r\n", p->channel,
index 31438a9..2489990 100644 (file)
@@ -5153,6 +5153,19 @@ static void sig_pri_moh_fsm_event(struct ast_channel *chan, struct sig_pri_chan
  */
 static void sig_pri_ami_hold_event(struct ast_channel *chan, int is_held)
 {
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a PRI channel is put on Hold.</synopsis>
+                       <syntax>
+                               <parameter name="Status">
+                                       <enumlist>
+                                               <enum name="On"/>
+                                               <enum name="Off"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "Hold",
                "Status: %s\r\n"
                "Channel: %s\r\n"
index 59f91c3..d581564 100644 (file)
@@ -39,7 +39,7 @@
   <!ELEMENT see-also (ref|xi:include)*>
 
   <!ELEMENT ref (#PCDATA)>
-  <!ATTLIST ref type (application|function|astcli|link|manpage|filename|agi|managerEvent) #REQUIRED>
+  <!ATTLIST ref type (application|function|astcli|link|manpage|filename|agi|manager|managerEvent) #REQUIRED>
 
   <!ELEMENT synopsis (#PCDATA)>
 
index d55f46a..0a801c1 100644 (file)
@@ -1779,6 +1779,25 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart)
        /* Called on exit */
        ast_verb(0, "Asterisk %s ending (%d).\n", ast_active_channels() ? "uncleanly" : "cleanly", num);
        ast_debug(1, "Asterisk ending (%d).\n", num);
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when Asterisk is shutdown or restarted.</synopsis>
+                       <syntax>
+                               <parameter name="Shutdown">
+                                       <enumlist>
+                                               <enum name="Uncleanly"/>
+                                               <enum name="Cleanly"/>
+                                       </enumlist>
+                               </parameter>
+                               <parameter name="Restart">
+                                       <enumlist>
+                                               <enum name="True"/>
+                                               <enum name="False"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_SYSTEM, "Shutdown", "Shutdown: %s\r\nRestart: %s\r\n", ast_active_channels() ? "Uncleanly" : "Cleanly", restart ? "True" : "False");
        if (ast_socket > -1) {
                pthread_cancel(lthread);
@@ -4105,6 +4124,11 @@ int main(int argc, char *argv[])
        }
 
        ast_set_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED);
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when all Asterisk initialization procedures have finished.</synopsis>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_SYSTEM, "FullyBooted", "Status: Fully Booted\r\n");
 
        ast_process_pending_reloads();
index 7847dc4..295108d 100644 (file)
@@ -1039,7 +1039,11 @@ int ast_cdr_setaccount(struct ast_channel *chan, const char *account)
                        ast_copy_string(cdr->accountcode, ast_channel_accountcode(chan), sizeof(cdr->accountcode));
                }
        }
-
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a CDR's AccountCode is changed.</synopsis>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "NewAccountCode",
                        "Channel: %s\r\n"
                        "Uniqueid: %s\r\n"
@@ -1065,7 +1069,11 @@ int ast_cdr_setpeeraccount(struct ast_channel *chan, const char *account)
                        ast_copy_string(cdr->peeraccount, ast_channel_peeraccount(chan), sizeof(cdr->peeraccount));
                }
        }
-
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a CDR's PeerAccount is changed.</synopsis>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "NewPeerAccount",
                        "Channel: %s\r\n"
                        "Uniqueid: %s\r\n"
index 0f4c3bc..6b1f306 100644 (file)
@@ -1125,6 +1125,15 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char
         * a lot of data into this func to do it here!
         */
        if (ast_get_channel_tech(tech) || (tech2 && ast_get_channel_tech(tech2))) {
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when a new channel is created.</synopsis>
+                               <syntax>
+                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='Newstate']/managerEventInstance/syntax/parameter[@name='ChannelState'])" />
+                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='Newstate']/managerEventInstance/syntax/parameter[@name='ChannelStateDesc'])" />
+                               </syntax>
+                       </managerEventInstance>
+               ***/
                ast_manager_event(tmp, EVENT_FLAG_CALL, "Newchannel",
                        "Channel: %s\r\n"
                        "ChannelState: %d\r\n"
@@ -1329,7 +1338,11 @@ int ast_queue_hangup(struct ast_channel *chan)
        /* Yeah, let's not change a lock-critical value without locking */
        ast_channel_lock(chan);
        ast_channel_softhangup_internal_flag_add(chan, AST_SOFTHANGUP_DEV);
-
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a hangup is requested with no set cause.</synopsis>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_CALL, "HangupRequest",
                "Channel: %s\r\n"
                "Uniqueid: %s\r\n",
@@ -1357,7 +1370,14 @@ int ast_queue_hangup_with_cause(struct ast_channel *chan, int cause)
        if (cause < 0) {
                f.data.uint32 = ast_channel_hangupcause(chan);
        }
-
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a hangup is requested with a specific cause code.</synopsis>
+                               <syntax>
+                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='Hangup']/managerEventInstance/syntax/parameter[@name='Cause'])" />
+                               </syntax>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_CALL, "HangupRequest",
                "Channel: %s\r\n"
                "Uniqueid: %s\r\n"
@@ -2545,6 +2565,14 @@ int ast_softhangup(struct ast_channel *chan, int cause)
 
        ast_channel_lock(chan);
        res = ast_softhangup_nolock(chan, cause);
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a soft hangup is requested with a specific cause code.</synopsis>
+                               <syntax>
+                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='Hangup']/managerEventInstance/syntax/parameter[@name='Cause'])" />
+                               </syntax>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_CALL, "SoftHangupRequest",
                "Channel: %s\r\n"
                "Uniqueid: %s\r\n"
@@ -2707,6 +2735,19 @@ int ast_hangup(struct ast_channel *chan)
        ast_channel_unlock(chan);
 
        ast_cc_offer(chan);
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a channel is hung up.</synopsis>
+                               <syntax>
+                                       <parameter name="Cause">
+                                               <para>A numeric cause code for why the channel was hung up.</para>
+                                       </parameter>
+                                       <parameter name="Cause-txt">
+                                               <para>A description of why the channel was hung up.</para>
+                                       </parameter>
+                               </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "Hangup",
                "Channel: %s\r\n"
                "Uniqueid: %s\r\n"
@@ -3522,6 +3563,31 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
 
 static void send_dtmf_event(struct ast_channel *chan, const char *direction, const char digit, const char *begin, const char *end)
 {
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a DTMF digit has started or ended on a channel.</synopsis>
+                               <syntax>
+                                       <parameter name="Direction">
+                                               <enumlist>
+                                                       <enum name="Received"/>
+                                                       <enum name="Sent"/>
+                                               </enumlist>
+                                       </parameter>
+                                       <parameter name="Begin">
+                                               <enumlist>
+                                                       <enum name="Yes"/>
+                                                       <enum name="No"/>
+                                               </enumlist>
+                                       </parameter>
+                                       <parameter name="End">
+                                               <enumlist>
+                                                       <enum name="Yes"/>
+                                                       <enum name="No"/>
+                                               </enumlist>
+                                       </parameter>
+                               </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_DTMF,
                        "DTMF",
                        "Channel: %s\r\n"
@@ -6224,6 +6290,11 @@ int ast_channel_transfer_masquerade(
  */
 static void __ast_change_name_nolink(struct ast_channel *chan, const char *newname)
 {
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when the name of a channel is changed.</synopsis>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", ast_channel_name(chan), newname, ast_channel_uniqueid(chan));
        ast_channel_name_set(chan, newname);
 }
@@ -6471,6 +6542,16 @@ static void report_new_callerid(struct ast_channel *chan)
        int pres;
 
        pres = ast_party_id_presentation(&ast_channel_caller(chan)->id);
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a channel receives new Caller ID information.</synopsis>
+                       <syntax>
+                               <parameter name="CID-CallingPres">
+                                       <para>A description of the Caller ID presentation.</para>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "NewCallerid",
                "Channel: %s\r\n"
                "CallerIDNum: %s\r\n"
@@ -6665,6 +6746,25 @@ int ast_do_masquerade(struct ast_channel *original)
 
        chans[0] = clonechan;
        chans[1] = original;
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a masquerade occurs between two channels, wherein the Clone channel's internal information replaces the Original channel's information.</synopsis>
+                       <syntax>
+                               <parameter name="Clone">
+                                       <para>The name of the channel whose information will be going into the Original channel.</para>
+                               </parameter>
+                               <parameter name="CloneState">
+                                       <para>The current state of the clone channel.</para>
+                               </parameter>
+                               <parameter name="Original">
+                                       <para>The name of the channel whose information will be replaced by the Clone channel's information.</para>
+                               </parameter>
+                               <parameter name="OriginalState">
+                                       <para>The current state of the original channel.</para>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event_multichan(EVENT_FLAG_CALL, "Masquerade", 2, chans,
                "Clone: %s\r\n"
                "CloneState: %s\r\n"
@@ -7058,6 +7158,31 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state state)
        ast_devstate_changed_literal(AST_DEVICE_UNKNOWN, name);
 
        /* setstate used to conditionally report Newchannel; this is no more */
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a channel's state changes.</synopsis>
+                       <syntax>
+                               <parameter name="ChannelState">
+                                       <para>A numeric code for the channel's current state, related to ChannelStateDesc</para>
+                               </parameter>
+                               <parameter name="ChannelStateDesc">
+                                       <enumlist>
+                                               <enum name="Down"/>
+                                               <enum name="Rsrvd"/>
+                                               <enum name="OffHook"/>
+                                               <enum name="Dialing"/>
+                                               <enum name="Ring"/>
+                                               <enum name="Ringing"/>
+                                               <enum name="Up"/>
+                                               <enum name="Busy"/>
+                                               <enum name="Dialing Offhook"/>
+                                               <enum name="Pre-ring"/>
+                                               <enum name="Unknown"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "Newstate",
                "Channel: %s\r\n"
                "ChannelState: %d\r\n"
@@ -7353,6 +7478,25 @@ int ast_channel_early_bridge(struct ast_channel *c0, struct ast_channel *c1)
 static void manager_bridge_event(int onoff, int type, struct ast_channel *c0, struct ast_channel *c1)
 {
        struct ast_channel *chans[2] = { c0, c1 };
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a bridge changes between two channels.</synopsis>
+                       <syntax>
+                               <parameter name="Bridgestate">
+                                       <enumlist>
+                                               <enum name="Link"/>
+                                               <enum name="Unlink"/>
+                                       </enumlist>
+                               </parameter>
+                               <parameter name="Bridgetype">
+                                       <enumlist>
+                                               <enum name="core"/>
+                                               <enum name="native"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event_multichan(EVENT_FLAG_CALL, "Bridge", 2, chans,
                "Bridgestate: %s\r\n"
                "Bridgetype: %s\r\n"
index b602dbb..420cdaf 100644 (file)
@@ -471,6 +471,42 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
                        <ref type="function">FEATURE</ref>
                </see-also>
        </function>
+       <managerEvent language="en_US" name="ParkedCallTimeOut">
+               <managerEventInstance class="EVENT_FLAG_CALL">
+                       <synopsis>Raised when a parked call times out.</synopsis>
+                       <syntax>
+                               <xi:include xpointer="xpointer(/docs/managerEvent[@name='ParkedCall']/managerEventInstance/syntax/parameter[@name='Exten'])" />
+                               <parameter name="Channel"/>
+                               <xi:include xpointer="xpointer(/docs/managerEvent[@name='ParkedCall']/managerEventInstance/syntax/parameter[@name='Parkinglot'])" />
+                               <parameter name="CallerIDNum"/>
+                               <parameter name="CallerIDName"/>
+                               <parameter name="ConnectedLineNum"/>
+                               <parameter name="ConnectedLineName"/>
+                               <parameter name="UniqueID"/>
+                       </syntax>
+                       <see-also>
+                               <ref type="managerEvent">ParkedCall</ref>
+                       </see-also>
+               </managerEventInstance>
+       </managerEvent>
+       <managerEvent language="en_US" name="ParkedCallGiveUp">
+               <managerEventInstance class="EVENT_FLAG_CALL">
+                       <synopsis>Raised when a parked call hangs up while in the parking lot.</synopsis>
+                       <syntax>
+                               <xi:include xpointer="xpointer(/docs/managerEvent[@name='ParkedCall']/managerEventInstance/syntax/parameter[@name='Exten'])" />
+                               <parameter name="Channel"/>
+                               <xi:include xpointer="xpointer(/docs/managerEvent[@name='ParkedCall']/managerEventInstance/syntax/parameter[@name='Parkinglot'])" />
+                               <parameter name="CallerIDNum"/>
+                               <parameter name="CallerIDName"/>
+                               <parameter name="ConnectedLineNum"/>
+                               <parameter name="ConnectedLineName"/>
+                               <parameter name="UniqueID"/>
+                       </syntax>
+                       <see-also>
+                               <ref type="managerEvent">ParkedCall</ref>
+                       </see-also>
+               </managerEventInstance>
+       </managerEvent>
  ***/
 
 #define DEFAULT_PARK_TIME                                                      45000   /*!< ms */
@@ -1658,7 +1694,28 @@ static int park_call_full(struct ast_channel *chan, struct ast_channel *peer, st
                pu->context, pu->exten, pu->priority, (pu->parkingtime / 1000));
 
        ast_cel_report_event(chan, AST_CEL_PARK_START, NULL, pu->parkinglot->name, peer);
-
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a call has been parked.</synopsis>
+                       <syntax>
+                               <parameter name="Exten">
+                                       <para>The parking lot extension.</para>
+                               </parameter>
+                               <parameter name="Parkinglot">
+                                       <para>The name of the parking lot.</para>
+                               </parameter>
+                               <parameter name="From">
+                                       <para>The name of the channel that parked the call.</para>
+                               </parameter>
+                       </syntax>
+                       <see-also>
+                               <ref type="application">Park</ref>
+                               <ref type="manager">Park</ref>
+                               <ref type="managerEvent">ParkedCallTimeOut</ref>
+                               <ref type="managerEvent">ParkedCallGiveUp</ref>
+                       </see-also>
+               </managerEventInstance>
+       ***/
        ast_manager_event(chan, EVENT_FLAG_CALL, "ParkedCall",
                "Exten: %s\r\n"
                "Channel: %s\r\n"
@@ -5417,6 +5474,20 @@ static int parked_call_exec(struct ast_channel *chan, const char *data)
                }
 
                ast_cel_report_event(pu->chan, AST_CEL_PARK_END, NULL, "UnParkedCall", chan);
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when a call has been unparked.</synopsis>
+                               <syntax>
+                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='ParkedCall']/managerEventInstance/syntax/parameter[@name='Exten'])" />
+                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='ParkedCall']/managerEventInstance/syntax/parameter[@name='Parkinglot'])" />
+                                       <xi:include xpointer="xpointer(/docs/managerEvent[@name='ParkedCall']/managerEventInstance/syntax/parameter[@name='From'])" />
+                               </syntax>
+                               <see-also>
+                                       <ref type="application">ParkedCall</ref>
+                                       <ref type="managerEvent">ParkedCall</ref>
+                               </see-also>
+                       </managerEventInstance>
+               ***/
                ast_manager_event(pu->chan, EVENT_FLAG_CALL, "UnParkedCall",
                        "Exten: %s\r\n"
                        "Channel: %s\r\n"
@@ -7274,7 +7345,22 @@ static int action_bridge(struct mansession *s, const struct message *m)
 
        chans[0] = tmpchana;
        chans[1] = tmpchanb;
-
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a bridge is successfully created due to a manager action.</synopsis>
+                       <syntax>
+                               <parameter name="Response">
+                                       <enumlist>
+                                               <enum name="Success"/>
+                                               <enum name="Failed"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+                       <see-also>
+                               <ref type="manager">Bridge</ref>
+                       </see-also>
+               </managerEventInstance>
+       ***/
        ast_manager_event_multichan(EVENT_FLAG_CALL, "BridgeAction", 2, chans,
                                "Response: Success\r\n"
                                "Channel1: %s\r\n"
@@ -7702,6 +7788,15 @@ int ast_do_pickup(struct ast_channel *chan, struct ast_channel *target)
        }
 
        /* If you want UniqueIDs, set channelvars in manager.conf to CHANNEL(uniqueid) */
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when a call pickup occurs.</synopsis>
+                       <syntax>
+                               <parameter name="Channel"><para>The name of the channel that initiated the pickup.</para></parameter>
+                               <parameter name="TargetChannel"><para>The name of the channel that is being picked up.</para></parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        ast_manager_event_multichan(EVENT_FLAG_CALL, "Pickup", 2, chans,
                "Channel: %s\r\n"
                "TargetChannel: %s\r\n",
@@ -7908,6 +8003,14 @@ static int bridge_exec(struct ast_channel *chan, const char *data)
        /* avoid bridge with ourselves */
        if (!strcmp(ast_channel_name(chan), args.dest_chan)) {
                ast_log(LOG_WARNING, "Unable to bridge channel %s with itself\n", ast_channel_name(chan));
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when an error occurs during bridge creation.</synopsis>
+                               <see-also>
+                                       <ref type="application">Bridge</ref>
+                               </see-also>
+                       </managerEventInstance>
+               ***/
                ast_manager_event(chan, EVENT_FLAG_CALL, "BridgeExec",
                        "Response: Failed\r\n"
                        "Reason: Unable to bridge channel to itself\r\n"
@@ -7999,6 +8102,14 @@ static int bridge_exec(struct ast_channel *chan, const char *data)
        }
 
        /* Report that the bridge will be successfull */
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when the bridge is created successfully.</synopsis>
+                       <see-also>
+                               <ref type="application">Bridge</ref>
+                       </see-also>
+               </managerEventInstance>
+       ***/
        ast_manager_event_multichan(EVENT_FLAG_CALL, "BridgeExec", 2, chans,
                "Response: Success\r\n"
                "Channel1: %s\r\n"
index e9b92bb..b952137 100644 (file)
@@ -1162,6 +1162,19 @@ done:
        /* Tell manager clients that are aggressive at logging in that we're done
           loading modules. If there's a DNS problem in chan_sip, we might not
           even reach this */
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when all dynamic modules have finished their initial loading.</synopsis>
+                       <syntax>
+                               <parameter name="ModuleSelection">
+                                       <enumlist>
+                                               <enum name="Preload"/>
+                                               <enum name="All"/>
+                                       </enumlist>
+                               </parameter>
+                       </syntax>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_SYSTEM, "ModuleLoadReport", "ModuleLoadStatus: Done\r\nModuleSelection: %s\r\nModuleCount: %d\r\n", preload_only ? "Preload" : "All", modulecount);
 
        return res;
index ca26481..6d6227b 100644 (file)
@@ -793,6 +793,16 @@ static int reload_logger(int rotate, const char *altconf)
        AST_RWLIST_TRAVERSE(&logchannels, f, list) {
                if (f->disabled) {
                        f->disabled = 0;        /* Re-enable logging at reload */
+                       /*** DOCUMENTATION
+                               <managerEventInstance>
+                                       <synopsis>Raised when a logging channel is re-enabled after a reload operation.</synopsis>
+                                       <syntax>
+                                               <parameter name="Channel">
+                                                       <para>The name of the logging channel.</para>
+                                               </parameter>
+                                       </syntax>
+                               </managerEventInstance>
+                       ***/
                        manager_event(EVENT_FLAG_SYSTEM, "LogChannel", "Channel: %s\r\nEnabled: Yes\r\n", f->filename);
                }
                if (f->fileptr && (f->fileptr != stdout) && (f->fileptr != stderr)) {
@@ -1089,6 +1099,16 @@ static void logger_print_normal(struct logmsg *logmsg)
                                                fprintf(stderr, "Asterisk logging error: Out of disk space, can't log to log file %s\n", chan->filename);
                                        else
                                                fprintf(stderr, "Logger Warning: Unable to write to log file '%s': %s (disabled)\n", chan->filename, strerror(errno));
+                                       /*** DOCUMENTATION
+                                               <managerEventInstance>
+                                                       <synopsis>Raised when a logging channel is disabled.</synopsis>
+                                                       <syntax>
+                                                               <parameter name="Channel">
+                                                                       <para>The name of the logging channel.</para>
+                                                               </parameter>
+                                                       </syntax>
+                                               </managerEventInstance>
+                                       ***/
                                        manager_event(EVENT_FLAG_SYSTEM, "LogChannel", "Channel: %s\r\nEnabled: No\r\nReason: %d - %s\r\n", chan->filename, errno, strerror(errno));
                                        chan->disabled = 1;
                                } else if (res > 0) {
index 3eb1133..d70ac6d 100644 (file)
@@ -476,7 +476,34 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
                        <replaceable>Extension</replaceable>/<replaceable>Context</replaceable>/<replaceable>Priority</replaceable>
                        or <replaceable>Application</replaceable>/<replaceable>Data</replaceable></para>
                </description>
+               <see-also>
+                       <ref type="managerEvent">OriginateResponse</ref>
+               </see-also>
        </manager>
+       <managerEvent language="en_US" name="OriginateResponse">
+               <managerEventInstance class="EVENT_FLAG_CALL">
+                       <synopsis>Raised in response to an Originate command.</synopsis>
+                       <syntax>
+                               <parameter name="ActionID" required="false"/>
+                               <parameter name="Resonse">
+                                       <enumlist>
+                                               <enum name="Failure"/>
+                                               <enum name="Success"/>
+                                       </enumlist>
+                               </parameter>
+                               <parameter name="Channel"/>
+                               <parameter name="Context"/>
+                               <parameter name="Exten"/>
+                               <parameter name="Reason"/>
+                               <parameter name="Uniqueid"/>
+                               <parameter name="CallerIDNum"/>
+                               <parameter name="CallerIDName"/>
+                       </syntax>
+                       <see-also>
+                               <ref type="manager">Originate</ref>
+                       </see-also>
+               </managerEventInstance>
+       </managerEvent>
        <manager name="Command" language="en_US">
                <synopsis>
                        Execute Asterisk CLI Command.
@@ -5535,7 +5562,11 @@ static int manager_state_cb(char *context, char *exten, struct ast_state_cb_info
        }
 
        ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, context, exten);
-
+       /*** DOCUMENTATION
+               <managerEventInstance>
+                       <synopsis>Raised when an extension state has changed.</synopsis>
+               </managerEventInstance>
+       ***/
        manager_event(EVENT_FLAG_CALL, "ExtensionStatus", "Exten: %s\r\nContext: %s\r\nHint: %s\r\nStatus: %d\r\n", exten, context, hint, state);
        return 0;
 }
index 95f6fda..cbfbafa 100644 (file)
@@ -4414,6 +4414,19 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
                                        term_color(tmp3, passdata, COLOR_BRMAGENTA, 0, sizeof(tmp3)),
                                        "in new stack");
                        }
+                       /*** DOCUMENTATION
+                               <managerEventInstance>
+                                       <synopsis>Raised when a channel enters a new context, extension, priority.</synopsis>
+                                       <syntax>
+                                               <parameter name="Application">
+                                                       <para>The application about to be executed.</para>
+                                               </parameter>
+                                               <parameter name="AppData">
+                                                       <para>The data to be passed to the application.</para>
+                                               </parameter>
+                                       </syntax>
+                               </managerEventInstance>
+                       ***/
                        manager_event(EVENT_FLAG_DIALPLAN, "Newexten",
                                        "Channel: %s\r\n"
                                        "Context: %s\r\n"
@@ -10922,6 +10935,11 @@ int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const
                        ast_verb(2, "Setting global variable '%s' to '%s'\n", name, value);
                newvariable = ast_var_assign(name, value);
                AST_LIST_INSERT_HEAD(headp, newvariable, entries);
+               /*** DOCUMENTATION
+                       <managerEventInstance>
+                               <synopsis>Raised when a variable is set to a particular value.</synopsis>
+                       </managerEventInstance>
+               ***/
                manager_event(EVENT_FLAG_DIALPLAN, "VarSet",
                        "Channel: %s\r\n"
                        "Variable: %s\r\n"