[asterisk-commits] eliel: branch eliel/manager-xmldoc r195999 - in /team/eliel/manager-xmldoc: c...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 21 14:14:03 CDT 2009


Author: eliel
Date: Thu May 21 14:13:59 2009
New Revision: 195999

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195999
Log:
New manager xml documentation.
Moved old static documentation to the new xml docs.


Modified:
    team/eliel/manager-xmldoc/channels/chan_agent.c
    team/eliel/manager-xmldoc/channels/chan_iax2.c
    team/eliel/manager-xmldoc/channels/chan_sip.c
    team/eliel/manager-xmldoc/channels/chan_skinny.c
    team/eliel/manager-xmldoc/doc/appdocsxml.dtd
    team/eliel/manager-xmldoc/include/asterisk/manager.h
    team/eliel/manager-xmldoc/include/asterisk/pbx.h
    team/eliel/manager-xmldoc/include/asterisk/xmldoc.h
    team/eliel/manager-xmldoc/main/features.c
    team/eliel/manager-xmldoc/main/manager.c
    team/eliel/manager-xmldoc/main/pbx.c
    team/eliel/manager-xmldoc/main/xmldoc.c
    team/eliel/manager-xmldoc/res/res_agi.c

Modified: team/eliel/manager-xmldoc/channels/chan_agent.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/channels/chan_agent.c?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/channels/chan_agent.c (original)
+++ team/eliel/manager-xmldoc/channels/chan_agent.c Thu May 21 14:13:59 2009
@@ -167,6 +167,34 @@
 		</syntax>
 		<description />
 	</function>
+	<manager name="Agents" language="en_US">
+		<synopsis>
+			Lists agents and their status.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Will list info about all possible agents.</para>
+		</description>
+	</manager>
+	<manager name="AgentLogoff" language="en_US">
+		<synopsis>
+			Sets an agent as no longer logged in.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Agent" required="true">
+				<para>Agent ID of the agent to log off.</para>
+			</parameter>
+			<parameter name="Soft">
+				<para>Set to <literal>true</literal> to not hangup existing calls.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Sets an agent as no longer logged in.</para>
+		</description>
+	</manager>
  ***/
 
 static const char tdesc[] = "Call Agent Proxy Channel";
@@ -174,16 +202,6 @@
 
 static const char app[] = "AgentLogin";
 static const char app3[] = "AgentMonitorOutgoing";
-
-static const char mandescr_agents[] =
-"Description: Will list info about all possible agents.\n"
-"Variables: NONE\n";
-
-static const char mandescr_agent_logoff[] =
-"Description: Sets an agent as no longer logged in.\n"
-"Variables: (Names marked with * are required)\n"
-"	*Agent: Agent ID of the agent to log off\n"
-"	Soft: Set to 'true' to not hangup existing calls\n";
 
 static char moh[80] = "default";
 
@@ -2559,8 +2577,8 @@
 	ast_register_application_xml(app3, agentmonitoroutgoing_exec);
 
 	/* Manager commands */
-	ast_manager_register2("Agents", EVENT_FLAG_AGENT, action_agents, "Lists agents and their status", mandescr_agents);
-	ast_manager_register2("AgentLogoff", EVENT_FLAG_AGENT, action_agent_logoff, "Sets an agent as no longer logged in", mandescr_agent_logoff);
+	ast_manager_register_xml("Agents", EVENT_FLAG_AGENT, action_agents);
+	ast_manager_register_xml("AgentLogoff", EVENT_FLAG_AGENT, action_agent_logoff);
 
 	/* CLI Commands */
 	ast_cli_register_multiple(cli_agents, ARRAY_LEN(cli_agents));

Modified: team/eliel/manager-xmldoc/channels/chan_iax2.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/channels/chan_iax2.c?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/channels/chan_iax2.c (original)
+++ team/eliel/manager-xmldoc/channels/chan_iax2.c Thu May 21 14:13:59 2009
@@ -175,6 +175,47 @@
 		</syntax>
 		<description />
 	</function>
+	<manager name="IAXpeers" language="en_US">
+		<synopsis>
+			List IAX peers.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="IAXpeerlist" language="en_US">
+		<synopsis>
+			List IAX Peers.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>List all the IAX peers.</para>
+		</description>
+	</manager>
+	<manager name="IAXnetstats" language="en_US">
+		<synopsis>
+			Show IAX Netstats.
+		</synopsis>
+		<syntax />
+		<description>
+			<para>Show IAX channels network statistics.</para>
+		</description>
+	</manager>
+	<manager name="IAXregistry" language="en_US">
+		<synopsis>
+			Show IAX registrations.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Show IAX registrations.</para>
+		</description>
+	</manager>
  ***/
 
 /* Define SCHED_MULTITHREADED to run the scheduler in a special
@@ -12720,10 +12761,10 @@
 
 	ast_register_application_xml(papp, iax2_prov_app);
 	
-	ast_manager_register( "IAXpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peers, "List IAX Peers" );
-	ast_manager_register( "IAXpeerlist", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peer_list, "List IAX Peers" );
-	ast_manager_register( "IAXnetstats", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_netstats, "Show IAX Netstats" );
-	ast_manager_register( "IAXregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_registry, "Show IAX registrations");
+	ast_manager_register_xml("IAXpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peers);
+	ast_manager_register_xml("IAXpeerlist", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_peer_list);
+	ast_manager_register_xml("IAXnetstats", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_netstats);
+	ast_manager_register_xml("IAXregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_iax2_show_registry);
 
 	if ((timer = ast_timer_open())) {
 		ast_timer_set_rate(timer, trunkfreq);

Modified: team/eliel/manager-xmldoc/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/channels/chan_sip.c?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/channels/chan_sip.c (original)
+++ team/eliel/manager-xmldoc/channels/chan_sip.c Thu May 21 14:13:59 2009
@@ -473,6 +473,79 @@
 			Check the <literal>domain=</literal> configuration in <filename>sip.conf</filename>.</para>
 		</description>
 	</function>
+	<manager name="SIPpeers" language="en_US">
+		<synopsis>
+			List SIP peers (text format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Lists SIP peers in text format with details on current status.
+			Peerlist will follow as separate events, followed by a final event called
+			PeerlistComplete.</para>
+		</description>
+	</manager>
+	<manager name="SIPshowpeer" language="en_US">
+		<synopsis>
+			show SIP peer (text format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Peer" required="true">
+				<para>The peer name you want to check.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Show one SIP peer with details on current status.</para>
+		</description>
+	</manager>
+	<manager name="SIPqualifypeer" language="en_US">
+		<synopsis>
+			Qualify SIP peers.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Peer" required="true">
+				<para>The peer name you want to qualify.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Qualify a SIP peer.</para>
+		</description>
+	</manager>
+	<manager name="SIPshowregistry" language="en_US">
+		<synopsis>
+			Show SIP registrations (text format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Lists all registration requests and status. Registrations will follow as separate
+			events. followed by a final event called RegistrationsComplete.</para>
+		</description>
+	</manager>
+	<manager name="SIPnotify" language="en_US">
+		<synopsis>
+			Send a SIP notify.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>Peer to receive the notify.</para>
+			</parameter>
+			<parameter name="Variable" required="true">
+				<para>At least one variable pair must be specified.
+				<replaceable>name</replaceable>=<replaceable>value</replaceable></para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Sends a SIP Notify event.</para>
+			<para>All parameters for this event must be specified in the body of this request
+			via multiple Variable: name=value sequences.</para>
+		</description>
+	</manager>
  ***/
 
 #ifndef FALSE
@@ -10859,15 +10932,6 @@
 	return 0;
 }
 
-static char mandescr_sipnotify[] =
-"Description: Sends a SIP Notify event\n"
-"All parameters for this event must be specified in the body of this request\n"
-"via multiple Variable: name=value sequences.\n"
-"Variables: \n"
-"  *Channel: <peername>       Peer to receive the notify. Required.\n"
-"  *Variable: <name>=<value>  At least one variable pair must be specified.\n"
-"  ActionID: <id>             Action ID for this transaction. Will be returned.\n";
-
 /*! \brief Send a provisional response indicating that a call was redirected
  */
 static void update_redirecting(struct sip_pvt *p, const void *data, size_t datalen)
@@ -14165,14 +14229,6 @@
 #undef FORMAT
 }
 
-/*! \brief Manager Action SIPShowRegistry description */
-static char mandescr_show_registry[] =
-"Description: Lists all registration requests and status\n"
-"Registrations will follow as separate events. followed by a final event called\n"
-"RegistrationsComplete.\n"
-"Variables: \n"
-"  ActionID: <id>       Action ID for this transaction. Will be returned.\n";
-
 /*! \brief Show SIP registrations in the manager API */
 static int manager_show_registry(struct mansession *s, const struct message *m)
 {
@@ -14210,13 +14266,6 @@
 	
 	return 0;
 }
-
-static char mandescr_show_peers[] = 
-"Description: Lists SIP peers in text format with details on current status.\n"
-"Peerlist will follow as separate events, followed by a final event called\n"
-"PeerlistComplete.\n"
-"Variables: \n"
-"  ActionID: <id>	Action ID for this transaction. Will be returned.\n";
 
 /*! \brief  Show SIP peers in the manager API */
 /*    Inspired from chan_iax2 */
@@ -14835,12 +14884,6 @@
 	}
 }
 #undef FORMAT
-
-static char mandescr_show_peer[] = 
-"Description: Show one SIP peer with details on current status.\n"
-"Variables: \n"
-"  Peer: <name>           The peer name you want to check.\n"
-"  ActionID: <id>	  Optional action ID for this AMI transaction.\n";
 
 /*! \brief Show SIP peers in the manager API  */
 static int manager_sip_show_peer(struct mansession *s, const struct message *m)
@@ -25476,16 +25519,11 @@
 	ast_custom_function_register(&checksipdomain_function);
 
 	/* Register manager commands */
-	ast_manager_register2("SIPpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peers,
-			"List SIP peers (text format)", mandescr_show_peers);
-	ast_manager_register2("SIPshowpeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peer,
-			"Show SIP peer (text format)", mandescr_show_peer);
-	ast_manager_register2("SIPqualifypeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_qualify_peer,
-			"Show SIP peer (text format)", mandescr_show_peer);	/*! \todo Fix this XXX This must be all wrong XXXX */
-	ast_manager_register2("SIPshowregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_show_registry,
-			"Show SIP registrations (text format)", mandescr_show_registry);
-	ast_manager_register2("SIPnotify", EVENT_FLAG_SYSTEM, manager_sipnotify,
-			"Send a SIP notify", mandescr_sipnotify);
+	ast_manager_register_xml("SIPpeers", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peers);
+	ast_manager_register_xml("SIPshowpeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_show_peer);
+	ast_manager_register_xml("SIPqualifypeer", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_sip_qualify_peer);
+	ast_manager_register_xml("SIPshowregistry", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_show_registry);
+	ast_manager_register_xml("SIPnotify", EVENT_FLAG_SYSTEM, manager_sipnotify);
 	sip_poke_all_peers();	
 	sip_send_all_registers();
 	sip_send_all_mwi_subscriptions();

Modified: team/eliel/manager-xmldoc/channels/chan_skinny.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/channels/chan_skinny.c?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/channels/chan_skinny.c (original)
+++ team/eliel/manager-xmldoc/channels/chan_skinny.c Thu May 21 14:13:59 2009
@@ -70,6 +70,63 @@
 #include "asterisk/event.h"
 #include "asterisk/indications.h"
 #include "asterisk/linkedlists.h"
+
+/*** DOCUMENTATION
+	<manager name="SKINNYdevices" language="en_US">
+		<synopsis>
+			List SKINNY devices (text format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Lists Skinny devices in text format with details on current status.
+			Devicelist will follow as separate events, followed by a final event called
+			DevicelistComplete.</para>
+		</description>
+	</manager>
+	<manager name="SKINNYshowdevice" language="en_US">
+		<synopsis>
+			Show SKINNY device (text format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Device" required="true">
+				<para>The device name you want to check.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Show one SKINNY device with details on current status.</para>
+		</description>
+	</manager>
+	<manager name="SKINNYlines" language="en_US">
+		<synopsis>
+			List SKINNY lines (text format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Lists Skinny lines in text format with details on current status.
+			Linelist will follow as separate events, followed by a final event called
+			LinelistComplete.</para>
+		</description>
+	</manager>
+	<manager name="SKINNYshowline" language="en_US">
+		<synopsis>
+			Show SKINNY line (text format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Line" required="true">
+				<para>The line name you want to check.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Show one SKINNY line with details on current status.</para>
+		</description>
+	</manager>
+ ***/
 
 #ifdef SKINNY_DEVMODE
 #define SKINNY_DEVONLY(code)	\
@@ -3049,13 +3106,6 @@
 	return CLI_SUCCESS;
 }
 
-static char mandescr_show_devices[] =
-"Description: Lists Skinny devices in text format with details on current status.\n"
-"Devicelist will follow as separate events, followed by a final event called\n"
-"DevicelistComplete.\n"
-"Variables: \n"
-"  ActionID: <id>	Action ID for this transaction. Will be returned.\n";
-
 /*! \brief  Show SKINNY devices in the manager API */
 /*    Inspired from chan_sip */
 static int manager_skinny_show_devices(struct mansession *s, const struct message *m)
@@ -3194,12 +3244,6 @@
 	return CLI_SUCCESS;
 }
 
-static char mandescr_show_device[] =
-"Description: Show one SKINNY device with details on current status.\n"
-"Variables: \n"
-"  Device: <name>           The device name you want to check.\n"
-"  ActionID: <id>	  Optional action ID for this AMI transaction.\n";
-
 static int manager_skinny_show_device(struct mansession *s, const struct message *m)
 {
 	const char *a[4];
@@ -3309,13 +3353,6 @@
 
 	return CLI_SUCCESS;
 }
-
-static char mandescr_show_lines[] =
-"Description: Lists Skinny lines in text format with details on current status.\n"
-"Linelist will follow as separate events, followed by a final event called\n"
-"LinelistComplete.\n"
-"Variables: \n"
-"  ActionID: <id>	Action ID for this transaction. Will be returned.\n";
 
 /*! \brief  Show Skinny lines in the manager API */
 /*    Inspired from chan_sip */
@@ -3501,12 +3538,6 @@
 	AST_LIST_UNLOCK(&devices);
 	return CLI_SUCCESS;
 }
-
-static char mandescr_show_line[] =
-"Description: Show one SKINNY line with details on current status.\n"
-"Variables: \n"
-"  Line: <name>           The line name you want to check.\n"
-"  ActionID: <id>	  Optional action ID for this AMI transaction.\n";
 
 static int manager_skinny_show_line(struct mansession *s, const struct message *m)
 {
@@ -7347,14 +7378,10 @@
 	ast_rtp_glue_register(&skinny_rtp_glue);
 	ast_cli_register_multiple(cli_skinny, ARRAY_LEN(cli_skinny));
 
-	ast_manager_register2("SKINNYdevices", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_devices,
-			"List SKINNY devices (text format)", mandescr_show_devices);
-	ast_manager_register2("SKINNYshowdevice", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_device,
-			"Show SKINNY device (text format)", mandescr_show_device);
-	ast_manager_register2("SKINNYlines", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_lines,
-			"List SKINNY lines (text format)", mandescr_show_lines);
-	ast_manager_register2("SKINNYshowline", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_line,
-			"Show SKINNY line (text format)", mandescr_show_line);
+	ast_manager_register_xml("SKINNYdevices", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_devices);
+	ast_manager_register_xml("SKINNYshowdevice", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_device);
+	ast_manager_register_xml("SKINNYlines", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_lines);
+	ast_manager_register_xml("SKINNYshowline", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, manager_skinny_show_line);
 
 	sched = sched_context_create();
 	if (!sched) {

Modified: team/eliel/manager-xmldoc/doc/appdocsxml.dtd
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/doc/appdocsxml.dtd?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/doc/appdocsxml.dtd (original)
+++ team/eliel/manager-xmldoc/doc/appdocsxml.dtd Thu May 21 14:13:59 2009
@@ -1,4 +1,4 @@
-  <!ELEMENT docs (application|function|agi)*>
+  <!ELEMENT docs (application|function|agi|manager)*>
   <!ATTLIST docs xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude">
 
   <!ELEMENT xi:include (xi:fallback?) >
@@ -22,6 +22,10 @@
   <!ELEMENT agi (synopsis?,syntax?,description?,see-also?)>
   <!ATTLIST agi name CDATA #REQUIRED>
   <!ATTLIST agi language CDATA #REQUIRED>
+
+  <!ELEMENT manager (synopsis?,syntax?,description?,see-also?)>
+  <!ATTLIST manager name CDATA #REQUIRED>
+  <!ATTLIST manager language CDATA #REQUIRED>
 
   <!ELEMENT see-also (ref|xi:include)*>
 

Modified: team/eliel/manager-xmldoc/include/asterisk/manager.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/include/asterisk/manager.h?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/include/asterisk/manager.h (original)
+++ team/eliel/manager-xmldoc/include/asterisk/manager.h Thu May 21 14:13:59 2009
@@ -22,6 +22,7 @@
 #include "asterisk/network.h"
 #include "asterisk/lock.h"
 #include "asterisk/datastore.h"
+#include "asterisk/xmldoc.h"
 
 /*!
  \file
@@ -116,14 +117,19 @@
 struct manager_action {
 	/*! Name of the action */
 	const char *action;
-	/*! Short description of the action */
-	const char *synopsis;
-	/*! Detailed description of the action */
-	const char *description;
+	AST_DECLARE_STRING_FIELDS(
+		AST_STRING_FIELD(synopsis);	/*!< Synopsis text (short description). */
+		AST_STRING_FIELD(description);	/*!< Description (help text) */
+		AST_STRING_FIELD(syntax);	/*!< Syntax text */
+		AST_STRING_FIELD(arguments);	/*!< Description of each argument. */
+		AST_STRING_FIELD(seealso);	/*!< See also */
+	);
 	/*! Permission required for action.  EVENT_FLAG_* */
 	int authority;
 	/*! Function to be called */
 	int (*func)(struct mansession *s, const struct message *m);
+	/*! Where the documentation come from. */
+	enum ast_doc_src docsrc;
 	/*! For easy linking */
 	AST_RWLIST_ENTRY(manager_action) list;
 };
@@ -132,6 +138,8 @@
  * \note  Use ast_manager_register2() to register with help text for new manager commands */
 #define ast_manager_register(a, b, c, d) ast_manager_register2(a, b, c, d, NULL)
 
+/*! \brief Register a manager callback using XML documentation to describe the manager. */
+#define ast_manager_register_xml(a, b, c) ast_manager_register2(a, b, c, NULL, NULL)
 
 /*! \brief Register a manager command with the manager interface 
  	\param action Name of the requested Action:

Modified: team/eliel/manager-xmldoc/include/asterisk/pbx.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/include/asterisk/pbx.h?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/include/asterisk/pbx.h (original)
+++ team/eliel/manager-xmldoc/include/asterisk/pbx.h Thu May 21 14:13:59 2009
@@ -27,6 +27,7 @@
 #include "asterisk/chanvars.h"
 #include "asterisk/hashtab.h"
 #include "asterisk/stringfields.h"
+#include "asterisk/xmldoc.h"
 
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
@@ -72,12 +73,6 @@
 
 /*! \brief Typedef for devicestate and hint callbacks */
 typedef int (*ast_state_cb_type)(char *context, char* id, enum ast_extension_states state, void *data);
-
-/*! \brief From where the documentation come from */
-enum ast_doc_src {
-	AST_XML_DOC,            /*!< From XML documentation */
-	AST_STATIC_DOC          /*!< From application/function registration */
-};
 
 /*! \brief Data structure associated with a custom dialplan function */
 struct ast_custom_function {

Modified: team/eliel/manager-xmldoc/include/asterisk/xmldoc.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/include/asterisk/xmldoc.h?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/include/asterisk/xmldoc.h (original)
+++ team/eliel/manager-xmldoc/include/asterisk/xmldoc.h Thu May 21 14:13:59 2009
@@ -22,6 +22,13 @@
  */
 
 #include "asterisk/xml.h"
+
+/*! \brief From where the documentation come from, this structure is useful for
+ *  use it inside application/functions/manager actions structure. */
+enum ast_doc_src {
+	AST_XML_DOC,            /*!< From XML documentation */
+	AST_STATIC_DOC          /*!< From application/function registration */
+};
 
 #ifdef AST_XML_DOCS
 

Modified: team/eliel/manager-xmldoc/main/features.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/main/features.c?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/main/features.c (original)
+++ team/eliel/manager-xmldoc/main/features.c Thu May 21 14:13:59 2009
@@ -154,6 +154,61 @@
 			<ref type="application">ParkedCall</ref>
 		</see-also>
 	</application>
+	<manager name="ParkedCalls" language="en_US">
+		<synopsis>
+			List parked calls.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>List parked calls.</para>
+		</description>
+	</manager>
+	<manager name="Park" language="en_US">
+		<synopsis>
+			Park a channel.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>Channel name to park.</para>
+			</parameter>
+			<parameter name="Channel2" required="true">
+				<para>Channel to announce park info to (and return to if timeout).</para>
+			</parameter>
+			<parameter name="Timeout">
+				<para>Number of milliseconds to wait before callback.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Park a channel.</para>
+		</description>
+	</manager>
+	<manager name="Bridge" language="en_US">
+		<synopsis>
+			Bridge two channels already in the PBX.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel1" required="true">
+				<para>Channel to Bridge to Channel2.</para>
+			</parameter>
+			<parameter name="Channel2" required="true">
+				<para>Channel to Bridge to Channel1.</para>
+			</parameter>
+			<parameter name="Tone">
+				<para>Play courtesy tone to Channel 2.</para>
+				<enumlist>
+					<enum name="yes" />
+					<enum name="no" />
+				</enumlist>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Bridge together two channels already in the PBX.</para>
+		</description>
+	</manager>
  ***/
 
 #define DEFAULT_PARK_TIME 45000
@@ -4109,14 +4164,6 @@
 	return CLI_SUCCESS;
 }
 
-static char mandescr_bridge[] =
-"Description: Bridge together two channels already in the PBX\n"
-"Variables: ( Headers marked with * are required )\n"
-"   *Channel1: Channel to Bridge to Channel2\n"
-"   *Channel2: Channel to Bridge to Channel1\n"
-"        Tone: (Yes|No) Play courtesy tone to Channel 2\n"
-"\n";
-
 /*!
  * \brief Actual bridge
  * \param chan
@@ -4382,13 +4429,6 @@
 	return RESULT_SUCCESS;
 }
 
-static char mandescr_park[] =
-"Description: Park a channel.\n"
-"Variables: (Names marked with * are required)\n"
-"	*Channel: Channel name to park\n"
-"	*Channel2: Channel to announce park info to (and return to if timeout)\n"
-"	Timeout: Number of milliseconds to wait before callback.\n";  
-
 /*!
  * \brief Create manager event for parked calls
  * \param s
@@ -4695,9 +4735,9 @@
 	if (!res)
 		res = ast_register_application2(parkcall, park_call_exec, NULL, NULL, NULL);
 	if (!res) {
-		ast_manager_register("ParkedCalls", 0, manager_parking_status, "List parked calls");
-		ast_manager_register2("Park", EVENT_FLAG_CALL, manager_park, "Park a channel", mandescr_park); 
-		ast_manager_register2("Bridge", EVENT_FLAG_CALL, action_bridge, "Bridge two channels already in the PBX", mandescr_bridge);
+		ast_manager_register_xml("ParkedCalls", 0, manager_parking_status);
+		ast_manager_register_xml("Park", EVENT_FLAG_CALL, manager_park);
+		ast_manager_register_xml("Bridge", EVENT_FLAG_CALL, action_bridge);
 	}
 
 	res |= ast_devstate_prov_add("Park", metermaidstate);

Modified: team/eliel/manager-xmldoc/main/manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/manager-xmldoc/main/manager.c?view=diff&rev=195999&r1=195998&r2=195999
==============================================================================
--- team/eliel/manager-xmldoc/main/manager.c (original)
+++ team/eliel/manager-xmldoc/main/manager.c Thu May 21 14:13:59 2009
@@ -74,6 +74,618 @@
 #include "asterisk/term.h"
 #include "asterisk/astobj2.h"
 #include "asterisk/features.h"
+
+/*** DOCUMENTATION
+	<manager name="Ping" language="en_US">
+		<synopsis>
+			Keepalive command.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>A 'Ping' action will ellicit a 'Pong' response. Used to keep the
+			manager connection open.</para>
+		</description>
+	</manager>
+	<manager name="Events" language="en_US">
+		<synopsis>
+			Control Event Flow.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="EventMask" required="true">
+				<enumlist>
+					<enum name="on">
+						<para>If all events should be sent.</para>
+					</enum>
+					<enum name="off">
+						<para>If no events should be sent.</para>
+					</enum>
+					<enum name="system,call,log,...">
+						<para>To select which flags events should have to be sent.</para>
+					</enum>
+				</enumlist>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Enable/Disable sending of events to this manager client.</para>
+		</description>
+	</manager>
+	<manager name="Logoff" language="en_US">
+		<synopsis>
+			Logoff Manager.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Logoff the current manager session.</para>
+		</description>
+	</manager>
+	<manager name="Login" language="en_US">
+		<synopsis>
+			Login Manager.
+		</synopsis>
+		<syntax>
+			<parameter name="ActionID">
+				<para>ActionID for this transaction. Will be returned.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Login Manager.</para>
+		</description>
+	</manager>
+	<manager name="Challenge" language="en_US">
+		<synopsis>
+			Generate Challenge for MD5 Auth.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+			<para>Generate a challenge for MD5 authentication.</para>
+		</description>
+	</manager>
+	<manager name="Hangup" language="en_US">
+		<synopsis>
+			Hangup channel.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>The channel name to be hangup.</para>
+			</parameter>
+			<parameter name="Cause">
+				<para>Numeric hangup cause.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Hangup a channel.</para>
+		</description>
+	</manager>
+	<manager name="Status" language="en_US">
+		<synopsis>
+			List channel status.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>The name of the channel to query for status.</para>
+			</parameter>
+			<parameter name="Variables">
+				<para>Comma <literal>,</literal> separated list of variable to include.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Will return the status information of each channel along with the
+			value for the specified channel variables.</para>
+		</description>
+	</manager>
+	<manager name="Setvar" language="en_US">
+		<synopsis>
+			Set a channel variable.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel">
+				<para>Channel to set variable for.</para>
+			</parameter>
+			<parameter name="Variable" required="true">
+				<para>Variable name.</para>
+			</parameter>
+			<parameter name="Value" required="true">
+				<para>Variable value.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Set a global or local channel variable.</para>
+		</description>
+	</manager>
+	<manager name="Getvar" language="en_US">
+		<synopsis>
+			Gets a channel variable.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel">
+				<para>Channel to read variable from.</para>
+			</parameter>
+			<parameter name="Variable" required="true">
+				<para>Variable name.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Get the value of a global or local channel variable.</para>
+		</description>
+	</manager>
+	<manager name="GetConfig" language="en_US">
+		<synopsis>
+			Retrieve configuration.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Filename" required="true">
+				<para>Configuration filename (e.g. <filename>foo.conf</filename>).</para>
+			</parameter>
+			<parameter name="Category">
+				<para>Category in configuration file.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>This action will dump the contents of a configuration
+			file by category and contents or optionally by specified category only.</para>
+		</description>
+	</manager>
+	<manager name="GetConfigJSON" language="en_US">
+		<synopsis>
+			Retrieve configuration (JSON format).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Filename" required="true">
+				<para>Configuration filename (e.g. <filename>foo.conf</filename>).</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>This action will dump the contents of a configuration file by category
+			and contents in JSON format. This only makes sense to be used using rawman over
+			the HTTP interface.</para>
+		</description>
+	</manager>
+	<manager name="UpdateConfig" language="en_US">
+		<synopsis>
+			Update basic configuration.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="SrcFilename" required="true">
+				<para>Configuration filename to read (e.g. <filename>foo.conf</filename>).</para>
+			</parameter>
+			<parameter name="DstFilename" required="true">
+				<para>Configuration filename to write (e.g. <filename>foo.conf</filename>)</para>
+			</parameter>
+			<parameter name="Reload">
+				<para>Whether or not a reload should take place (or name of specific module).</para>
+			</parameter>
+			<parameter name="Action-XXXXXX">
+				<para>Action to take.</para>
+				<para>X's represent 6 digit number beginning with 000000.</para>
+				<enumlist>
+					<enum name="NewCat" />
+					<enum name="RenameCat" />
+					<enum name="DelCat" />
+					<enum name="EmptyCat" />
+					<enum name="Update" />
+					<enum name="Delete" />
+					<enum name="Append" />
+					<enum name="Insert" />
+				</enumlist>
+			</parameter>
+			<parameter name="Cat-XXXXXX">
+				<para>Category to operate on.</para>
+				<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-XXXXXX']/para[2])" />
+			</parameter>
+			<parameter name="Var-XXXXXX">
+				<para>Variable to work on.</para>
+				<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-XXXXXX']/para[2])" />
+			</parameter>
+			<parameter name="Value-XXXXXX">
+				<para>Value to work on.</para>
+				<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-XXXXXX']/para[2])" />
+			</parameter>
+			<parameter name="Match-XXXXXX">
+				<para>Extra match required to match line.</para>
+				<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-XXXXXX']/para[2])" />
+			</parameter>
+			<parameter name="Line-XXXXXX">
+				<para>Line in category to operate on (used with delete and insert actions).</para>
+				<xi:include xpointer="xpointer(/docs/manager[@name='UpdateConfig']/syntax/parameter[@name='Action-XXXXXX']/para[2])" />
+			</parameter>
+		</syntax>
+		<description>
+			<para>This action will modify, create, or delete configuration elements
+			in Asterisk configuration files.</para>
+		</description>
+	</manager>
+	<manager name="CreateConfig" language="en_US">
+		<synopsis>
+			Creates an empty file in the configuration directory.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Filename" required="true">
+				<para>The configuration filename to create (e.g. <filename>foo.conf</filename>).</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>This action will create an empty file in the configuration
+			directory. This action is intended to be used before an UpdateConfig
+			action.</para>
+		</description>
+	</manager>
+	<manager name="ListCategories" language="en_US">
+		<synopsis>
+			List categories in configuration file.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Filename" required="true">
+				<para>Configuration filename (e.g. <filename>foo.conf</filename>).</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>This action will dump the categories in a given file.</para>
+		</description>
+	</manager>
+	<manager name="Redirect" language="en_US">
+		<synopsis>
+			Redirect (transfer) a call.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>Channel to redirect.</para>
+			</parameter>
+			<parameter name="ExtraChannel">
+				<para>Second call leg to transfer (optional).</para>
+			</parameter>
+			<parameter name="Exten" required="true">
+				<para>Extension to transfer to.</para>
+			</parameter>
+			<parameter name="Context" required="true">
+				<para>Context to transfer to.</para>
+			</parameter>
+			<parameter name="Priority" required="true">
+				<para>Priority to transfer to.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Redirect (transfer) a call.</para>
+		</description>
+	</manager>
+	<manager name="Atxfer" language="en_US">
+		<synopsis>
+			Attended transfer.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>Transferer's channel.</para>
+			</parameter>
+			<parameter name="Exten" required="true">
+				<para>Extension to transfer to.</para>
+			</parameter>
+			<parameter name="Context" required="true">
+				<para>Context to transfer to.</para>
+			</parameter>
+			<parameter name="Priority" required="true">
+				<para>Priority to transfer to.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Attended transfer.</para>
+		</description>
+	</manager>
+	<manager name="Originate" language="en_US">
+		<synopsis>
+			Originate a call.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>Channel name to call.</para>
+			</parameter>
+			<parameter name="Exten">
+				<para>Extension to use (requires <literal>Context</literal> and
+				<literal>Priority</literal>)</para>
+			</parameter>
+			<parameter name="Context">
+				<para>Context to use (requires <literal>Exten</literal> and
+				<literal>Priority</literal>)</para>
+			</parameter>
+			<parameter name="Priority">
+				<para>Priority to use (requires <literal>Exten</literal> and
+				<literal>Context</literal>)</para>
+			</parameter>
+			<parameter name="Application">
+				<para>Application to execute.</para>
+			</parameter>
+			<parameter name="Data">

[... 1140 lines stripped ...]



More information about the asterisk-commits mailing list