[asterisk-commits] eliel: trunk r196308 - in /trunk: apps/ channels/ doc/ include/asterisk/ main...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 22 12:52:51 CDT 2009


Author: eliel
Date: Fri May 22 12:52:35 2009
New Revision: 196308

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196308
Log:
Implement a new element in AstXML for AMI actions documentation.

A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>


Modified:
    trunk/apps/app_meetme.c
    trunk/apps/app_queue.c
    trunk/apps/app_senddtmf.c
    trunk/apps/app_voicemail.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_dahdi.c
    trunk/channels/chan_iax2.c
    trunk/channels/chan_sip.c
    trunk/channels/chan_skinny.c
    trunk/doc/appdocsxml.dtd
    trunk/include/asterisk/manager.h
    trunk/include/asterisk/pbx.h
    trunk/include/asterisk/xmldoc.h
    trunk/main/db.c
    trunk/main/features.c
    trunk/main/manager.c
    trunk/main/pbx.c
    trunk/main/xmldoc.c
    trunk/res/res_agi.c

Modified: trunk/apps/app_meetme.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Fri May 22 12:52:35 2009
@@ -420,6 +420,46 @@
 			</variablelist>
 		</description>
 	</application>
+	<manager name="MeetmeMute" language="en_US">
+		<synopsis>
+			Mute a Meetme user.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Meetme" required="true" />
+			<parameter name="Usernum" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="MeetmeUnmute" language="en_US">
+		<synopsis>
+			Unmute a Meetme user.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Meetme" required="true" />
+			<parameter name="Usernum" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="MeetmeList" language="en_US">
+		<synopsis>
+			List participants in a conference.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Conference" required="true">
+				<para>Conference number.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Lists all users in a particular MeetMe conference.
+			MeetmeList will follow as separate events, followed by a final event called
+			MeetmeListComplete.</para>
+		</description>
+	</manager>
  ***/
 
 #define CONFIG_FILE_NAME "meetme.conf"
@@ -4236,14 +4276,6 @@
 	return meetmemute(s, m, 0);
 }
 
-static const char mandescr_meetmelist[] =
-"Description: Lists all users in a particular MeetMe conference.\n"
-"MeetmeList will follow as separate events, followed by a final event called\n"
-"MeetmeListComplete.\n"
-"Variables:\n"
-"    *ActionId: <id>\n"
-"    *Conference: <confno>\n";
-
 static int action_meetmelist(struct mansession *s, const struct message *m)
 {
 	const char *actionid = astman_get_header(m, "ActionID");
@@ -6418,12 +6450,9 @@
 	res |= load_config(0);
 
 	ast_cli_register_multiple(cli_meetme, ARRAY_LEN(cli_meetme));
-	res |= ast_manager_register("MeetmeMute", EVENT_FLAG_CALL, 
-				    action_meetmemute, "Mute a Meetme user");
-	res |= ast_manager_register("MeetmeUnmute", EVENT_FLAG_CALL, 
-				    action_meetmeunmute, "Unmute a Meetme user");
-	res |= ast_manager_register2("MeetmeList", EVENT_FLAG_REPORTING, 
-				    action_meetmelist, "List participants in a conference", mandescr_meetmelist);
+	res |= ast_manager_register_xml("MeetmeMute", EVENT_FLAG_CALL, action_meetmemute);
+	res |= ast_manager_register_xml("MeetmeUnmute", EVENT_FLAG_CALL, action_meetmeunmute);
+	res |= ast_manager_register_xml("MeetmeList", EVENT_FLAG_REPORTING, action_meetmelist);
 	res |= ast_register_application_xml(app4, channel_admin_exec);
 	res |= ast_register_application_xml(app3, admin_exec);
 	res |= ast_register_application_xml(app2, count_exec);

Modified: trunk/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_queue.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Fri May 22 12:52:35 2009
@@ -494,7 +494,160 @@
 			<para>Gets or sets queue members penalty.</para>
 		</description>
 	</function>
-
+	<manager name="Queues" language="en_US">
+		<synopsis>
+			Queues.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueStatus" language="en_US">
+		<synopsis>
+			Show queue status.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Queue" />
+			<parameter name="Member" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueSummary" language="en_US">
+		<synopsis>
+			Show queue summary.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Queue" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueAdd" language="en_US">
+		<synopsis>
+			Add interface to queue.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Queue" required="true" />
+			<parameter name="Interface" required="true" />
+			<parameter name="Penalty" />
+			<parameter name="Paused" />
+			<parameter name="MemberName" />
+			<parameter name="StateInterface" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueRemove" language="en_US">
+		<synopsis>
+			Remove interface from queue.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Queue" required="true" />
+			<parameter name="Interface" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueuePause" language="en_US">
+		<synopsis>
+			Makes a queue member temporarily unavailable.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Interface" required="true" />
+			<parameter name="Paused" required="true" />
+			<parameter name="Queue" />
+			<parameter name="Reason" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueLog" language="en_US">
+		<synopsis>
+			Adds custom entry in queue_log.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Queue" required="true" />
+			<parameter name="Event" required="true" />
+			<parameter name="Uniqueid" />
+			<parameter name="Interface" />
+			<parameter name="Message" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueuePenalty" language="en_US">
+		<synopsis>
+			Set the penalty for a queue member.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Interface" required="true" />
+			<parameter name="Penalty" required="true" />
+			<parameter name="Queue" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueRule" language="en_US">
+		<synopsis>
+			Queue Rules.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Rule" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueReload" language="en_US">
+		<synopsis>
+			Reload a queue, queues, or any sub-section of a queue or queues.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Queue" />
+			<parameter name="Members">
+				<enumlist>
+					<enum name="yes" />
+					<enum name="no" />
+				</enumlist>
+			</parameter>
+			<parameter name="Rules">
+				<enumlist>
+					<enum name="yes" />
+					<enum name="no" />
+				</enumlist>
+			</parameter>
+			<parameter name="Parameters">
+				<enumlist>
+					<enum name="yes" />
+					<enum name="no" />
+				</enumlist>
+			</parameter>
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="QueueReset" language="en_US">
+		<synopsis>
+			Reset queue statistics.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Queue" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
  ***/
 
 enum {
@@ -7299,17 +7452,17 @@
 	res |= ast_register_application_xml(app_pqm, pqm_exec);
 	res |= ast_register_application_xml(app_upqm, upqm_exec);
 	res |= ast_register_application_xml(app_ql, ql_exec);
-	res |= ast_manager_register("Queues", 0, manager_queues_show, "Queues");
-	res |= ast_manager_register("QueueStatus", 0, manager_queues_status, "Queue Status");
-	res |= ast_manager_register("QueueSummary", 0, manager_queues_summary, "Queue Summary");
-	res |= ast_manager_register("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member, "Add interface to queue.");
-	res |= ast_manager_register("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member, "Remove interface from queue.");
-	res |= ast_manager_register("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member, "Makes a queue member temporarily unavailable");
-	res |= ast_manager_register("QueueLog", EVENT_FLAG_AGENT, manager_queue_log_custom, "Adds custom entry in queue_log");
-	res |= ast_manager_register("QueuePenalty", EVENT_FLAG_AGENT, manager_queue_member_penalty, "Set the penalty for a queue member"); 
-	res |= ast_manager_register("QueueRule", 0, manager_queue_rule_show, "Queue Rules");
-	res |= ast_manager_register("QueueReload", 0, manager_queue_reload, "Reload a queue, queues, or any sub-section of a queue or queues");
-	res |= ast_manager_register("QueueReset", 0, manager_queue_reset, "Reset queue statistics");
+	res |= ast_manager_register_xml("Queues", 0, manager_queues_show);
+	res |= ast_manager_register_xml("QueueStatus", 0, manager_queues_status);
+	res |= ast_manager_register_xml("QueueSummary", 0, manager_queues_summary);
+	res |= ast_manager_register_xml("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member);
+	res |= ast_manager_register_xml("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member);
+	res |= ast_manager_register_xml("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member);
+	res |= ast_manager_register_xml("QueueLog", EVENT_FLAG_AGENT, manager_queue_log_custom);
+	res |= ast_manager_register_xml("QueuePenalty", EVENT_FLAG_AGENT, manager_queue_member_penalty);
+	res |= ast_manager_register_xml("QueueRule", 0, manager_queue_rule_show);
+	res |= ast_manager_register_xml("QueueReload", 0, manager_queue_reload);
+	res |= ast_manager_register_xml("QueueReset", 0, manager_queue_reset);
 	res |= ast_custom_function_register(&queuevar_function);
 	res |= ast_custom_function_register(&queuemembercount_function);
 	res |= ast_custom_function_register(&queuemembercount_dep);

Modified: trunk/apps/app_senddtmf.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_senddtmf.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/apps/app_senddtmf.c (original)
+++ trunk/apps/app_senddtmf.c Fri May 22 12:52:35 2009
@@ -59,6 +59,23 @@
 			<ref type="application">Read</ref>
 		</see-also>
 	</application>
+	<manager name="PlayDTMF" language="en_US">
+		<synopsis>
+			Play DTMF signal on a specific channel.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Channel" required="true">
+				<para>Channel name to send digit to.</para>
+			</parameter>
+			<parameter name="Digit" required="true">
+				<para>The DTMF digit to play.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Plays a dtmf digit on the specified channel.</para>
+		</description>
+	</manager>
  ***/
 static char *app = "SendDTMF";
 
@@ -89,12 +106,6 @@
 
 	return res;
 }
-
-static const char mandescr_playdtmf[] =
-"Description: Plays a dtmf digit on the specified channel.\n"
-"Variables: (all are required)\n"
-"	Channel: Channel name to send digit to\n"
-"	Digit: The dtmf digit to play\n";
 
 static int manager_play_dtmf(struct mansession *s, const struct message *m)
 {
@@ -136,7 +147,7 @@
 {
 	int res;
 
-	res = ast_manager_register2( "PlayDTMF", EVENT_FLAG_CALL, manager_play_dtmf, "Play DTMF signal on a specific channel.", mandescr_playdtmf );
+	res = ast_manager_register_xml("PlayDTMF", EVENT_FLAG_CALL, manager_play_dtmf);
 	res |= ast_register_application_xml(app, senddtmf_exec);
 
 	return res;

Modified: trunk/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Fri May 22 12:52:35 2009
@@ -298,6 +298,16 @@
 			context.</para>
 		</description>
 	</function>
+	<manager name="VoicemailUsersList" language="en_US">
+		<synopsis>
+			List All Voicemail User Information.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
  ***/
 
 #ifdef IMAP_STORAGE
@@ -11150,7 +11160,7 @@
 	res |= ast_register_application_xml(app3, vm_box_exists);
 	res |= ast_register_application_xml(app4, vmauthenticate);
 	res |= ast_custom_function_register(&mailbox_exists_acf);
-	res |= ast_manager_register("VoicemailUsersList", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, manager_list_voicemail_users, "List All Voicemail User Information");
+	res |= ast_manager_register_xml("VoicemailUsersList", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, manager_list_voicemail_users);
 	if (res)
 		return res;
 

Modified: trunk/channels/chan_agent.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_agent.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Fri May 22 12:52:35 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: trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Fri May 22 12:52:35 2009
@@ -154,6 +154,89 @@
 			<para>This application will Accept the R2 call either with charge or no charge.</para>
 		</description>
 	</application>
+	<manager name="DAHDITransfer" language="en_US">
+		<synopsis>
+			Transfer DAHDI Channel.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="DAHDIChannel" required="true">
+				<para>DAHDI channel name to transfer.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Transfer a DAHDI channel.</para>
+		</description>
+	</manager>
+	<manager name="DAHDIHangup" language="en_US">
+		<synopsis>
+			Hangup DAHDI Channel.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="DAHDIChannel" required="true">
+				<para>DAHDI channel name to hangup.</para>
+			</parameter>
+		</syntax>
+		<description>
+			<para>Hangup a DAHDI channel.</para>
+		</description>
+	</manager>
+	<manager name="DAHDIDialOffhook" language="en_US">
+		<synopsis>
+			Dial over DAHDI channel while offhook.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="DAHDIChannel" required="true" />
+			<parameter name="Number" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="DAHDIDNDon" language="en_US">
+		<synopsis>
+			Toggle DAHDI channel Do Not Disturb status ON.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="DAHDIChannel" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="DAHDIDNDoff" language="en_US">
+		<synopsis>
+			Toggle DAHDI channel Do Not Disturb status OFF.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="DAHDIChannel" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="DAHDIShowChannels" language="en_US">
+		<synopsis>
+			Show status DAHDI channels.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="DAHDIChannel" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="DAHDIRestart" language="en_US">
+		<synopsis>
+			Fully Restart DAHDI channels (terminates calls).
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
  ***/
 
 #define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */
@@ -16193,11 +16276,11 @@
 #endif
 
 	ast_cli_unregister_multiple(dahdi_cli, ARRAY_LEN(dahdi_cli));
-	ast_manager_unregister( "DAHDIDialOffhook" );
-	ast_manager_unregister( "DAHDIHangup" );
-	ast_manager_unregister( "DAHDITransfer" );
-	ast_manager_unregister( "DAHDIDNDoff" );
-	ast_manager_unregister( "DAHDIDNDon" );
+	ast_manager_unregister("DAHDIDialOffhook");
+	ast_manager_unregister("DAHDIHangup");
+	ast_manager_unregister("DAHDITransfer");
+	ast_manager_unregister("DAHDIDNDoff");
+	ast_manager_unregister("DAHDIDNDon");
 	ast_manager_unregister("DAHDIShowChannels");
 	ast_manager_unregister("DAHDIRestart");
 	ast_channel_unregister(&dahdi_tech);
@@ -17640,13 +17723,13 @@
 	ast_cli_register_multiple(dahdi_cli, ARRAY_LEN(dahdi_cli));
 
 	memset(round_robin, 0, sizeof(round_robin));
-	ast_manager_register( "DAHDITransfer", 0, action_transfer, "Transfer DAHDI Channel" );
-	ast_manager_register( "DAHDIHangup", 0, action_transferhangup, "Hangup DAHDI Channel" );
-	ast_manager_register( "DAHDIDialOffhook", 0, action_dahdidialoffhook, "Dial over DAHDI channel while offhook" );
-	ast_manager_register( "DAHDIDNDon", 0, action_dahdidndon, "Toggle DAHDI channel Do Not Disturb status ON" );
-	ast_manager_register( "DAHDIDNDoff", 0, action_dahdidndoff, "Toggle DAHDI channel Do Not Disturb status OFF" );
-	ast_manager_register("DAHDIShowChannels", 0, action_dahdishowchannels, "Show status DAHDI channels");
-	ast_manager_register("DAHDIRestart", 0, action_dahdirestart, "Fully Restart DAHDI channels (terminates calls)");
+	ast_manager_register_xml("DAHDITransfer", 0, action_transfer);
+	ast_manager_register_xml("DAHDIHangup", 0, action_transferhangup);
+	ast_manager_register_xml("DAHDIDialOffhook", 0, action_dahdidialoffhook);
+	ast_manager_register_xml("DAHDIDNDon", 0, action_dahdidndon);
+	ast_manager_register_xml("DAHDIDNDoff", 0, action_dahdidndoff);
+	ast_manager_register_xml("DAHDIShowChannels", 0, action_dahdishowchannels);
+	ast_manager_register_xml("DAHDIRestart", 0, action_dahdirestart);
 
 	ast_cond_init(&ss_thread_complete, NULL);
 

Modified: trunk/channels/chan_iax2.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Fri May 22 12:52:35 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: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri May 22 12:52:35 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 const 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)
@@ -14166,14 +14230,6 @@
 #undef FORMAT
 }
 
-/*! \brief Manager Action SIPShowRegistry description */
-static const 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)
 {
@@ -14211,13 +14267,6 @@
 	
 	return 0;
 }
-
-static const 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 */
@@ -14836,12 +14885,6 @@
 	}
 }
 #undef FORMAT
-
-static const 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)
@@ -25478,16 +25521,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: trunk/channels/chan_skinny.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Fri May 22 12:52:35 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 const 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 const 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 const 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 const 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: trunk/doc/appdocsxml.dtd
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/doc/appdocsxml.dtd?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/doc/appdocsxml.dtd (original)
+++ trunk/doc/appdocsxml.dtd Fri May 22 12:52:35 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: trunk/include/asterisk/manager.h
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/include/asterisk/manager.h?view=diff&rev=196308&r1=196307&r2=196308
==============================================================================
--- trunk/include/asterisk/manager.h (original)
+++ trunk/include/asterisk/manager.h Fri May 22 12:52:35 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). */

[... 1747 lines stripped ...]



More information about the asterisk-commits mailing list