[asterisk-commits] tzafrir: branch tzafrir/docs r121081 - in /team/tzafrir/docs: apps/ include/a...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Jun 7 09:35:30 CDT 2008
Author: tzafrir
Date: Sat Jun 7 09:35:29 2008
New Revision: 121081
URL: http://svn.digium.com/view/asterisk?view=rev&rev=121081
Log:
Manager commands documentation macros in manager.h and tested in
app_meetme.c:
* AST_MANAGER_CMD_INFO: collect together all the documentation.
* AST_MANAGER_REGISTER: a wrapper for ast_manager_register2 with the
information from the above.
* NO_MANAGER_DESCRIPTION_YET: A canned (non-)description. To avoid using
ast_manager_register .
Modified:
team/tzafrir/docs/apps/app_meetme.c
team/tzafrir/docs/include/asterisk/manager.h
Modified: team/tzafrir/docs/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/tzafrir/docs/apps/app_meetme.c?view=diff&rev=121081&r1=121080&r2=121081
==============================================================================
--- team/tzafrir/docs/apps/app_meetme.c (original)
+++ team/tzafrir/docs/apps/app_meetme.c Sat Jun 7 09:35:29 2008
@@ -3531,13 +3531,26 @@
return meetmemute(s, m, 0);
}
-static char mandescr_meetmelist[] =
+
+AST_MANAGER_CMD_INFO(meetme_mute, "MeetmeMute",
+"Mute a Meetme user",
+NO_MANAGER_DESCRIPTION_YET
+);
+
+AST_MANAGER_CMD_INFO(meetme_unmute, "MeetmeUnmute",
+"Unmute a Meetme user",
+NO_MANAGER_DESCRIPTION_YET
+);
+
+AST_MANAGER_CMD_INFO(meetme_list, "MeetmeList",
+"List participants in a conference",
"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";
+" *Conference: <confno>\n"
+);
static int action_meetmelist(struct mansession *s, const struct message *m)
{
@@ -5691,12 +5704,12 @@
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(meetme_mute, EVENT_FLAG_CALL,
+ action_meetmemute);
+ res |= AST_MANAGER_REGISTER(meetme_unmute, EVENT_FLAG_CALL,
+ action_meetmeunmute);
+ res |= AST_MANAGER_REGISTER(meetme_list, EVENT_FLAG_REPORTING,
+ action_meetmelist);
res |= ast_register_application(app4, channel_admin_exec, synopsis4, descrip4);
res |= ast_register_application(app3, admin_exec, synopsis3, descrip3);
res |= ast_register_application(app2, count_exec, synopsis2, descrip2);
Modified: team/tzafrir/docs/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/team/tzafrir/docs/include/asterisk/manager.h?view=diff&rev=121081&r1=121080&r2=121081
==============================================================================
--- team/tzafrir/docs/include/asterisk/manager.h (original)
+++ team/tzafrir/docs/include/asterisk/manager.h Sat Jun 7 09:35:29 2008
@@ -212,4 +212,21 @@
/*! \brief Called by Asterisk module functions and the CLI command */
int reload_manager(void);
+/*! Collect documentation of a manager command */
+#define AST_MANAGER_CMD_INFO(name,name_str,syn_str,desc_str) \
+ static char *name = name_str; \
+ static char *manager_synopsis_ ##name = syn_str; \
+ static char *manager_description_ ##name = desc_str; \
+
+/*! Wrapper to ast_manager_register2() for use with information from
+ * AST_MANAGER_CMD_INFO
+ */
+#define AST_MANAGER_REGISTER(name,flags,func) \
+ ast_manager_register2(name, flags, func, \
+ manager_synopsis_ ##name, manager_description_ ##name);
+
+#define NO_MANAGER_DESCRIPTION_YET \
+ "This manager action is not yet documented.\n" \
+ "Patches are welcomed .\n"
+
#endif /* _ASTERISK_MANAGER_H */
More information about the asterisk-commits
mailing list