[asterisk-commits] pabelanger: branch pabelanger/xmldoc r309630 - in /team/pabelanger/xmldoc: do...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Mar 4 15:26:52 CST 2011
Author: pabelanger
Date: Fri Mar 4 15:26:46 2011
New Revision: 309630
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=309630
Log:
Start logic for manager_events.
Add 'manager show events' and 'manager show event'.
Modified:
team/pabelanger/xmldoc/doc/appdocsxml.dtd
team/pabelanger/xmldoc/include/asterisk/strings.h
team/pabelanger/xmldoc/main/cli.c
team/pabelanger/xmldoc/main/manager.c
team/pabelanger/xmldoc/main/xmldoc.c
Modified: team/pabelanger/xmldoc/doc/appdocsxml.dtd
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/xmldoc/doc/appdocsxml.dtd?view=diff&rev=309630&r1=309629&r2=309630
==============================================================================
--- team/pabelanger/xmldoc/doc/appdocsxml.dtd (original)
+++ team/pabelanger/xmldoc/doc/appdocsxml.dtd Fri Mar 4 15:26:46 2011
@@ -1,4 +1,4 @@
- <!ELEMENT docs (application|function|agi|manager_action)*>
+ <!ELEMENT docs (application|function|agi|manager_action|manager_event)*>
<!ATTLIST docs xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude">
<!ELEMENT xi:include (xi:fallback?) >
@@ -26,6 +26,10 @@
<!ELEMENT manager_action (synopsis?,syntax?,description?,see-also?)>
<!ATTLIST manager_action name CDATA #REQUIRED>
<!ATTLIST manager_action language CDATA #REQUIRED>
+
+ <!ELEMENT manager_event (synopsis?,syntax?,description?,see-also?)>
+ <!ATTLIST manager_event name CDATA #REQUIRED>
+ <!ATTLIST manager_event language CDATA #REQUIRED>
<!ELEMENT see-also (ref|xi:include)*>
Modified: team/pabelanger/xmldoc/include/asterisk/strings.h
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/xmldoc/include/asterisk/strings.h?view=diff&rev=309630&r1=309629&r2=309630
==============================================================================
--- team/pabelanger/xmldoc/include/asterisk/strings.h (original)
+++ team/pabelanger/xmldoc/include/asterisk/strings.h Fri Mar 4 15:26:46 2011
@@ -90,8 +90,9 @@
AST_INLINE_API(
char * attribute_pure ast_skip_blanks(const char *str),
{
- while (*str && ((unsigned char) *str) < 33)
+ while (*str && ((unsigned char) *str) < 33) {
str++;
+ }
return (char *) str;
}
)
Modified: team/pabelanger/xmldoc/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/xmldoc/main/cli.c?view=diff&rev=309630&r1=309629&r2=309630
==============================================================================
--- team/pabelanger/xmldoc/main/cli.c (original)
+++ team/pabelanger/xmldoc/main/cli.c Fri Mar 4 15:26:46 2011
@@ -2043,24 +2043,26 @@
/* XXX check that usage and command are filled up */
s = ast_skip_blanks(e->command);
s = e->command = ast_strdup(s);
- for (i=0; !ast_strlen_zero(s) && i < AST_MAX_CMD_LEN-1; i++) {
+ for (i = 0; !ast_strlen_zero(s) && i < AST_MAX_CMD_LEN-1; i++) {
*dst++ = s; /* store string */
s = ast_skip_nonblanks(s);
- if (*s == '\0') /* we are done */
+ if (*s == '\0') { /* we are done */
break;
+ }
*s++ = '\0';
s = ast_skip_blanks(s);
}
*dst++ = NULL;
-
+
AST_RWLIST_WRLOCK(&helpers);
-
+
if (find_cli(e->cmda, 1)) {
ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", S_OR(e->_full_cmd, e->command));
goto done;
}
- if (set_full_cmd(e))
+ if (set_full_cmd(e)) {
goto done;
+ }
lf = e->cmdlen;
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&helpers, cur, list) {
@@ -2068,14 +2070,15 @@
if (lf < len)
len = lf;
if (strncasecmp(e->_full_cmd, cur->_full_cmd, len) < 0) {
- AST_RWLIST_INSERT_BEFORE_CURRENT(e, list);
+ AST_RWLIST_INSERT_BEFORE_CURRENT(e, list);
break;
}
}
AST_RWLIST_TRAVERSE_SAFE_END;
- if (!cur)
- AST_RWLIST_INSERT_TAIL(&helpers, e, list);
+ if (!cur) {
+ AST_RWLIST_INSERT_TAIL(&helpers, e, list);
+ }
ret = 0; /* success */
done:
@@ -2103,8 +2106,9 @@
{
int i, res = 0;
- for (i = 0; i < len; i++)
+ for (i = 0; i < len; i++) {
res |= ast_cli_register(e + i);
+ }
return res;
}
Modified: team/pabelanger/xmldoc/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/xmldoc/main/manager.c?view=diff&rev=309630&r1=309629&r2=309630
==============================================================================
--- team/pabelanger/xmldoc/main/manager.c (original)
+++ team/pabelanger/xmldoc/main/manager.c Fri Mar 4 15:26:46 2011
@@ -806,6 +806,22 @@
<para>Generates an AOC-D or AOC-E message on a channel.</para>
</description>
</manager_action>
+ <manager_event name="ExtensionStatus" language="en_US">
+ <synopsis>
+ </synopsis>
+ <syntax>
+ <parameter name="Exten">
+ </parameter>
+ <parameter name="Context">
+ </parameter>
+ <parameter name="Hint">
+ </parameter>
+ <parameter name="Status">
+ </parameter>
+ </syntax>
+ <description>
+ </description>
+ </manager_event>
***/
enum error_type {
@@ -1347,6 +1363,24 @@
return ret;
}
+static char *handle_show_manager_event(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "manager show event";
+ e->usage =
+ "Usage: manager show event <eventname> [<eventname> [<eventname> [...]]]\n"
+ " Show the detailed descriptions for a specific Asterisk manager interface event.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
+ if (a->argc < 4) {
+ return CLI_SHOWUSAGE;
+ }
+ return CLI_SUCCESS;
+}
+
static char *handle_showmancmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct manager_action *cur;
@@ -1553,6 +1587,21 @@
ast_cli(a->fd,"-------------------\n"
"%d manager users configured.\n", count_amu);
+ return CLI_SUCCESS;
+}
+
+static char *handle_show_manager_events(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+ switch (cmd) {
+ case CLI_INIT:
+ e->command = "manager show events";
+ e->usage =
+ "Usage: manager show events\n"
+ " Prints a listing of all the available Asterisk manager interface events.\n";
+ return NULL;
+ case CLI_GENERATE:
+ return NULL;
+ }
return CLI_SUCCESS;
}
@@ -6139,6 +6188,8 @@
AST_CLI_DEFINE(handle_mandebug, "Show, enable, disable debugging of the manager code"),
AST_CLI_DEFINE(handle_manager_reload, "Reload manager configurations"),
AST_CLI_DEFINE(handle_manager_show_settings, "Show manager global settings"),
+ AST_CLI_DEFINE(handle_show_manager_event, "Show a manager interface event"),
+ AST_CLI_DEFINE(handle_show_manager_events, "List manager interface events"),
};
static int __init_manager(int reload)
Modified: team/pabelanger/xmldoc/main/xmldoc.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/xmldoc/main/xmldoc.c?view=diff&rev=309630&r1=309629&r2=309630
==============================================================================
--- team/pabelanger/xmldoc/main/xmldoc.c (original)
+++ team/pabelanger/xmldoc/main/xmldoc.c Fri Mar 4 15:26:46 2011
@@ -1046,6 +1046,7 @@
enum syntaxtype {
FUNCTION_SYNTAX,
MANAGER_ACTION_SYNTAX,
+ MANAGER_EVENT_SYNTAX,
COMMAND_SYNTAX
};
@@ -1057,6 +1058,7 @@
{ "function", FUNCTION_SYNTAX },
{ "application", FUNCTION_SYNTAX },
{ "manager_action", MANAGER_ACTION_SYNTAX },
+ { "manager_event", MANAGER_EVENT_SYNTAX },
{ "agi", COMMAND_SYNTAX }
};
@@ -1103,6 +1105,9 @@
break;
case MANAGER_ACTION_SYNTAX:
syntax = xmldoc_get_syntax_manager_action(node, name);
+ break;
+ case MANAGER_EVENT_SYNTAX:
+
break;
default:
syntax = xmldoc_get_syntax_fun(node, name, "parameter", 1, 1);
More information about the asterisk-commits
mailing list