[asterisk-commits] anthonyl: branch anthonyl/verb-testing r42823 - in /team/anthonyl/verb-testin...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Sep 11 22:56:19 MST 2006


Author: anthonyl
Date: Tue Sep 12 00:56:18 2006
New Revision: 42823

URL: http://svn.digium.com/view/asterisk?rev=42823&view=rev
Log:
updating branch with with jasons  patch..

Modified:
    team/anthonyl/verb-testing/apps/app_meetme.c
    team/anthonyl/verb-testing/apps/app_mixmonitor.c
    team/anthonyl/verb-testing/apps/app_osplookup.c
    team/anthonyl/verb-testing/apps/app_playback.c
    team/anthonyl/verb-testing/apps/app_queue.c
    team/anthonyl/verb-testing/apps/app_realtime.c
    team/anthonyl/verb-testing/apps/app_rpt.c
    team/anthonyl/verb-testing/apps/app_voicemail.c
    team/anthonyl/verb-testing/channels/chan_agent.c
    team/anthonyl/verb-testing/channels/chan_alsa.c
    team/anthonyl/verb-testing/channels/chan_features.c
    team/anthonyl/verb-testing/channels/chan_h323.c
    team/anthonyl/verb-testing/channels/chan_iax2.c
    team/anthonyl/verb-testing/channels/chan_local.c
    team/anthonyl/verb-testing/channels/chan_mgcp.c
    team/anthonyl/verb-testing/channels/chan_misdn.c
    team/anthonyl/verb-testing/channels/chan_oss.c
    team/anthonyl/verb-testing/channels/chan_sip.c
    team/anthonyl/verb-testing/channels/chan_skinny.c
    team/anthonyl/verb-testing/channels/chan_zap.c
    team/anthonyl/verb-testing/channels/iax2-provision.c
    team/anthonyl/verb-testing/include/asterisk/cli.h
    team/anthonyl/verb-testing/main/asterisk.c
    team/anthonyl/verb-testing/main/astmm.c
    team/anthonyl/verb-testing/main/cdr.c
    team/anthonyl/verb-testing/main/channel.c
    team/anthonyl/verb-testing/main/cli.c
    team/anthonyl/verb-testing/main/config.c
    team/anthonyl/verb-testing/main/db.c
    team/anthonyl/verb-testing/main/dnsmgr.c
    team/anthonyl/verb-testing/main/file.c
    team/anthonyl/verb-testing/main/frame.c
    team/anthonyl/verb-testing/main/http.c
    team/anthonyl/verb-testing/main/image.c
    team/anthonyl/verb-testing/main/logger.c
    team/anthonyl/verb-testing/main/manager.c
    team/anthonyl/verb-testing/main/pbx.c
    team/anthonyl/verb-testing/main/rtp.c
    team/anthonyl/verb-testing/main/translate.c
    team/anthonyl/verb-testing/main/udptl.c
    team/anthonyl/verb-testing/pbx/pbx_ael.c
    team/anthonyl/verb-testing/pbx/pbx_config.c
    team/anthonyl/verb-testing/pbx/pbx_dundi.c
    team/anthonyl/verb-testing/res/res_agi.c
    team/anthonyl/verb-testing/res/res_clioriginate.c
    team/anthonyl/verb-testing/res/res_config_pgsql.c
    team/anthonyl/verb-testing/res/res_convert.c
    team/anthonyl/verb-testing/res/res_crypto.c
    team/anthonyl/verb-testing/res/res_features.c
    team/anthonyl/verb-testing/res/res_indications.c
    team/anthonyl/verb-testing/res/res_jabber.c
    team/anthonyl/verb-testing/res/res_musiconhold.c
    team/anthonyl/verb-testing/res/res_odbc.c

Modified: team/anthonyl/verb-testing/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_meetme.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_meetme.c (original)
+++ team/anthonyl/verb-testing/apps/app_meetme.c Tue Sep 12 00:56:18 2006
@@ -655,13 +655,6 @@
 	return cnf;
 }
 
-static int confs_show(int fd, int argc, char **argv)
-{
-	ast_cli(fd, "Deprecated! Please use 'meetme' instead.\n");
-
-	return RESULT_SUCCESS;
-}
-
 /*! \brief CLI command for showing SLAs */
 static int sla_show(int fd, int argc, char *argv[]) 
 {
@@ -687,23 +680,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char show_confs_usage[] =
-"Deprecated! Please use 'meetme' instead.\n";
-
-static struct ast_cli_entry cli_show_confs = {
-	{ "show", "conferences", NULL }, confs_show,
-	"Show status of conferences", show_confs_usage, NULL };
-
-
-static char sla_show_usage[] =
-"Usage: sla show\n"
-"       Lists status of all shared line appearances\n";
-
-static struct ast_cli_entry cli_sla_show = {
-	{ "sla", "show", NULL }, sla_show,
-	"Show status of Shared Line Appearances", sla_show_usage, NULL };
-
-static int conf_cmd(int fd, int argc, char **argv) 
+static int meetme_cmd(int fd, int argc, char **argv) 
 {
 	/* Process the command */
 	struct ast_conference *cnf;
@@ -847,7 +824,7 @@
 	return 0;
 }
 
-static char *complete_confcmd(const char *line, const char *word, int pos, int state)
+static char *complete_meetmecmd(const char *line, const char *word, int pos, int state)
 {
 	static char *cmds[] = {"lock", "unlock", "mute", "unmute", "kick", "list", NULL};
 
@@ -909,13 +886,23 @@
 	return NULL;
 }
 	
-static char conf_usage[] =
-"Usage: meetme  (un)lock|(un)mute|kick|list [concise] <confno> <usernumber>\n"
+static char meetme_usage[] =
+"Usage: meetme (un)lock|(un)mute|kick|list [concise] <confno> <usernumber>\n"
 "       Executes a command for the conference or on a conferee\n";
 
-static struct ast_cli_entry cli_conf = {
-	{"meetme", NULL, NULL }, conf_cmd,
-	"Execute a command on a conference or conferee", conf_usage, complete_confcmd};
+static char sla_show_usage[] =
+"Usage: sla show\n"
+"       Lists status of all shared line appearances\n";
+
+static struct ast_cli_entry cli_meetme[] = {
+	{ { "sla", "show", NULL },
+	sla_show, "Show status of Shared Line Appearances",
+	sla_show_usage, NULL },
+
+	{ { "meetme", NULL, NULL },
+	meetme_cmd, "Execute a command on a conference or conferee",
+	meetme_usage, complete_meetmecmd },
+};
 
 static void conf_flush(int fd, struct ast_channel *chan)
 {
@@ -3050,10 +3037,8 @@
 {
 	int res = 0;
 	
-	res |= ast_cli_unregister(&cli_show_confs);
-	res |= ast_cli_unregister(&cli_sla_show);
-	res |= ast_cli_unregister(&cli_conf);
-	res |= ast_manager_unregister("MeetmeMute");
+	ast_cli_unregister_multiple(cli_meetme, sizeof(cli_meetme) / sizeof(struct ast_cli_entry));
+	res = ast_manager_unregister("MeetmeMute");
 	res |= ast_manager_unregister("MeetmeUnmute");
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app2);
@@ -3073,10 +3058,8 @@
 	int res;
 
 	ASTOBJ_CONTAINER_INIT(&slas);
-	res = ast_cli_register(&cli_show_confs);
-	res |= ast_cli_register(&cli_sla_show);
-	res |= ast_cli_register(&cli_conf);
-	res |= ast_manager_register("MeetmeMute", EVENT_FLAG_CALL, action_meetmemute, "Mute a Meetme user");
+	ast_cli_register_multiple(cli_meetme, sizeof(cli_meetme) / sizeof(struct ast_cli_entry));
+	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_register_application(app3, admin_exec, synopsis3, descrip3);
 	res |= ast_register_application(app2, count_exec, synopsis2, descrip2);

Modified: team/anthonyl/verb-testing/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_mixmonitor.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_mixmonitor.c (original)
+++ team/anthonyl/verb-testing/apps/app_mixmonitor.c Tue Sep 12 00:56:18 2006
@@ -421,22 +421,21 @@
 	return ast_complete_channels(line, word, pos, state, 2);
 }
 
-static struct ast_cli_entry cli_mixmonitor = {
-	{ "mixmonitor", NULL, NULL },
-	mixmonitor_cli, 
-	"Execute a MixMonitor command.",
+static struct ast_cli_entry cli_mixmonitor[] = {
+	{ { "mixmonitor", NULL, NULL },
+	mixmonitor_cli, "Execute a MixMonitor command.",
 	"mixmonitor <start|stop> <chan_name> [args]\n\n"
 	"The optional arguments are passed to the\n"
 	"MixMonitor application when the 'start' command is used.\n",
-	complete_mixmonitor_cli
+	complete_mixmonitor_cli },
 };
 
 static int unload_module(void)
 {
 	int res;
 
-	res = ast_cli_unregister(&cli_mixmonitor);
-	res |= ast_unregister_application(stop_app);
+	ast_cli_unregister_multiple(cli_mixmonitor, sizeof(cli_mixmonitor) / sizeof(struct ast_cli_entry));
+	res = ast_unregister_application(stop_app);
 	res |= ast_unregister_application(app);
 	
 	ast_module_user_hangup_all();
@@ -448,8 +447,8 @@
 {
 	int res;
 
-	res = ast_cli_register(&cli_mixmonitor);
-	res |= ast_register_application(app, mixmonitor_exec, synopsis, desc);
+	ast_cli_register_multiple(cli_mixmonitor, sizeof(cli_mixmonitor) / sizeof(struct ast_cli_entry));
+	res = ast_register_application(app, mixmonitor_exec, synopsis, desc);
 	res |= ast_register_application(stop_app, stop_mixmonitor_exec, stop_synopsis, stop_desc);
 
 	return res;

Modified: team/anthonyl/verb-testing/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_osplookup.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_osplookup.c (original)
+++ team/anthonyl/verb-testing/apps/app_osplookup.c Tue Sep 12 00:56:18 2006
@@ -1596,11 +1596,10 @@
 "Usage: osp show\n"
 "       Displays information on Open Settlement Protocol support\n";
 
-static struct ast_cli_entry osp_cli = {
-	{"osp", "show", NULL}, 
-	osp_show, 
-	"Displays OSP information", 
-	osp_usage 
+static struct ast_cli_entry cli_osp[] = {
+	{ { "osp", "show", NULL},
+	osp_show, "Displays OSP information",
+	osp_usage },
 };
 
 static int load_module(void)
@@ -1610,8 +1609,8 @@
 	if(!osp_load())
 		return AST_MODULE_LOAD_DECLINE;
 
-	res = ast_cli_register(&osp_cli);
-	res |= ast_register_application(app1, ospauth_exec, synopsis1, descrip1);
+	ast_cli_register_multiple(cli_osp, sizeof(cli_osp) / sizeof(struct ast_cli_entry));
+	res = ast_register_application(app1, ospauth_exec, synopsis1, descrip1);
 	res |= ast_register_application(app2, osplookup_exec, synopsis2, descrip2);
 	res |= ast_register_application(app3, ospnext_exec, synopsis3, descrip3);
 	res |= ast_register_application(app4, ospfinished_exec, synopsis4, descrip4);
@@ -1627,7 +1626,7 @@
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app2);
 	res |= ast_unregister_application(app1);
-	res |= ast_cli_unregister(&osp_cli);
+	ast_cli_unregister_multiple(cli_osp, sizeof(cli_osp) / sizeof(struct ast_cli_entry));
 	osp_unload();
 
 	ast_module_user_hangup_all();

Modified: team/anthonyl/verb-testing/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_playback.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_playback.c (original)
+++ team/anthonyl/verb-testing/apps/app_playback.c Tue Sep 12 00:56:18 2006
@@ -371,8 +371,10 @@
 	return RESULT_SUCCESS;
 }
 
-static struct ast_cli_entry myclis[] = {
-        { { "say", "load", NULL }, __say_init, "set/show the say mode", "say load new|old" },
+static struct ast_cli_entry cli_playback[] = {
+        { { "say", "load", NULL },
+	__say_init, "set/show the say mode",
+	"say load new|old" },
 };
 
 static int playback_exec(struct ast_channel *chan, void *data)
@@ -478,7 +480,7 @@
 static int load_module(void)
 {
 	reload();
-        ast_cli_register_multiple(myclis, sizeof(myclis)/sizeof(struct ast_cli_entry));
+        ast_cli_register_multiple(cli_playback, sizeof(cli_playback) / sizeof(struct ast_cli_entry));
 	return ast_register_application(app, playback_exec, synopsis, descrip);
 }
 

Modified: team/anthonyl/verb-testing/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_queue.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_queue.c (original)
+++ team/anthonyl/verb-testing/apps/app_queue.c Tue Sep 12 00:56:18 2006
@@ -3941,7 +3941,7 @@
 	return RESULT_SUCCESS;
 }
 
-static int queues_show(int fd, int argc, char **argv)
+static int queue_list(int fd, int argc, char **argv)
 {
 	return __queues_show(NULL, 0, fd, argc, argv, 0);
 }
@@ -3975,7 +3975,7 @@
  */
 static int manager_queues_show( struct mansession *s, struct message *m )
 {
-	char *a[] = { "show", "queues" };
+	char *a[] = { "queue", "list" };
 
 	__queues_show(s, 1, -1, 2, a, 0);
 	astman_append(s, "\r\n\r\n");	/* Properly terminate Manager output */
@@ -4175,7 +4175,7 @@
 	return 0;
 }
 
-static int handle_add_queue_member(int fd, int argc, char *argv[])
+static int handle_queue_add_member(int fd, int argc, char *argv[])
 {
 	char *queuename, *interface;
 	int penalty;
@@ -4222,9 +4222,9 @@
 	}
 }
 
-static char *complete_add_queue_member(const char *line, const char *word, int pos, int state)
-{
-	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - to; 5 - <queue>; 6 - penalty; 7 - <penalty> */
+static char *complete_queue_add_member(const char *line, const char *word, int pos, int state)
+{
+	/* 0 - queue; 1 - add; 2 - member; 3 - <member>; 4 - to; 5 - <queue>; 6 - penalty; 7 - <penalty> */
 	switch (pos) {
 	case 3:	/* Don't attempt to complete name of member (infinite possibilities) */
 		return NULL;
@@ -4249,7 +4249,7 @@
 	}
 }
 
-static int handle_remove_queue_member(int fd, int argc, char *argv[])
+static int handle_queue_remove_member(int fd, int argc, char *argv[])
 {
 	char *queuename, *interface;
 
@@ -4280,13 +4280,13 @@
 	}
 }
 
-static char *complete_remove_queue_member(const char *line, const char *word, int pos, int state)
+static char *complete_queue_remove_member(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	struct call_queue *q;
 	struct member *m;
 
-	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - from; 5 - <queue> */
+	/* 0 - queue; 1 - remove; 2 - member; 3 - <member>; 4 - from; 5 - <queue> */
 	if (pos > 5 || pos < 3)
 		return NULL;
 	if (pos == 4)	/* only one possible match, 'from' */
@@ -4312,44 +4312,64 @@
 	return NULL;
 }
 
-static char show_queues_usage[] =
-"Usage: show queues\n"
+static char queue_list_usage[] =
+"Usage: queue list\n"
 "       Provides summary information on call queues.\n";
 
-static struct ast_cli_entry cli_show_queues = {
-	{ "show", "queues", NULL }, queues_show,
-	"Show status of queues", show_queues_usage, NULL };
-
-static char show_queue_usage[] =
-"Usage: show queue\n"
+static char queue_show_usage[] =
+"Usage: queue show\n"
 "       Provides summary information on a specified queue.\n";
 
-static struct ast_cli_entry cli_show_queue = {
-	{ "show", "queue", NULL }, queue_show,
-	"Show status of a specified queue", show_queue_usage, complete_queue };
-
-static char aqm_cmd_usage[] =
-"Usage: add queue member <channel> to <queue> [penalty <penalty>]\n";
-
-static struct ast_cli_entry cli_add_queue_member = {
-	{ "add", "queue", "member", NULL }, handle_add_queue_member,
-	"Add a channel to a specified queue", aqm_cmd_usage, complete_add_queue_member };
-
-static char rqm_cmd_usage[] =
-"Usage: remove queue member <channel> from <queue>\n";
-
-static struct ast_cli_entry cli_remove_queue_member = {
-	{ "remove", "queue", "member", NULL }, handle_remove_queue_member,
-	"Removes a channel from a specified queue", rqm_cmd_usage, complete_remove_queue_member };
+static char qam_cmd_usage[] =
+"Usage: queue add member <channel> to <queue> [penalty <penalty>]\n";
+
+static char qrm_cmd_usage[] =
+"Usage: queue remove member <channel> from <queue>\n";
+
+static struct ast_cli_entry cli_show_queues_deprecated = {
+	{ "show", "queues", NULL },
+	queue_list, NULL,
+	NULL, NULL };
+
+static struct ast_cli_entry cli_show_queue_deprecated = {
+	{ "show", "queue", NULL },
+	queue_show, NULL,
+	NULL, complete_queue };
+
+static struct ast_cli_entry cli_add_queue_member_deprecated = {
+	{ "add", "queue", "member", NULL },
+	handle_queue_add_member, NULL,
+	NULL, complete_queue_add_member };
+
+static struct ast_cli_entry cli_remove_queue_member_deprecated = {
+	{ "remove", "queue", "member", NULL },
+	handle_queue_remove_member, NULL,
+	NULL, complete_queue_remove_member };
+
+static struct ast_cli_entry cli_queue[] = {
+	{ { "queue", "list", NULL },
+	queue_list, "Show status of queues",
+	queue_list_usage, NULL, &cli_show_queues_deprecated },
+
+	{ { "queue", "show", NULL },
+	queue_show, "Show status of a specified queue",
+	queue_show_usage, complete_queue, &cli_show_queue_deprecated },
+
+	{ { "queue", "add", "member", NULL },
+	handle_queue_add_member, "Add a channel to a specified queue",
+	qam_cmd_usage, complete_queue_add_member, &cli_add_queue_member_deprecated },
+
+	{ { "queue", "remove", "member", NULL },
+	handle_queue_remove_member, "Removes a channel from a specified queue",
+	qrm_cmd_usage, complete_queue_remove_member, &cli_remove_queue_member_deprecated },
+};
 
 static int unload_module(void)
 {
 	int res;
 
-	res = ast_cli_unregister(&cli_show_queue);
-	res |= ast_cli_unregister(&cli_show_queues);
-	res |= ast_cli_unregister(&cli_add_queue_member);
-	res |= ast_cli_unregister(&cli_remove_queue_member);
+	ast_cli_unregister_multiple(cli_queue, sizeof(cli_queue) / sizeof(struct ast_cli_entry));
+	res = ast_manager_unregister("QueueStatus");
 	res |= ast_manager_unregister("Queues");
 	res |= ast_manager_unregister("QueueStatus");
 	res |= ast_manager_unregister("QueueAdd");
@@ -4360,11 +4380,11 @@
 	res |= ast_unregister_application(app_pqm);
 	res |= ast_unregister_application(app_upqm);
 	res |= ast_unregister_application(app_ql);
+	res |= ast_unregister_application(app);
 	res |= ast_custom_function_unregister(&queueagentcount_function);
 	res |= ast_custom_function_unregister(&queuemembercount_function);
 	res |= ast_custom_function_unregister(&queuememberlist_function);
 	res |= ast_custom_function_unregister(&queuewaitingcount_function);
-	res |= ast_unregister_application(app);
 
 	ast_module_user_hangup_all();
 
@@ -4380,21 +4400,18 @@
 		return AST_MODULE_LOAD_DECLINE;
 	if (queue_persistent_members)
 		reload_queue_members();
+	ast_cli_register_multiple(cli_queue, sizeof(cli_queue) / sizeof(struct ast_cli_entry));
 	res = ast_register_application(app, queue_exec, synopsis, descrip);
-	res |= ast_cli_register(&cli_show_queue);
-	res |= ast_cli_register(&cli_show_queues);
-	res |= ast_cli_register(&cli_add_queue_member);
-	res |= ast_cli_register(&cli_remove_queue_member);
+	res |= ast_register_application(app_aqm, aqm_exec, app_aqm_synopsis, app_aqm_descrip);
+	res |= ast_register_application(app_rqm, rqm_exec, app_rqm_synopsis, app_rqm_descrip);
+	res |= ast_register_application(app_pqm, pqm_exec, app_pqm_synopsis, app_pqm_descrip);
+	res |= ast_register_application(app_upqm, upqm_exec, app_upqm_synopsis, app_upqm_descrip);
+	res |= ast_register_application(app_ql, ql_exec, app_ql_synopsis, app_ql_descrip);
 	res |= ast_manager_register("Queues", 0, manager_queues_show, "Queues");
 	res |= ast_manager_register("QueueStatus", 0, manager_queues_status, "Queue Status");
 	res |= ast_manager_register("QueueAdd", EVENT_FLAG_AGENT, manager_add_queue_member, "Add interface to queue.");
 	res |= ast_manager_register("QueueRemove", EVENT_FLAG_AGENT, manager_remove_queue_member, "Remove interface from queue.");
 	res |= ast_manager_register("QueuePause", EVENT_FLAG_AGENT, manager_pause_queue_member, "Makes a queue member temporarily unavailable");
-	res |= ast_register_application(app_aqm, aqm_exec, app_aqm_synopsis, app_aqm_descrip);
-	res |= ast_register_application(app_rqm, rqm_exec, app_rqm_synopsis, app_rqm_descrip);
-	res |= ast_register_application(app_pqm, pqm_exec, app_pqm_synopsis, app_pqm_descrip);
-	res |= ast_register_application(app_upqm, upqm_exec, app_upqm_synopsis, app_upqm_descrip);
-	res |= ast_register_application(app_ql, ql_exec, app_ql_synopsis, app_ql_descrip);
 	res |= ast_custom_function_register(&queueagentcount_function);
 	res |= ast_custom_function_register(&queuemembercount_function);
 	res |= ast_custom_function_register(&queuememberlist_function);

Modified: team/anthonyl/verb-testing/apps/app_realtime.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_realtime.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_realtime.c (original)
+++ team/anthonyl/verb-testing/apps/app_realtime.c Tue Sep 12 00:56:18 2006
@@ -69,7 +69,7 @@
 "updated or -1 if an error occurs.\n";
 
 
-static int cli_load_realtime(int fd, int argc, char **argv) 
+static int cli_realtime_load(int fd, int argc, char **argv) 
 {
 	char *header_format = "%30s  %-30s\n";
 	struct ast_variable *var=NULL;
@@ -94,7 +94,7 @@
 	return RESULT_SUCCESS;
 }
 
-static int cli_update_realtime(int fd, int argc, char **argv) {
+static int cli_realtime_update(int fd, int argc, char **argv) {
 	int res = 0;
 
 	if(argc<7) {
@@ -115,21 +115,23 @@
 	return RESULT_SUCCESS;
 }
 
-static char cli_load_realtime_usage[] =
+static char cli_realtime_load_usage[] =
 "Usage: realtime load <family> <colmatch> <value>\n"
 "       Prints out a list of variables using the RealTime driver.\n";
 
-static struct ast_cli_entry cli_load_realtime_cmd = {
-        { "realtime", "load", NULL, NULL }, cli_load_realtime,
-        "Used to print out RealTime variables.", cli_load_realtime_usage, NULL };
-
-static char cli_update_realtime_usage[] =
+static char cli_realtime_update_usage[] =
 "Usage: realtime update <family> <colmatch> <value>\n"
 "       Update a single variable using the RealTime driver.\n";
 
-static struct ast_cli_entry cli_update_realtime_cmd = {
-        { "realtime", "update", NULL, NULL }, cli_update_realtime,
-        "Used to update RealTime variables.", cli_update_realtime_usage, NULL };
+static struct ast_cli_entry cli_realtime[] = {
+	{ { "realtime", "load", NULL, NULL },
+	cli_realtime_load, "Used to print out RealTime variables.",
+	cli_realtime_load_usage, NULL },
+
+	{ { "realtime", "update", NULL, NULL },
+	cli_realtime_update, "Used to update RealTime variables.",
+	cli_realtime_update_usage, NULL },
+};
 
 static int realtime_update_exec(struct ast_channel *chan, void *data) 
 {
@@ -236,9 +238,8 @@
 {
 	int res;
 
-	res = ast_cli_unregister(&cli_load_realtime_cmd);
-	res |= ast_cli_unregister(&cli_update_realtime_cmd);
-	res |= ast_unregister_application(uapp);
+	ast_cli_unregister_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
+	res = ast_unregister_application(uapp);
 	res |= ast_unregister_application(app);
 
 	ast_module_user_hangup_all();
@@ -250,9 +251,8 @@
 {
 	int res;
 
-	res = ast_cli_register(&cli_load_realtime_cmd);
-	res |= ast_cli_register(&cli_update_realtime_cmd);
-	res |= ast_register_application(uapp, realtime_update_exec, usynopsis, udesc);
+	ast_cli_register_multiple(cli_realtime, sizeof(cli_realtime) / sizeof(struct ast_cli_entry));
+	res = ast_register_application(uapp, realtime_update_exec, usynopsis, udesc);
 	res |= ast_register_application(app, realtime_exec, synopsis, desc);
 
 	return res;

Modified: team/anthonyl/verb-testing/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_rpt.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_rpt.c (original)
+++ team/anthonyl/verb-testing/apps/app_rpt.c Tue Sep 12 00:56:18 2006
@@ -726,29 +726,30 @@
 "Usage: rpt restart\n"
 "       Restarts app_rpt\n";
 
-static struct ast_cli_entry  cli_debug =
-        { { "rpt", "debug", "level" }, rpt_do_debug, 
-		"Enable app_rpt debugging", debug_usage };
-
-static struct ast_cli_entry  cli_dump =
-        { { "rpt", "dump" }, rpt_do_dump,
-		"Dump app_rpt structs for debugging", dump_usage };
-
-static struct ast_cli_entry  cli_stats =
-        { { "rpt", "stats" }, rpt_do_stats,
-		"Dump node statistics", dump_stats };
-
-static struct ast_cli_entry  cli_lstats =
-        { { "rpt", "lstats" }, rpt_do_lstats,
-		"Dump link statistics", dump_lstats };
-
-static struct ast_cli_entry  cli_reload =
-        { { "rpt", "reload" }, rpt_do_reload,
-		"Reload app_rpt config", reload_usage };
-
-static struct ast_cli_entry  cli_restart =
-        { { "rpt", "restart" }, rpt_do_restart,
-		"Restart app_rpt", restart_usage };
+static struct ast_cli_entry cli_rpt[] = {
+	{ { "rpt", "debug", "level" },
+	rpt_do_debug, "Enable app_rpt debugging",
+	debug_usage },
+
+        { { "rpt", "dump" },
+	rpt_do_dump, "Dump app_rpt structs for debugging",
+	dump_usage },
+
+        { { "rpt", "stats" },
+	rpt_do_stats, "Dump node statistics",
+	dump_stats },
+        { { "rpt", "lstats" },
+	rpt_do_lstats, "Dump link statistics",
+	dump_lstats },
+
+        { { "rpt", "reload" },
+	rpt_do_reload, "Reload app_rpt config",
+	reload_usage },
+
+        { { "rpt", "restart" },
+	rpt_do_restart, "Restart app_rpt",
+	restart_usage },
+};
 
 /*
 * Telemetry defaults
@@ -8018,12 +8019,7 @@
 	i = ast_unregister_application(app);
 
 	/* Unregister cli extensions */
-	ast_cli_unregister(&cli_debug);
-	ast_cli_unregister(&cli_dump);
-	ast_cli_unregister(&cli_stats);
-	ast_cli_unregister(&cli_lstats);
-	ast_cli_unregister(&cli_reload);
-	ast_cli_unregister(&cli_restart);
+	ast_cli_unregister_multiple(cli_rpt, sizeof(cli_rpt) / sizeof(struct ast_cli_entry));
 
 	return i;
 }
@@ -8038,12 +8034,7 @@
 	ast_pthread_create(&rpt_master_thread,NULL,rpt_master,cfg);
 
 	/* Register cli extensions */
-	ast_cli_register(&cli_debug);
-	ast_cli_register(&cli_dump);
-	ast_cli_register(&cli_stats);
-	ast_cli_register(&cli_lstats);
-	ast_cli_register(&cli_reload);
-	ast_cli_register(&cli_restart);
+	ast_cli_register_multiple(cli_rpt, sizeof(cli_rpt) / sizeof(struct ast_cli_entry));
 
 	return ast_register_application(app, rpt_exec, synopsis, descrip);
 }

Modified: team/anthonyl/verb-testing/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/apps/app_voicemail.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/apps/app_voicemail.c (original)
+++ team/anthonyl/verb-testing/apps/app_voicemail.c Tue Sep 12 00:56:18 2006
@@ -6688,15 +6688,15 @@
 	return res;
 }
 
-static char show_voicemail_users_help[] =
-"Usage: show voicemail users [for <context>]\n"
+static char voicemail_show_users_help[] =
+"Usage: voicemail list users [for <context>]\n"
 "       Lists all mailboxes currently set up\n";
 
-static char show_voicemail_zones_help[] =
-"Usage: show voicemail zones\n"
+static char voicemail_show_zones_help[] =
+"Usage: voicemail list zones\n"
 "       Lists zone message formats\n";
 
-static int handle_show_voicemail_users(int fd, int argc, char *argv[])
+static int handle_voicemail_show_users(int fd, int argc, char *argv[])
 {
 	struct ast_vm_user *vmu;
 	char *output_format = "%-10s %-5s %-25s %-10s %6s\n";
@@ -6751,7 +6751,7 @@
 	return RESULT_SUCCESS;
 }
 
-static int handle_show_voicemail_zones(int fd, int argc, char *argv[])
+static int handle_voicemail_show_zones(int fd, int argc, char *argv[])
 {
 	struct vm_zone *zone;
 	char *output_format = "%-15s %-20s %-45s\n";
@@ -6775,7 +6775,7 @@
 	return res;
 }
 
-static char *complete_show_voicemail_users(const char *line, const char *word, int pos, int state)
+static char *complete_voicemail_show_users(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	int wordlen;
@@ -6799,15 +6799,25 @@
 	return NULL;
 }
 
-static struct ast_cli_entry show_voicemail_users_cli =
-	{ { "show", "voicemail", "users", NULL },
-	handle_show_voicemail_users, "List defined voicemail boxes",
-	show_voicemail_users_help, complete_show_voicemail_users };
-
-static struct ast_cli_entry show_voicemail_zones_cli =
-	{ { "show", "voicemail", "zones", NULL },
-	handle_show_voicemail_zones, "List zone message formats",
-	show_voicemail_zones_help, NULL };
+static struct ast_cli_entry cli_show_voicemail_users_deprecated = {
+	{ "show", "voicemail", "users", NULL },
+	handle_voicemail_show_users, NULL,
+	NULL, complete_voicemail_show_users };
+
+static struct ast_cli_entry cli_show_voicemail_zones_deprecated = {
+	{ "show", "voicemail", "zones", NULL },
+	handle_voicemail_show_zones, NULL,
+	NULL, NULL };
+
+static struct ast_cli_entry cli_voicemail[] = {
+	{ { "voicemail", "list", "users", NULL },
+	handle_voicemail_show_users, "List defined voicemail boxes",
+	voicemail_show_users_help, complete_voicemail_show_users, &cli_show_voicemail_users_deprecated },
+
+	{ { "voicemail", "list", "zones", NULL },
+	handle_voicemail_show_zones, "List zone message formats",
+	voicemail_show_zones_help, NULL, &cli_show_voicemail_zones_deprecated },
+};
 
 static int load_config(void)
 {
@@ -7321,8 +7331,7 @@
 	res |= ast_unregister_application(app2);
 	res |= ast_unregister_application(app3);
 	res |= ast_unregister_application(app4);
-	res |= ast_cli_unregister(&show_voicemail_users_cli);
-	res |= ast_cli_unregister(&show_voicemail_zones_cli);
+	ast_cli_unregister_multiple(cli_voicemail, sizeof(cli_voicemail) / sizeof(struct ast_cli_entry));
 	ast_uninstall_vm_functions();
 	
 	ast_module_user_hangup_all();
@@ -7344,8 +7353,7 @@
 		return(res);
 	}
 
-	ast_cli_register(&show_voicemail_users_cli);
-	ast_cli_register(&show_voicemail_zones_cli);
+	ast_cli_register_multiple(cli_voicemail, sizeof(cli_voicemail) / sizeof(struct ast_cli_entry));
 
 	/* compute the location of the voicemail spool directory */
 	snprintf(VM_SPOOL_DIR, sizeof(VM_SPOOL_DIR), "%s/voicemail/", ast_config_AST_SPOOL_DIR);

Modified: team/anthonyl/verb-testing/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/channels/chan_agent.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/channels/chan_agent.c (original)
+++ team/anthonyl/verb-testing/channels/chan_agent.c Tue Sep 12 00:56:18 2006
@@ -1685,11 +1685,11 @@
 
 
 static char show_agents_usage[] = 
-"Usage: show agents\n"
+"Usage: agent list\n"
 "       Provides summary information on agents.\n";
 
 static char show_agents_online_usage[] =
-"Usage: show agents\n"
+"Usage: agent list online\n"
 "	Provides a list of all online agents.\n";
 
 static char agent_logoff_usage[] =
@@ -1697,17 +1697,29 @@
 "       Sets an agent as no longer logged in.\n"
 "       If 'soft' is specified, do not hangup existing calls.\n";
 
-static struct ast_cli_entry cli_show_agents = {
-	{ "show", "agents", NULL }, agents_show, 
-	"Show status of agents", show_agents_usage, NULL };
-
-static struct ast_cli_entry cli_show_agents_online = {
-	{ "show", "agents", "online" }, agents_show_online,
-	"Show all online agents", show_agents_online_usage, NULL };
-
-static struct ast_cli_entry cli_agent_logoff = {
-	{ "agent", "logoff", NULL }, agent_logoff_cmd, 
-	"Sets an agent offline", agent_logoff_usage, complete_agent_logoff_cmd };
+static struct ast_cli_entry cli_show_agents_deprecated = {
+	{ "show", "agents", NULL },
+	agents_show, NULL,
+	NULL, NULL };
+
+static struct ast_cli_entry cli_show_agents_online_deprecated = {
+	{ "show", "agents", "online" },
+	agents_show_online, NULL,
+	NULL, NULL };
+
+static struct ast_cli_entry cli_agents[] = {
+	{ { "agent", "list", NULL },
+	agents_show, "Show status of agents",
+	show_agents_usage, NULL, &cli_show_agents_deprecated },
+
+	{ { "agent", "list", "online" },
+	agents_show_online, "Show all online agents",
+	show_agents_online_usage, NULL, &cli_show_agents_online_deprecated },
+
+	{ { "agent", "logoff", NULL },
+	agent_logoff_cmd, "Sets an agent offline",
+	agent_logoff_usage, complete_agent_logoff_cmd },
+};
 
 /*!
  * \brief Log in agent application.
@@ -2563,9 +2575,7 @@
 	ast_manager_register2("AgentCallbackLogin", EVENT_FLAG_AGENT, action_agent_callback_login, "Sets an agent as logged in by callback", mandescr_agent_callback_login);
 
 	/* CLI Commands */
-	ast_cli_register(&cli_show_agents);
-	ast_cli_register(&cli_show_agents_online);
-	ast_cli_register(&cli_agent_logoff);
+	ast_cli_register_multiple(cli_agents, sizeof(cli_agents) / sizeof(struct ast_cli_entry));
 
 	/* Dialplan Functions */
 	ast_custom_function_register(&agent_function);
@@ -2589,9 +2599,7 @@
 	/* Unregister dialplan functions */
 	ast_custom_function_unregister(&agent_function);	
 	/* Unregister CLI commands */
-	ast_cli_unregister(&cli_show_agents);
-	ast_cli_unregister(&cli_show_agents_online);
-	ast_cli_unregister(&cli_agent_logoff);
+	ast_cli_unregister_multiple(cli_agents, sizeof(cli_agents) / sizeof(struct ast_cli_entry));
 	/* Unregister dialplan applications */
 	ast_unregister_application(app);
 	ast_unregister_application(app2);

Modified: team/anthonyl/verb-testing/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/channels/chan_alsa.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/channels/chan_alsa.c (original)
+++ team/anthonyl/verb-testing/channels/chan_alsa.c Tue Sep 12 00:56:18 2006
@@ -841,7 +841,7 @@
 	return tmp;
 }
 
-static int console_autoanswer(int fd, int argc, char *argv[])
+static int console_autoanswer_deprecated(int fd, int argc, char *argv[])
 {
 	int res = RESULT_SUCCESS;
 
@@ -863,6 +863,26 @@
 
 	ast_mutex_unlock(&alsalock);
 
+	return res;
+}
+
+static int console_autoanswer(int fd, int argc, char *argv[])
+{
+	int res = RESULT_SUCCESS;;
+	if ((argc != 2) && (argc != 3))
+		return RESULT_SHOWUSAGE;
+	ast_mutex_lock(&alsalock);
+	if (argc == 2) {
+		ast_cli(fd, "Auto answer is %s.\n", autoanswer ? "on" : "off");
+	} else {
+		if (!strcasecmp(argv[2], "on"))
+			autoanswer = -1;
+		else if (!strcasecmp(argv[2], "off"))
+			autoanswer = 0;
+		else
+			res = RESULT_SHOWUSAGE;
+	}
+	ast_mutex_unlock(&alsalock);
 	return res;
 }
 

Modified: team/anthonyl/verb-testing/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/channels/chan_features.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/channels/chan_features.c (original)
+++ team/anthonyl/verb-testing/channels/chan_features.c Tue Sep 12 00:56:18 2006
@@ -530,12 +530,19 @@
 }
 
 static char show_features_usage[] = 
-"Usage: feature show channels\n"
+"Usage: feature list channels\n"
 "       Provides summary information on feature channels.\n";
 
-static struct ast_cli_entry cli_show_features = {
-	{ "feature", "show", "channels", NULL }, features_show, 
-	"Show status of feature channels", show_features_usage, NULL };
+static struct ast_cli_entry cli_features_show_channels_deprecated = {
+	{ "feature", "show", "channels", NULL },
+	features_show, NULL,
+	NULL };
+
+static struct ast_cli_entry cli_features[] = {
+	{ { "feature", "list", "channels", NULL },
+	features_show, "List status of feature channels",
+	show_features_usage, NULL, &cli_features_show_channels_deprecated },
+};
 
 static int load_module(void)
 {
@@ -544,7 +551,7 @@
 		ast_log(LOG_ERROR, "Unable to register channel class 'Feature'\n");
 		return -1;
 	}
-	ast_cli_register(&cli_show_features);
+	ast_cli_register_multiple(cli_features, sizeof(cli_features) / sizeof(struct ast_cli_entry));
 	return 0;
 }
 
@@ -553,7 +560,7 @@
 	struct feature_pvt *p;
 	
 	/* First, take us out of the channel loop */
-	ast_cli_unregister(&cli_show_features);
+	ast_cli_unregister_multiple(cli_features, sizeof(cli_features) / sizeof(struct ast_cli_entry));
 	ast_channel_unregister(&features_tech);
 	
 	if (!AST_LIST_LOCK(&features))

Modified: team/anthonyl/verb-testing/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/channels/chan_h323.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================
--- team/anthonyl/verb-testing/channels/chan_h323.c (original)
+++ team/anthonyl/verb-testing/channels/chan_h323.c Tue Sep 12 00:56:18 2006
@@ -1821,22 +1821,43 @@
 "Usage: h323 reload\n"
 "       Reloads H.323 configuration from sip.conf\n";
 
-static struct ast_cli_entry  cli_trace =
-	{ { "h.323", "trace", NULL }, h323_do_trace, "Enable H.323 Stack Tracing", trace_usage };
-static struct ast_cli_entry  cli_no_trace =
-	{ { "h.323", "no", "trace", NULL }, h323_no_trace, "Disable H.323 Stack Tracing", no_trace_usage };
-static struct ast_cli_entry  cli_debug =
-	{ { "h.323", "debug", NULL }, h323_do_debug, "Enable H.323 debug", debug_usage };
-static struct ast_cli_entry  cli_no_debug =
-	{ { "h.323", "no", "debug", NULL }, h323_no_debug, "Disable H.323 debug", no_debug_usage };
-static struct ast_cli_entry  cli_show_codecs =
-	{ { "h.323", "show", "codecs", NULL }, h323_show_codec, "Show enabled codecs", show_codec_usage };
-static struct ast_cli_entry  cli_gk_cycle =
-	{ { "h.323", "gk", "cycle", NULL }, h323_gk_cycle, "Manually re-register with the Gatekeper", show_cycle_usage };
-static struct ast_cli_entry  cli_hangup_call =
-	{ { "h.323", "hangup", NULL }, h323_ep_hangup, "Manually try to hang up a call", show_hangup_usage };
-static struct ast_cli_entry  cli_show_tokens =
-	{ { "h.323", "show", "tokens", NULL }, h323_tokens_show, "Show all active call tokens", show_tokens_usage };
+static struct ast_cli_entry  cli_h323[] = {
+	{ { "h.323", "trace", NULL },
+	h323_do_trace, "Enable H.323 Stack Tracing",
+	trace_usage },
+
+	{ { "h.323", "no", "trace", NULL },
+	h323_no_trace, "Disable H.323 Stack Tracing",
+	no_trace_usage },
+
+	{ { "h.323", "debug", NULL },
+	h323_do_debug, "Enable H.323 debug",
+	debug_usage },
+
+	{ { "h.323", "no", "debug", NULL },
+	h323_no_debug, "Disable H.323 debug",
+	no_debug_usage },
+
+	{ { "h.323", "show", "codecs", NULL },
+	h323_show_codec, "Show enabled codecs",
+	show_codec_usage },
+
+	{ { "h.323", "gk", "cycle", NULL },
+	h323_gk_cycle, "Manually re-register with the Gatekeper",
+	show_cycle_usage },
+
+	{ { "h.323", "hangup", NULL },
+	h323_ep_hangup, "Manually try to hang up a call",
+	show_hangup_usage },
+
+	{ { "h.323", "show", "tokens", NULL },
+	h323_tokens_show, "Show all active call tokens",
+	show_tokens_usage },
+
+	{ { "h.323", "reload", NULL },
+	h323_reload, "Reload H.323 configuration",
+	h323_reload_usage },
+};
 
 static int update_common_options(struct ast_variable *v, struct call_options *options)
 {
@@ -2298,9 +2319,6 @@
 	return h323_reload(0, 0, NULL);
 }
 
-static struct ast_cli_entry  cli_h323_reload =
-	{ { "h.323", "reload", NULL }, h323_reload, "Reload H.323 configuration", h323_reload_usage };
-
 static struct ast_rtp *oh323_get_rtp_peer(struct ast_channel *chan)
 {
 	struct oh323_pvt *pvt;
@@ -2397,15 +2415,7 @@
 			h323_end_process();
 			return -1;
 		}
-		ast_cli_register(&cli_debug);
-		ast_cli_register(&cli_no_debug);
-		ast_cli_register(&cli_trace);
-		ast_cli_register(&cli_no_trace);
-		ast_cli_register(&cli_show_codecs);
-		ast_cli_register(&cli_gk_cycle);
-		ast_cli_register(&cli_hangup_call);
-		ast_cli_register(&cli_show_tokens);
-		ast_cli_register(&cli_h323_reload);
+		ast_cli_register_multiple(cli_h323, sizeof(cli_h323) / sizeof(struct ast_cli_entry));
 
 		ast_rtp_proto_register(&oh323_rtp);
 
@@ -2446,15 +2456,7 @@
 	struct oh323_pvt *p, *pl;
 
 	/* unregister commands */
-	ast_cli_unregister(&cli_debug);
-	ast_cli_unregister(&cli_no_debug);
-	ast_cli_unregister(&cli_trace);
-	ast_cli_unregister(&cli_no_trace);   
-	ast_cli_unregister(&cli_show_codecs);
-	ast_cli_unregister(&cli_gk_cycle);
-	ast_cli_unregister(&cli_hangup_call);
-	ast_cli_unregister(&cli_show_tokens);
-	ast_cli_unregister(&cli_h323_reload);
+	ast_cli_unregister_multiple(cli_h323, sizeof(cli_h323) / sizeof(struct ast_cli_entry));
 	ast_rtp_proto_unregister(&oh323_rtp);
 	ast_channel_unregister(&oh323_tech);
 		

Modified: team/anthonyl/verb-testing/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/verb-testing/channels/chan_iax2.c?rev=42823&r1=42822&r2=42823&view=diff
==============================================================================

[... 6315 lines stripped ...]


More information about the asterisk-commits mailing list