path: root/channels/chan_agent.c
diff options
authoreliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-22 17:52:35 +0000
committereliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-22 17:52:35 +0000
commitcbbfdc573c6f071b12dc665273c0063a0c69ad69 (patch)
treee1c6ca80d913c0e0aa3166a40d7b8e4461cd62d1 /channels/chan_agent.c
parentc208610d90db5a241e187413c831309cd5f13f32 (diff)
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> git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196308 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
1 files changed, 30 insertions, 12 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index d922d4927..17b20cd8b 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -167,6 +167,34 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<description />
+ <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";
@@ -175,16 +203,6 @@ static const char config[] = "agents.conf";
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";
#define AST_MAX_AGENT 80 /*!< Agent ID or Password max length */
@@ -2559,8 +2577,8 @@ static int load_module(void)
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));