From cbbfdc573c6f071b12dc665273c0063a0c69ad69 Mon Sep 17 00:00:00 2001 From: eliel Date: Fri, 22 May 2009 17:52:35 +0000 Subject: 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: AMI action synopsis. <-- for ActionID Description ... AMI action description ... git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196308 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_agent.c | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'channels/chan_agent.c') 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$") + + + Lists agents and their status. + + + + + + Will list info about all possible agents. + + + + + Sets an agent as no longer logged in. + + + + + Agent ID of the agent to log off. + + + Set to true to not hangup existing calls. + + + + Sets an agent as no longer logged in. + + ***/ 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)); -- cgit v1.2.3