[asterisk-commits] mvanbaak: branch group/res_clialiases r145122 - in /team/group/res_clialiases...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Sep 28 18:35:02 CDT 2008


Author: mvanbaak
Date: Sun Sep 28 18:35:02 2008
New Revision: 145122

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145122
Log:
Merged revisions 144879 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r144879 | mvanbaak | 2008-09-27 02:49:24 +0200 (Sat, 27 Sep 2008) | 2 lines

fix a couple of CLI commands that did not have a help description.

........

Modified:
    team/group/res_clialiases/   (props changed)
    team/group/res_clialiases/apps/app_meetme.c
    team/group/res_clialiases/apps/app_mixmonitor.c
    team/group/res_clialiases/apps/app_queue.c
    team/group/res_clialiases/channels/chan_console.c
    team/group/res_clialiases/channels/chan_dahdi.c
    team/group/res_clialiases/channels/chan_features.c
    team/group/res_clialiases/channels/chan_h323.c
    team/group/res_clialiases/channels/chan_misdn.c
    team/group/res_clialiases/channels/chan_oss.c
    team/group/res_clialiases/channels/chan_unistim.c
    team/group/res_clialiases/main/astobj2.c
    team/group/res_clialiases/main/cli.c
    team/group/res_clialiases/main/manager.c
    team/group/res_clialiases/main/taskprocessor.c
    team/group/res_clialiases/res/ais/clm.c
    team/group/res_clialiases/res/ais/evt.c
    team/group/res_clialiases/res/res_agi.c
    team/group/res_clialiases/res/res_clioriginate.c
    team/group/res_clialiases/res/res_config_ldap.c
    team/group/res_clialiases/res/res_config_pgsql.c

Propchange: team/group/res_clialiases/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Sep 28 18:35:02 2008
@@ -1,1 +1,1 @@
-/trunk:1-145087
+/trunk:1-145121

Modified: team/group/res_clialiases/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/apps/app_meetme.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/apps/app_meetme.c (original)
+++ team/group/res_clialiases/apps/app_meetme.c Sun Sep 28 18:35:02 2008
@@ -883,7 +883,6 @@
 	return cnf;
 }
 
-
 static char *complete_meetmecmd(const char *line, const char *word, int pos, int state)
 {
 	static char *cmds[] = {"concise", "lock", "unlock", "mute", "unmute", "kick", "list", NULL};
@@ -946,11 +945,10 @@
 	return NULL;
 }
 
-static char *meetme_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *meetme_show_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	/* Process the command */
 	struct ast_conference *cnf;
-	struct ast_conf_user *user;
 	int hr, min, sec;
 	int i = 0, total = 0;
 	time_t now;
@@ -960,17 +958,15 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "meetme";
+		e->command = "meetme list [concise]";
 		e->usage =
-			"Usage: meetme (un)lock|(un)mute|kick|list [concise] <confno> <usernumber>\n"
-			"       Executes a command for the conference or on a conferee\n";
+			"Usage: meetme list [concise] <confno> \n"
+			"       List all or a specific conference.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return complete_meetmecmd(a->line, a->word, a->pos, a->n);
 	}
 
-	if (a->argc > 8)
-		ast_cli(a->fd, "Invalid Arguments.\n");
 	/* Check for length so no buffer will overflow... */
 	for (i = 0; i < a->argc; i++) {
 		if (strlen(a->argv[i]) > 100)
@@ -1028,7 +1024,55 @@
 		ast_free(cmdline);
 		return CLI_SUCCESS;
 	}
-	if (a->argc < 3) {
+	if (a->argc < 2) {
+		ast_free(cmdline);
+		return CLI_SHOWUSAGE;
+	}
+
+	ast_debug(1, "Cmdline: %s\n", cmdline->str);
+
+	admin_exec(NULL, cmdline->str);
+	ast_free(cmdline);
+
+	return CLI_SUCCESS;
+}
+
+
+static char *meetme_cmd(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	/* Process the command */
+	struct ast_conference *cnf;
+	struct ast_conf_user *user;
+	int hr, min, sec;
+	int i = 0;
+	time_t now;
+	struct ast_str *cmdline = NULL;
+
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "meetme {lock|unlock|mute|unmute|kick}";
+		e->usage =
+			"Usage: meetme (un)lock|(un)mute|kick <confno> <usernumber>\n"
+			"       Executes a command for the conference or on a conferee\n";
+		return NULL;
+	case CLI_GENERATE:
+		return complete_meetmecmd(a->line, a->word, a->pos, a->n);
+	}
+
+	if (a->argc > 8)
+		ast_cli(a->fd, "Invalid Arguments.\n");
+	/* Check for length so no buffer will overflow... */
+	for (i = 0; i < a->argc; i++) {
+		if (strlen(a->argv[i]) > 100)
+			ast_cli(a->fd, "Invalid Arguments.\n");
+	}
+
+	/* Max confno length */
+	if (!(cmdline = ast_str_create(MAX_CONFNUM))) {
+		return CLI_FAILURE;
+	}
+
+	if (a->argc < 1) {
 		ast_free(cmdline);
 		return CLI_SHOWUSAGE;
 	}
@@ -1307,6 +1351,7 @@
 
 static struct ast_cli_entry cli_meetme[] = {
 	AST_CLI_DEFINE(meetme_cmd, "Execute a command on a conference or conferee"),
+	AST_CLI_DEFINE(meetme_show_cmd, "List all or one conference"),
 	AST_CLI_DEFINE(sla_show_trunks, "Show SLA Trunks"),
 	AST_CLI_DEFINE(sla_show_stations, "Show SLA Stations"),
 };

Modified: team/group/res_clialiases/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/apps/app_mixmonitor.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/apps/app_mixmonitor.c (original)
+++ team/group/res_clialiases/apps/app_mixmonitor.c Sun Sep 28 18:35:02 2008
@@ -365,7 +365,7 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "mixmonitor [start|stop]";
+		e->command = "mixmonitor {start|stop} {<chan_name>} [args]";
 		e->usage =
 			"Usage: mixmonitor <start|stop> <chan_name> [args]\n"
 			"       The optional arguments are passed to the MixMonitor\n"

Modified: team/group/res_clialiases/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/apps/app_queue.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/apps/app_queue.c (original)
+++ team/group/res_clialiases/apps/app_queue.c Sun Sep 28 18:35:02 2008
@@ -6264,9 +6264,9 @@
 	struct penalty_rule *pr_iter;
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "queue rules show";
+		e->command = "queue show rules";
 		e->usage =
-		"Usage: queue rules show [rulename]\n"
+		"Usage: queue show rules [rulename]\n"
 		"Show the list of rules associated with rulename. If no\n"
 		"rulename is specified, list all rules defined in queuerules.conf\n";
 		return NULL;
@@ -6295,9 +6295,9 @@
 {
 	switch (cmd) {
 		case CLI_INIT:
-			e->command = "queue rules reload";
+			e->command = "queue reload rules";
 			e->usage = 
-				"Usage: queue rules reload\n"
+				"Usage: queue reload rules\n"
 				"Reloads rules defined in queuerules.conf\n";
 			return NULL;
 		case CLI_GENERATE:

Modified: team/group/res_clialiases/channels/chan_console.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/channels/chan_console.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/channels/chan_console.c (original)
+++ team/group/res_clialiases/channels/chan_console.c Sun Sep 28 18:35:02 2008
@@ -694,9 +694,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "console set autoanswer [on|off]";
+		e->command = "console {set|show} autoanswer [on|off]";
 		e->usage =
-			"Usage: console set autoanswer [on|off]\n"
+			"Usage: console {set|show} autoanswer [on|off]\n"
 			"       Enables or disables autoanswer feature.  If used without\n"
 			"       argument, displays the current on/off status of autoanswer.\n"
 			"       The default value of autoanswer is in 'oss.conf'.\n";
@@ -1154,12 +1154,10 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "console active";
+		e->command = "console {set|show} active [<device>]";
 		e->usage =
-			"Usage: console active [device]\n"
-			"       If no device is specified.  The active console device will be shown.\n"
-			"Otherwise, the specified device will become the console device active for\n"
-			"the Asterisk CLI.\n";
+			"Usage: console {set|show} active [<device>]\n"
+			"       Set or show the active console device for the Asterisk CLI.\n";
 		return NULL;
 	case CLI_GENERATE:
 		if (a->pos == e->args) {
@@ -1181,7 +1179,7 @@
 	if (a->argc < e->args)
 		return CLI_SHOWUSAGE;
 
-	if (a->argc == e->args) {
+	if (a->argc == 3) {
 		pvt = get_active_pvt();
 
 		if (!pvt)

Modified: team/group/res_clialiases/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/channels/chan_dahdi.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/channels/chan_dahdi.c (original)
+++ team/group/res_clialiases/channels/chan_dahdi.c Sun Sep 28 18:35:02 2008
@@ -11604,32 +11604,6 @@
 	return complete_span_helper(line,word,pos,state,3);
 }
 
-static char *complete_span_5(const char *line, const char *word, int pos, int state)
-{
-	return complete_span_helper(line,word,pos,state,4);
-}
-
-static char *handle_pri_unset_debug_file(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
-	switch (cmd) {
-	case CLI_INIT:
-		e->command = "pri unset debug file";
-		e->usage = "Usage: pri unset debug file\n"
-			   "       Stop sending debug output to the previously \n"
-		           "       specified file\n";
-		return NULL;
-	case CLI_GENERATE:
-		return NULL;	
-	}
-	/* Assume it is unset */
-	ast_mutex_lock(&pridebugfdlock);
-	close(pridebugfd);
-	pridebugfd = -1;
-	ast_cli(a->fd, "PRI debug output to file disabled\n");
-	ast_mutex_unlock(&pridebugfdlock);
-	return CLI_SUCCESS;
-}
-
 static char *handle_pri_set_debug_file(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	int myfd;
@@ -11670,22 +11644,31 @@
 {
 	int span;
 	int x;
+	int level = 0;
 	switch (cmd) {
 	case CLI_INIT:	
-		e->command = "pri debug span";
+		e->command = "pri set debug {<level>|on|off} span";
 		e->usage = 
-			"Usage: pri debug span <span>\n"
+			"Usage: pri set debug <level|on|off> span <span>\n"
 			"       Enables debugging on a given PRI span\n";
 		return NULL;
 	case CLI_GENERATE:	
 		return complete_span_4(a->line, a->word, a->pos, a->n);
 	}
-	if (a->argc < 4) {
+	if (a->argc < 6) {
 		return CLI_SHOWUSAGE;
 	}
-	span = atoi(a->argv[3]);
+
+	if (!strcasecmp(a->argv[4], "on")) {
+		level = 1;
+	} else if (!strcasecmp(a->argv[4], "off")) {
+		level = 0;
+	} else {
+		level = atoi(a->argv[4]);
+	}
+	span = atoi(a->argv[5]);
 	if ((span < 1) || (span > NUM_SPANS)) {
-		ast_cli(a->fd, "Invalid span %s.  Should be a number %d to %d\n", a->argv[3], 1, NUM_SPANS);
+		ast_cli(a->fd, "Invalid span %s.  Should be a number %d to %d\n", a->argv[4], 1, NUM_SPANS);
 		return CLI_SUCCESS;
 	}
 	if (!pris[span-1].pri) {
@@ -11693,84 +11676,28 @@
 		return CLI_SUCCESS;
 	}
 	for (x = 0; x < NUM_DCHANS; x++) {
-		if (pris[span-1].dchans[x])
-			pri_set_debug(pris[span-1].dchans[x], PRI_DEBUG_APDU |
-			                                      PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE |
-			                                      PRI_DEBUG_Q921_STATE);
-	}
-	ast_cli(a->fd, "Enabled debugging on span %d\n", span);
-	return CLI_SUCCESS;
-}
-
-
-
-static char *handle_pri_no_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
-	int span;
-	int x;
-	switch (cmd) {
-	case CLI_INIT:
-		e->command = "pri no debug span";
-		e->usage = 
-			"Usage: pri no debug span <span>\n"
-			"       Disables debugging on a given PRI span\n";
-		return NULL;
-	case CLI_GENERATE:
-		return complete_span_5(a->line, a->word, a->pos, a->n);
-	}
-	if (a->argc < 5)
-		return CLI_SHOWUSAGE;
-
-	span = atoi(a->argv[4]);
-	if ((span < 1) || (span > NUM_SPANS)) {
-		ast_cli(a->fd, "Invalid span %s.  Should be a number %d to %d\n", a->argv[4], 1, NUM_SPANS);
-		return CLI_SUCCESS;
-	}
-	if (!pris[span-1].pri) {
-		ast_cli(a->fd, "No PRI running on span %d\n", span);
-		return CLI_SUCCESS;
-	}
-	for (x = 0; x < NUM_DCHANS; x++) {
-		if (pris[span-1].dchans[x])
-			pri_set_debug(pris[span-1].dchans[x], 0);
-	}
-	ast_cli(a->fd, "Disabled debugging on span %d\n", span);
-	return CLI_SUCCESS;
-}
-
-static char *handle_pri_really_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
-	int span;
-	int x;
-	switch (cmd) {
-	case CLI_INIT:
-		e->command = "pri intensive debug span";
-		e->usage = 
-			"Usage: pri intensive debug span <span>\n"
-			"       Enables debugging down to the Q.921 level\n";
-		return NULL;
-	case CLI_GENERATE:
-		return complete_span_5(a->line, a->word, a->pos, a->n);
-	}
-
-	if (a->argc < 5)
-		return CLI_SHOWUSAGE;
-	span = atoi(a->argv[4]);
-	if ((span < 1) || (span > NUM_SPANS)) {
-		ast_cli(a->fd, "Invalid span %s.  Should be a number %d to %d\n", a->argv[4], 1, NUM_SPANS);
-		return CLI_SUCCESS;
-	}
-	if (!pris[span-1].pri) {
-		ast_cli(a->fd, "No PRI running on span %d\n", span);
-		return CLI_SUCCESS;
-	}
-	for (x = 0; x < NUM_DCHANS; x++) {
-		if (pris[span-1].dchans[x])
-			pri_set_debug(pris[span-1].dchans[x], PRI_DEBUG_APDU |
-			                                      PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE |
-			                                      PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_STATE);
-	}
-	ast_cli(a->fd, "Enabled EXTENSIVE debugging on span %d\n", span);
+		if (pris[span-1].dchans[x]) {
+			if (level == 1) {
+				pri_set_debug(pris[span-1].dchans[x], PRI_DEBUG_APDU |
+				                                      PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE |
+				                                      PRI_DEBUG_Q921_STATE);
+				ast_cli(a->fd, "Enabled debugging on span %d\n", span);
+			} else if (level == 0) {
+				pri_set_debug(pris[span-1].dchans[x], 0);
+				//close the file if it's set
+				ast_mutex_lock(&pridebugfdlock);
+				close(pridebugfd);
+				pridebugfd = -1;
+				ast_cli(a->fd, "PRI debug output to file disabled\n");
+				ast_mutex_unlock(&pridebugfdlock);
+			} else {
+				pri_set_debug(pris[span-1].dchans[x], PRI_DEBUG_APDU |
+				                                      PRI_DEBUG_Q931_DUMP | PRI_DEBUG_Q931_STATE |
+				                                      PRI_DEBUG_Q921_RAW | PRI_DEBUG_Q921_DUMP | PRI_DEBUG_Q921_STATE);
+				ast_cli(a->fd, "Enabled debugging on span %d\n", span);
+			}
+		}
+	}
 	return CLI_SUCCESS;
 }
 
@@ -11935,13 +11862,10 @@
 
 static struct ast_cli_entry dahdi_pri_cli[] = {
 	AST_CLI_DEFINE(handle_pri_debug, "Enables PRI debugging on a span"),
-	AST_CLI_DEFINE(handle_pri_no_debug, "Disables PRI debugging on a span"),
-	AST_CLI_DEFINE(handle_pri_really_debug, "Enables REALLY INTENSE PRI debugging"),
 	AST_CLI_DEFINE(handle_pri_show_spans, "Displays PRI Information"),
 	AST_CLI_DEFINE(handle_pri_show_span, "Displays PRI Information"),
 	AST_CLI_DEFINE(handle_pri_show_debug, "Displays current PRI debug settings"),
 	AST_CLI_DEFINE(handle_pri_set_debug_file, "Sends PRI debug output to the specified file"),
-	AST_CLI_DEFINE(handle_pri_unset_debug_file, "Ends PRI debug output to file"),
 	AST_CLI_DEFINE(handle_pri_version, "Displays libpri version"),
 };
 
@@ -13151,65 +13075,40 @@
 	return 0;
 }
 
-static char *handle_ss7_no_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+static char *handle_ss7_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	int span;
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "ss7 no debug linkset";
+		e->command = "ss7 set debug {on|off} linkset";
 		e->usage = 
-			"Usage: ss7 no debug linkset <span>\n"
-			"       Disables debugging on a given SS7 linkset\n";
-		return NULL;
-	case CLI_GENERATE:
-		return NULL;
-	}
-	if (a->argc < 5)
-		return CLI_SHOWUSAGE;
-	span = atoi(a->argv[4]);
-	if ((span < 1) || (span > NUM_SPANS)) {
-		ast_cli(a->fd, "Invalid linkset %s.  Should be a number from %d to %d\n", a->argv[4], 1, NUM_SPANS);
-		return CLI_SUCCESS;
-	}
-	if (!linksets[span-1].ss7) {
-		ast_cli(a->fd, "No SS7 running on linkset %d\n", span);
-		return CLI_SUCCESS;
-	}
-	if (linksets[span-1].ss7)
-		ss7_set_debug(linksets[span-1].ss7, 0);
-
-	ast_cli(a->fd, "Disabled debugging on linkset %d\n", span);
-	return CLI_SUCCESS;
-}
-
-static char *handle_ss7_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
-	int span;
-	switch (cmd) {
-	case CLI_INIT:
-		e->command = "ss7 debug linkset";
-		e->usage = 
-			"Usage: ss7 debug linkset <linkset>\n"
+			"Usage: ss7 set debug {on|off} linkset <linkset>\n"
 			"       Enables debugging on a given SS7 linkset\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
-	if (a->argc < 4)
+	if (a->argc < 6)
 		return CLI_SHOWUSAGE;
-	span = atoi(a->argv[3]);
+	span = atoi(a->argv[5]);
 	if ((span < 1) || (span > NUM_SPANS)) {
-		ast_cli(a->fd, "Invalid linkset %s.  Should be a number from %d to %d\n", a->argv[3], 1, NUM_SPANS);
+		ast_cli(a->fd, "Invalid linkset %s.  Should be a number from %d to %d\n", a->argv[5], 1, NUM_SPANS);
 		return CLI_SUCCESS;
 	}
 	if (!linksets[span-1].ss7) {
 		ast_cli(a->fd, "No SS7 running on linkset %d\n", span);
 		return CLI_SUCCESS;
 	}
-	if (linksets[span-1].ss7)
-		ss7_set_debug(linksets[span-1].ss7, SS7_DEBUG_MTP2 | SS7_DEBUG_MTP3 | SS7_DEBUG_ISUP);
-
-	ast_cli(a->fd, "Enabled debugging on linkset %d\n", span);
+	if (linksets[span-1].ss7) {
+		if (strcasecmp(a->argv[4], "on")) {
+			ss7_set_debug(linksets[span-1].ss7, SS7_DEBUG_MTP2 | SS7_DEBUG_MTP3 | SS7_DEBUG_ISUP);
+			ast_cli(a->fd, "Enabled debugging on linkset %d\n", span);
+		} else {
+			ss7_set_debug(linksets[span-1].ss7, 0);
+			ast_cli(a->fd, "Disabled debugging on linkset %d\n", span);
+		}
+	}
+
 	return CLI_SUCCESS;
 }
 
@@ -13470,7 +13369,6 @@
 
 static struct ast_cli_entry dahdi_ss7_cli[] = {
 	AST_CLI_DEFINE(handle_ss7_debug, "Enables SS7 debugging on a linkset"), 
-	AST_CLI_DEFINE(handle_ss7_no_debug, "Disables SS7 debugging on a linkset"), 
 	AST_CLI_DEFINE(handle_ss7_block_cic, "Blocks the given CIC"),
 	AST_CLI_DEFINE(handle_ss7_unblock_cic, "Unblocks the given CIC"),
 	AST_CLI_DEFINE(handle_ss7_block_linkset, "Blocks all CICs on a linkset"),

Modified: team/group/res_clialiases/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/channels/chan_features.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/channels/chan_features.c (original)
+++ team/group/res_clialiases/channels/chan_features.c Sun Sep 28 18:35:02 2008
@@ -501,9 +501,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "feature show channels";
+		e->command = "features show channels";
 		e->usage =
-			"Usage: feature show channels\n"
+			"Usage: features show channels\n"
 			"       Provides summary information on feature channels.\n";
 		return NULL;
 	case CLI_GENERATE:

Modified: team/group/res_clialiases/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/channels/chan_h323.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/channels/chan_h323.c (original)
+++ team/group/res_clialiases/channels/chan_h323.c Sun Sep 28 18:35:02 2008
@@ -2619,16 +2619,16 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "h323 set trace [off]";
+		e->command = "h323 set trace [on|off]";
 		e->usage =
-			"Usage: h323 set trace (off|<trace level>)\n"
+			"Usage: h323 set trace (on|off|<trace level>)\n"
 			"       Enable/Disable H.323 stack tracing for debugging purposes\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 4)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
 	if (!strcasecmp(a->argv[3], "off")) {
 		h323_debug(0, 0);
@@ -2645,21 +2645,21 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "h323 set debug [off]";
+		e->command = "h323 set debug [on|off]";
 		e->usage =
-			"Usage: h323 set debug [off]\n"
+			"Usage: h323 set debug [on|off]\n"
 			"       Enable/Disable H.323 debugging output\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc < 3 || a->argc > 4)
+	if (a->argc != e->args)
 		return CLI_SHOWUSAGE;
-	if (a->argc == 4 && strcasecmp(a->argv[3], "off"))
+	if (strcasecmp(a->argv[3], "on") && strcasecmp(a->argv[3], "off"))
 		return CLI_SHOWUSAGE;
 
-	h323debug = (a->argc == 3) ? 1 : 0;
+	h323debug = (strcasecmp(a->argv[3], "on")) ? 0 : 1;
 	ast_cli(a->fd, "H.323 Debugging %s\n", h323debug ? "Enabled" : "Disabled");
 	return CLI_SUCCESS;
 }

Modified: team/group/res_clialiases/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/channels/chan_misdn.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/channels/chan_misdn.c (original)
+++ team/group/res_clialiases/channels/chan_misdn.c Sun Sep 28 18:35:02 2008
@@ -736,9 +736,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "misdn set debug";
+		e->command = "misdn set debug {on|off|<level>}";
 		e->usage =
-			"Usage: misdn set debug <level> [only] | [port <port> [only]]\n"
+			"Usage: misdn set debug {on|off|<level>} [only] | [port <port> [only]]\n"
 			"       Set the debug level of the mISDN channel.\n";
 		return NULL;
 	case CLI_GENERATE:
@@ -747,8 +747,14 @@
 
 	if (a->argc < 4 || a->argc > 7)
 		return CLI_SHOWUSAGE;
-
-	level = atoi(a->argv[3]);
+	
+	if (!strcasecmp(a->argv[3], "on")) {
+		level = 1;
+	} else if (!strcasecmp(a->argv[3], "off")) {
+		level = 0;
+	} else {
+		level = atoi(a->argv[3]);
+	}
 
 	switch (a->argc) {
 	case 4:	

Modified: team/group/res_clialiases/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/channels/chan_oss.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/channels/chan_oss.c (original)
+++ team/group/res_clialiases/channels/chan_oss.c Sun Sep 28 18:35:02 2008
@@ -911,9 +911,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "console autoanswer [on|off]";
+		e->command = "console {set|show} autoanswer [on|off]";
 		e->usage =
-			"Usage: console autoanswer [on|off]\n"
+			"Usage: console {set|show} autoanswer [on|off]\n"
 			"       Enables or disables autoanswer feature.  If used without\n"
 			"       argument, displays the current on/off status of autoanswer.\n"
 			"       The default value of autoanswer is in 'oss.conf'.\n";
@@ -1200,7 +1200,7 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "console active";
+		e->command = "console {set|show} active [<device>]";
 		e->usage =
 			"Usage: console active [device]\n"
 			"       If used without a parameter, displays which device is the current\n"
@@ -1211,20 +1211,20 @@
 		return NULL;
 	}
 
-	if (a->argc == 2)
+	if (a->argc == 3)
 		ast_cli(a->fd, "active console is [%s]\n", oss_active);
-	else if (a->argc != 3)
+	else if (a->argc != 4)
 		return CLI_SHOWUSAGE;
 	else {
 		struct chan_oss_pvt *o;
-		if (strcmp(a->argv[2], "show") == 0) {
+		if (strcmp(a->argv[3], "show") == 0) {
 			for (o = oss_default.next; o; o = o->next)
 				ast_cli(a->fd, "device [%s] exists\n", o->name);
 			return CLI_SUCCESS;
 		}
-		o = find_desc(a->argv[2]);
+		o = find_desc(a->argv[3]);
 		if (o == NULL)
-			ast_cli(a->fd, "No device [%s] exists\n", a->argv[2]);
+			ast_cli(a->fd, "No device [%s] exists\n", a->argv[3]);
 		else
 			oss_active = o->name;
 	}

Modified: team/group/res_clialiases/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/channels/chan_unistim.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/channels/chan_unistim.c (original)
+++ team/group/res_clialiases/channels/chan_unistim.c Sun Sep 28 18:35:02 2008
@@ -4682,9 +4682,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "unistim info";
+		e->command = "unistim show info";
 		e->usage =
-			"Usage: unistim info\n" 
+			"Usage: unistim show info\n" 
 			"       Dump internal structures.\n";
 		return NULL;
 
@@ -4751,27 +4751,27 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "unistim sp";
+		e->command = "unistim send packet";
 		e->usage =
-			"Usage: unistim sp USTM/line at name hexa\n"
-			"       unistim sp USTM/1000 at hans 19040004\n";
+			"Usage: unistim send packet USTM/line at name hexa\n"
+			"       unistim send packet USTM/1000 at hans 19040004\n";
 		return NULL;
 
 	case CLI_GENERATE:
 		return NULL;	/* no completion */
 	}
 	
-	if (a->argc < 4)
+	if (a->argc < 5)
 		return CLI_SHOWUSAGE;
 
-	if (strlen(a->argv[2]) < 9)
+	if (strlen(a->argv[3]) < 9)
 		return CLI_SHOWUSAGE;
 
-	len = strlen(a->argv[3]);
+	len = strlen(a->argv[4]);
 	if (len % 2)
 		return CLI_SHOWUSAGE;
 
-	ast_copy_string(tmp, a->argv[2] + 5, sizeof(tmp));
+	ast_copy_string(tmp, a->argv[3] + 5, sizeof(tmp));
 	sub = find_subchannel_by_name(tmp);
 	if (!sub) {
 		ast_cli(a->fd, "Can't find '%s'\n", tmp);
@@ -4781,15 +4781,15 @@
 		ast_cli(a->fd, "'%s' is not connected\n", tmp);
 		return CLI_SUCCESS;
 	}
-	ast_cli(a->fd, "Sending '%s' to %s (%p)\n", a->argv[3], tmp, sub->parent->parent->session);
+	ast_cli(a->fd, "Sending '%s' to %s (%p)\n", a->argv[4], tmp, sub->parent->parent->session);
 	for (i = 0; i < len; i++) {
-		c = a->argv[3][i];
+		c = a->argv[4][i];
 		if (c >= 'a')
 			c -= 'a' - 10;
 		else
 			c -= '0';
 		i++;
-		cc = a->argv[3][i];
+		cc = a->argv[4][i];
 		if (cc >= 'a')
 			cc -= 'a' - 10;
 		else

Modified: team/group/res_clialiases/main/astobj2.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/main/astobj2.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/main/astobj2.c (original)
+++ team/group/res_clialiases/main/astobj2.c Sun Sep 28 18:35:02 2008
@@ -862,9 +862,9 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "astobj2 stats";
-		e->usage = "Usage: astobj2 stats\n"
-			   "       Show astobj2 stats\n";
+		e->command = "astobj2 show stats";
+		e->usage = "Usage: astobj2 show stats\n"
+			   "       Show astobj2 show stats\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;

Modified: team/group/res_clialiases/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/main/cli.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/main/cli.c (original)
+++ team/group/res_clialiases/main/cli.c Sun Sep 28 18:35:02 2008
@@ -756,18 +756,18 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "soft hangup";
+		e->command = "channel request hangup";
 		e->usage =
-			"Usage: soft hangup <channel>\n"
+			"Usage: channel request hangup <channel>\n"
 			"       Request that a channel be hung up. The hangup takes effect\n"
 			"       the next time the driver reads or writes from the channel\n";
 		return NULL;
 	case CLI_GENERATE:
 		return ast_complete_channels(a->line, a->word, a->pos, a->n, 2);
 	}
-	if (a->argc != 3)
+	if (a->argc != 4)
 		return CLI_SHOWUSAGE;
-	c = ast_get_channel_by_name_locked(a->argv[2]);
+	c = ast_get_channel_by_name_locked(a->argv[3]);
 	if (c) {
 		ast_cli(a->fd, "Requested Hangup on channel '%s'\n", c->name);
 		ast_softhangup(c, AST_SOFTHANGUP_EXPLICIT);

Modified: team/group/res_clialiases/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/main/manager.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/main/manager.c (original)
+++ team/group/res_clialiases/main/manager.c Sun Sep 28 18:35:02 2008
@@ -519,18 +519,18 @@
 {
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "manager debug [on|off]";
-		e->usage = "Usage: manager debug [on|off]\n	Show, enable, disable debugging of the manager code.\n";
+		e->command = "manager set debug [on|off]";
+		e->usage = "Usage: manager set debug [on|off]\n	Show, enable, disable debugging of the manager code.\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;	
 	}
-	if (a->argc == 2)
+	if (a->argc == 3)
 		ast_cli(a->fd, "manager debug is %s\n", manager_debug? "on" : "off");
-	else if (a->argc == 3) {
-		if (!strcasecmp(a->argv[2], "on"))
+	else if (a->argc == 4) {
+		if (!strcasecmp(a->argv[3], "on"))
 			manager_debug = 1;
-		else if (!strcasecmp(a->argv[2], "off"))
+		else if (!strcasecmp(a->argv[3], "off"))
 			manager_debug = 0;
 		else
 			return CLI_SHOWUSAGE;

Modified: team/group/res_clialiases/main/taskprocessor.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/main/taskprocessor.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/main/taskprocessor.c (original)
+++ team/group/res_clialiases/main/taskprocessor.c Sun Sep 28 18:35:02 2008
@@ -196,9 +196,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "core taskprocessor ping";
+		e->command = "core ping taskprocessor";
 		e->usage = 
-			"Usage: core taskprocessor ping <taskprocessor>\n"
+			"Usage: core ping taskprocessor <taskprocessor>\n"
 			"	Displays the time required for a task to be processed\n";
 		return NULL;
 	case CLI_GENERATE:

Modified: team/group/res_clialiases/res/ais/clm.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/ais/clm.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/res/ais/clm.c (original)
+++ team/group/res_clialiases/res/ais/clm.c Sun Sep 28 18:35:02 2008
@@ -78,9 +78,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "ais clm show members";
+		e->command = "ais show clm members";
 		e->usage =
-			"Usage: ais clm show members\n"
+			"Usage: ais show clm members\n"
 			"       List members of the cluster using the CLM (Cluster Membership) service.\n";
 		return NULL;
 

Modified: team/group/res_clialiases/res/ais/evt.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/ais/evt.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/res/ais/evt.c (original)
+++ team/group/res_clialiases/res/ais/evt.c Sun Sep 28 18:35:02 2008
@@ -271,9 +271,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "ais evt show event channels";
+		e->command = "ais show evt event channels";
 		e->usage =
-			"Usage: ais evt show event channels\n"
+			"Usage: ais show evt event channels\n"
 			"       List configured event channels for the (EVT) Eventing service.\n";
 		return NULL;
 

Modified: team/group/res_clialiases/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/res_agi.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/res/res_agi.c (original)
+++ team/group/res_clialiases/res/res_agi.c Sun Sep 28 18:35:02 2008
@@ -86,7 +86,7 @@
 "AGISIGHUP channel variable to \"no\" before executing the AGI application.\n"
 "  Using 'EAGI' provides enhanced AGI, with incoming audio available out of band\n"
 "on file descriptor 3.\n\n"
-"  Use the CLI command 'agi show' to list available agi commands.\n"
+"  Use the CLI command 'agi show commnands' to list available agi commands.\n"
 "  This application sets the following channel variable upon completion:\n"
 "     AGISTATUS      The status of the attempt to the run the AGI script\n"
 "                    text string, one of SUCCESS | FAILURE | NOTFOUND | HANGUP\n";
@@ -2727,9 +2727,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "agi show";
+		e->command = "agi show commands [topic]";
 		e->usage =
-			"Usage: agi show [topic]\n"
+			"Usage: agi show commands [topic]\n"
 			"       When called with a topic as an argument, displays usage\n"
 			"       information on the given command.  If called without a\n"
 			"       topic, it provides a list of AGI commands.\n";

Modified: team/group/res_clialiases/res/res_clioriginate.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/res_clioriginate.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/res/res_clioriginate.c (original)
+++ team/group/res_clialiases/res/res_clioriginate.c Sun Sep 28 18:35:02 2008
@@ -122,26 +122,26 @@
 	char *res;
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "originate";
+		e->command = "channel originate";
 		e->usage = 
 			"  There are two ways to use this command. A call can be originated between a\n"
 			"channel and a specific application, or between a channel and an extension in\n"
 			"the dialplan. This is similar to call files or the manager originate action.\n"
 			"Calls originated with this command are given a timeout of 30 seconds.\n\n"
 
-			"Usage1: originate <tech/data> application <appname> [appdata]\n"
+			"Usage1: channel originate <tech/data> application <appname> [appdata]\n"
 			"  This will originate a call between the specified channel tech/data and the\n"
 			"given application. Arguments to the application are optional. If the given\n"
 			"arguments to the application include spaces, all of the arguments to the\n"
 			"application need to be placed in quotation marks.\n\n"
 
-			"Usage2: originate <tech/data> extension [exten@][context]\n"
+			"Usage2: channel originate <tech/data> extension [exten@][context]\n"
 			"  This will originate a call between the specified channel tech/data and the\n"
 			"given extension. If no context is specified, the 'default' context will be\n"
 			"used. If no extension is given, the 's' extension will be used.\n";
 		return NULL;
 	case CLI_GENERATE:
-		if (a->pos != 2)
+		if (a->pos != 3)
 			return NULL;
 
 		/* ugly, can be removed when CLI entries have ast_module pointers */
@@ -152,18 +152,20 @@
 		return res;
 	}
 
-	if (ast_strlen_zero(a->argv[1]) || ast_strlen_zero(a->argv[2]))
+	if (ast_strlen_zero(a->argv[2]) || ast_strlen_zero(a->argv[3]))
 		return CLI_SHOWUSAGE;
 
 	/* ugly, can be removed when CLI entries have ast_module pointers */
 	ast_module_ref(ast_module_info->self);
 
-	if (!strcasecmp("application", a->argv[2])) {
-		res = orig_app(a->fd, a->argv[1], a->argv[3], a->argv[4]);	
-	} else if (!strcasecmp("extension", a->argv[2])) {
-		res = orig_exten(a->fd, a->argv[1], a->argv[3]);
-	} else
+	if (!strcasecmp("application", a->argv[3])) {
+		res = orig_app(a->fd, a->argv[2], a->argv[4], a->argv[5]);	
+	} else if (!strcasecmp("extension", a->argv[3])) {
+		res = orig_exten(a->fd, a->argv[2], a->argv[4]);
+	} else {
+		ast_log(LOG_WARNING, "else");
 		res = CLI_SHOWUSAGE;
+	}
 
 	ast_module_unref(ast_module_info->self);
 

Modified: team/group/res_clialiases/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/res_config_ldap.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/res/res_config_ldap.c (original)
+++ team/group/res_clialiases/res/res_config_ldap.c Sun Sep 28 18:35:02 2008
@@ -1529,9 +1529,9 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "realtime ldap status";
+		e->command = "realtime show ldap status";
 		e->usage =
-			"Usage: realtime ldap status\n"
+			"Usage: realtime show ldap status\n"
 			"               Shows connection information for the LDAP RealTime driver\n";
 		return NULL;
 	case CLI_GENERATE:

Modified: team/group/res_clialiases/res/res_config_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/group/res_clialiases/res/res_config_pgsql.c?view=diff&rev=145122&r1=145121&r2=145122
==============================================================================
--- team/group/res_clialiases/res/res_config_pgsql.c (original)
+++ team/group/res_clialiases/res/res_config_pgsql.c Sun Sep 28 18:35:02 2008
@@ -1315,13 +1315,13 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "realtime pgsql cache";
+		e->command = "realtime show pgsql cache";
 		e->usage =
-			"Usage: realtime pgsql cache [<table>]\n"
+			"Usage: realtime show pgsql cache [<table>]\n"
 			"       Shows table cache for the PostgreSQL RealTime driver\n";
 		return NULL;
 	case CLI_GENERATE:
-		if (a->argc != 3) {
+		if (a->argc != 4) {
 			return NULL;
 		}
 		l = strlen(a->word);
@@ -1337,25 +1337,25 @@
 		return ret;
 	}
 
-	if (a->argc == 3) {
+	if (a->argc == 4) {
 		/* List of tables */
 		AST_LIST_LOCK(&psql_tables);
 		AST_LIST_TRAVERSE(&psql_tables, cur, list) {
 			ast_cli(a->fd, "%s\n", cur->name);
 		}
 		AST_LIST_UNLOCK(&psql_tables);
-	} else if (a->argc == 4) {
+	} else if (a->argc == 5) {
 		/* List of columns */
-		if ((cur = find_table(a->argv[3]))) {
+		if ((cur = find_table(a->argv[4]))) {
 			struct columns *col;
-			ast_cli(a->fd, "Columns for Table Cache '%s':\n", a->argv[3]);
+			ast_cli(a->fd, "Columns for Table Cache '%s':\n", a->argv[4]);
 			ast_cli(a->fd, "%-20.20s %-20.20s %-3.3s %-8.8s\n", "Name", "Type", "Len", "Nullable");
 			AST_LIST_TRAVERSE(&cur->columns, col, list) {
 				ast_cli(a->fd, "%-20.20s %-20.20s %3d %-8.8s\n", col->name, col->type, col->len, col->notnull ? "NOT NULL" : "");
 			}
 			ast_mutex_unlock(&cur->lock);
 		} else {
-			ast_cli(a->fd, "No such table '%s'\n", a->argv[3]);
+			ast_cli(a->fd, "No such table '%s'\n", a->argv[4]);
 		}
 	}
 	return 0;
@@ -1368,16 +1368,16 @@
 
 	switch (cmd) {
 	case CLI_INIT:
-		e->command = "realtime pgsql status";
+		e->command = "realtime show pgsql status";
 		e->usage =
-			"Usage: realtime pgsql status\n"
+			"Usage: realtime show pgsql status\n"
 			"       Shows connection information for the PostgreSQL RealTime driver\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}
 
-	if (a->argc != 3)
+	if (a->argc != 4)
 		return CLI_SHOWUSAGE;
 
 	if (pgsqlConn && PQstatus(pgsqlConn) == CONNECTION_OK) {




More information about the asterisk-commits mailing list