[asterisk-commits] pabelanger: branch pabelanger/issue17173 r258973 - /team/pabelanger/issue1717...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 26 12:36:36 CDT 2010


Author: pabelanger
Date: Mon Apr 26 12:36:32 2010
New Revision: 258973

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=258973
Log:
Include more sample events.  New type parameter for xmldoc_get_syntax_manager().

Modified:
    team/pabelanger/issue17173/main/manager.c
    team/pabelanger/issue17173/main/xmldoc.c

Modified: team/pabelanger/issue17173/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/main/manager.c?view=diff&rev=258973&r1=258972&r2=258973
==============================================================================
--- team/pabelanger/issue17173/main/manager.c (original)
+++ team/pabelanger/issue17173/main/manager.c Mon Apr 26 12:36:32 2010
@@ -694,10 +694,56 @@
 			For success returns, the module revision number is included.</para>
 		</description>
 	</ami_command>
+	<ami_event name="ExtensionStatus" language="en_US">
+		<synopsis>
+		</sysnopsis>
+		<syntax>
+			<parameter name="Exten">
+			</parameter>
+			<parameter name="Context">
+			</parameter>
+			<parameter name="Hint">
+			</parameter>
+			<parameter name="Status">
+			</parameter>
+		</syntax>
+		<description>
+		</description>
+	</ami_event>
+	<ami_event name="OriginateResponse" language="en_US">
+		<synopsis>
+		</sysnopsis>
+		<syntax>
+			<parameter name="Response">
+			</parameter>
+			<parameter name="Channel">
+			</parameter>
+			<parameter name="Context">
+			</parameter>
+			<parameter name="Exten">
+			</parameter>
+			<parameter name="Reason">
+			</parameter>
+			<parameter name="Uniqueid">
+			</parameter>
+			<parameter name="CallerIDNum">
+			</parameter>
+			<parameter name="CallerIDName">
+			</parameter>
+		</syntax>
+		<description>
+		</description>
+	</ami_event>
 	<ami_event name="Reload" language="en_US">
 		<synopsis>
 		</sysnopsis>
 		<syntax>
+			<parameter name="Module">
+			</parameter>
+			<parameter name="Status">
+			</parameter>
+			<parameter name="Message">
+			</parameter>
 		</syntax>
 		<description>
 		</description>
@@ -5666,6 +5712,8 @@
 		ast_manager_register_xml(MANAGER_COMMAND, "ModuleLoad", EVENT_FLAG_SYSTEM, manager_moduleload);
 		ast_manager_register_xml(MANAGER_COMMAND, "ModuleCheck", EVENT_FLAG_SYSTEM, manager_modulecheck);
 
+		ast_manager_register_xml(MANAGER_EVENT, "ExtensionStatus", 0, NULL);
+		ast_manager_register_xml(MANAGER_EVENT, "OriginateResponse", 0, NULL);
 		ast_manager_register_xml(MANAGER_EVENT, "Reload", 0, NULL);
 
 		ast_cli_register_multiple(cli_manager, ARRAY_LEN(cli_manager));

Modified: team/pabelanger/issue17173/main/xmldoc.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue17173/main/xmldoc.c?view=diff&rev=258973&r1=258972&r2=258973
==============================================================================
--- team/pabelanger/issue17173/main/xmldoc.c (original)
+++ team/pabelanger/issue17173/main/xmldoc.c Mon Apr 26 12:36:32 2010
@@ -990,10 +990,11 @@
  *  \brief Generate an AMI action syntax.
  *  \param fixnode The manager action node pointer.
  *  \param name The name of the manager action.
+ *  \param type The type of the manager action.
  *  \retval The generated syntax.
  *  \retval NULL on error.
  */
-static char *xmldoc_get_syntax_manager(struct ast_xml_node *fixnode, const char *name)
+static char *xmldoc_get_syntax_manager(struct ast_xml_node *fixnode, const char *name, char *type)
 {
 	struct ast_str *syntax;
 	struct ast_xml_node *node = fixnode;
@@ -1006,7 +1007,11 @@
 		return ast_strdup(name);
 	}
 
-	ast_str_append(&syntax, 0, "Action: %s", name);
+	if (type == "ami_command") {
+		ast_str_append(&syntax, 0, "Action: %s", name);
+	} else {
+		ast_str_append(&syntax, 0, "Event: %s", name);
+	}
 
 	for (node = ast_xml_node_get_children(node); node; node = ast_xml_node_get_next(node)) {
 		if (strcasecmp(ast_xml_node_get_name(node), "parameter")) {
@@ -1103,7 +1108,7 @@
 			syntax = xmldoc_get_syntax_cmd(node, name, 1);
 			break;
 		case MANAGER_SYNTAX:
-			syntax = xmldoc_get_syntax_manager(node, name);
+			syntax = xmldoc_get_syntax_manager(node, name, type);
 			break;
 		default:
 			syntax = xmldoc_get_syntax_fun(node, name, "parameter", 1, 1);




More information about the asterisk-commits mailing list