mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +00:00
Fix "core show channels" and "core show modules".
Not sure it applies like this to 1.4 because of deprecate versions of the same command(s). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
18
main/cli.c
18
main/cli.c
@@ -416,15 +416,16 @@ static int handle_showuptime(int fd, int argc, char *argv[])
|
|||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* core show modules [like keyword] */
|
||||||
static int handle_modlist(int fd, int argc, char *argv[])
|
static int handle_modlist(int fd, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char *like = "";
|
char *like = "";
|
||||||
if (argc == 3)
|
if (argc != 3 && argc != 5)
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
else if (argc >= 4) {
|
else if (argc == 5) {
|
||||||
if (strcmp(argv[2],"like"))
|
if (strcmp(argv[3],"like"))
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
like = argv[3];
|
like = argv[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_mutex_lock(&climodentrylock);
|
ast_mutex_lock(&climodentrylock);
|
||||||
@@ -438,6 +439,7 @@ static int handle_modlist(int fd, int argc, char *argv[])
|
|||||||
#undef MODLIST_FORMAT
|
#undef MODLIST_FORMAT
|
||||||
#undef MODLIST_FORMAT2
|
#undef MODLIST_FORMAT2
|
||||||
|
|
||||||
|
/* core show channels [concise|verbose] */
|
||||||
static int handle_chanlist(int fd, int argc, char *argv[])
|
static int handle_chanlist(int fd, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#define FORMAT_STRING "%-20.20s %-20.20s %-7.7s %-30.30s\n"
|
#define FORMAT_STRING "%-20.20s %-20.20s %-7.7s %-30.30s\n"
|
||||||
@@ -454,10 +456,12 @@ static int handle_chanlist(int fd, int argc, char *argv[])
|
|||||||
int durh, durm, durs;
|
int durh, durm, durs;
|
||||||
int numchans = 0, concise = 0, verbose = 0;
|
int numchans = 0, concise = 0, verbose = 0;
|
||||||
|
|
||||||
concise = (argc == 3 && (!strcasecmp(argv[2],"concise")));
|
if (argc == 4) {
|
||||||
verbose = (argc == 3 && (!strcasecmp(argv[2],"verbose")));
|
concise = !strcasecmp(argv[2],"concise");
|
||||||
|
verbose = !strcasecmp(argv[2],"verbose");
|
||||||
|
}
|
||||||
|
|
||||||
if (argc < 2 || argc > 3 || (argc == 3 && !concise && !verbose))
|
if (argc < 3 || argc > 4 || (argc == 4 && !concise && !verbose))
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
if (!concise && !verbose)
|
if (!concise && !verbose)
|
||||||
|
|||||||
Reference in New Issue
Block a user