mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-15 22:38:08 +00:00
Make the output of "console list devices" a bit prettier.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@99011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -787,7 +787,11 @@ static char *cli_list_devices(struct ast_cli_entry *e, int cmd, struct ast_cli_a
|
|||||||
if (a->argc != e->args)
|
if (a->argc != e->args)
|
||||||
return CLI_SHOWUSAGE;
|
return CLI_SHOWUSAGE;
|
||||||
|
|
||||||
ast_cli(a->fd, "Available Devices:\n---------------------------------\n");
|
ast_cli(a->fd, "\n"
|
||||||
|
"=============================================================\n"
|
||||||
|
"=== Available Devices =======================================\n"
|
||||||
|
"=============================================================\n"
|
||||||
|
"===\n");
|
||||||
|
|
||||||
num = Pa_GetDeviceCount();
|
num = Pa_GetDeviceCount();
|
||||||
if (!num) {
|
if (!num) {
|
||||||
@@ -801,15 +805,17 @@ static char *cli_list_devices(struct ast_cli_entry *e, int cmd, struct ast_cli_a
|
|||||||
const PaDeviceInfo *dev = Pa_GetDeviceInfo(index);
|
const PaDeviceInfo *dev = Pa_GetDeviceInfo(index);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
continue;
|
continue;
|
||||||
ast_cli(a->fd, "Device Name: %s %s %s\n", dev->name,
|
ast_cli(a->fd, "=== ---------------------------------------------------------\n"
|
||||||
dev->maxInputChannels ? "(Input)" : "",
|
"=== Device Name: %s\n", dev->name);
|
||||||
dev->maxOutputChannels ? "(Output)" : "");
|
if (dev->maxInputChannels)
|
||||||
if (index == def_input)
|
ast_cli(a->fd, "=== ---> %sInput Device\n", (index == def_input) ? "Default " : "");
|
||||||
ast_cli(a->fd, " ---> Default Input Device\n");
|
if (dev->maxOutputChannels)
|
||||||
if (index == def_output)
|
ast_cli(a->fd, "=== ---> %sOutput Device\n", (index == def_output) ? "Default " : "");
|
||||||
ast_cli(a->fd, " ---> Default Output Device\n");
|
ast_cli(a->fd, "=== ---------------------------------------------------------\n===\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ast_cli(a->fd, "=============================================================\n\n");
|
||||||
|
|
||||||
return CLI_SUCCESS;
|
return CLI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user