mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
make 'show channeltypes' list whether device state is supported (bug #4464)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -81,16 +81,16 @@ AST_MUTEX_DEFINE_STATIC(chlock);
|
|||||||
|
|
||||||
static int show_channeltypes(int fd, int argc, char *argv[])
|
static int show_channeltypes(int fd, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#define FORMAT "%-10.10s %-50.50s\n"
|
#define FORMAT "%-10.10s %-50.50s %-12.12s\n"
|
||||||
struct chanlist *cl = backends;
|
struct chanlist *cl = backends;
|
||||||
ast_cli(fd, FORMAT, "Type", "Description");
|
ast_cli(fd, FORMAT, "Type", "Description", "Devicestate");
|
||||||
ast_cli(fd, FORMAT, "----------", "-----------");
|
ast_cli(fd, FORMAT, "----------", "-----------", "-----------");
|
||||||
if (ast_mutex_lock(&chlock)) {
|
if (ast_mutex_lock(&chlock)) {
|
||||||
ast_log(LOG_WARNING, "Unable to lock channel list\n");
|
ast_log(LOG_WARNING, "Unable to lock channel list\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
while (cl) {
|
while (cl) {
|
||||||
ast_cli(fd, FORMAT, cl->tech->type, cl->tech->description);
|
ast_cli(fd, FORMAT, cl->tech->type, cl->tech->description, (cl->tech->devicestate)?"yes":"no");
|
||||||
cl = cl->next;
|
cl = cl->next;
|
||||||
}
|
}
|
||||||
ast_mutex_unlock(&chlock);
|
ast_mutex_unlock(&chlock);
|
||||||
|
Reference in New Issue
Block a user