mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Changes to show blocked/unblocked states, as well as in service, out of service state
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -10644,10 +10644,12 @@ static int action_zaprestart(struct mansession *s, struct message *m)
|
|||||||
|
|
||||||
static int zap_show_channels(int fd, int argc, char **argv)
|
static int zap_show_channels(int fd, int argc, char **argv)
|
||||||
{
|
{
|
||||||
#define FORMAT "%7s %-10.10s %-15.15s %-10.10s %-20.20s\n"
|
#define FORMAT "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-10.10s %-10.10s\n"
|
||||||
#define FORMAT2 "%7s %-10.10s %-15.15s %-10.10s %-20.20s\n"
|
#define FORMAT2 "%7s %-10.10s %-15.15s %-10.10s %-20.20s %-10.10s %-10.10s\n"
|
||||||
struct zt_pvt *tmp = NULL;
|
struct zt_pvt *tmp = NULL;
|
||||||
char tmps[20] = "";
|
char tmps[20] = "";
|
||||||
|
char statestr[20] = "";
|
||||||
|
char blockstr[20] = "";
|
||||||
ast_mutex_t *lock;
|
ast_mutex_t *lock;
|
||||||
struct zt_pvt *start;
|
struct zt_pvt *start;
|
||||||
#ifdef HAVE_PRI
|
#ifdef HAVE_PRI
|
||||||
@@ -10683,9 +10685,9 @@ static int zap_show_channels(int fd, int argc, char **argv)
|
|||||||
|
|
||||||
ast_mutex_lock(lock);
|
ast_mutex_lock(lock);
|
||||||
#ifdef HAVE_PRI
|
#ifdef HAVE_PRI
|
||||||
ast_cli(fd, FORMAT2, pri ? "CRV" : "Chan", "Extension", "Context", "Language", "MOH Interpret");
|
ast_cli(fd, FORMAT2, pri ? "CRV" : "Chan", "Extension", "Context", "Language", "MOH Interpret", "Blocked", "State");
|
||||||
#else
|
#else
|
||||||
ast_cli(fd, FORMAT2, "Chan", "Extension", "Context", "Language", "MOH Interpret");
|
ast_cli(fd, FORMAT2, "Chan", "Extension", "Context", "Language", "MOH Interpret", "Blocked", "State");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tmp = start;
|
tmp = start;
|
||||||
@@ -10694,7 +10696,22 @@ static int zap_show_channels(int fd, int argc, char **argv)
|
|||||||
snprintf(tmps, sizeof(tmps), "%d", tmp->channel);
|
snprintf(tmps, sizeof(tmps), "%d", tmp->channel);
|
||||||
} else
|
} else
|
||||||
ast_copy_string(tmps, "pseudo", sizeof(tmps));
|
ast_copy_string(tmps, "pseudo", sizeof(tmps));
|
||||||
ast_cli(fd, FORMAT, tmps, tmp->exten, tmp->context, tmp->language, tmp->mohinterpret);
|
|
||||||
|
if (tmp->locallyblocked)
|
||||||
|
blockstr[0] = 'L';
|
||||||
|
else
|
||||||
|
blockstr[0] = ' ';
|
||||||
|
|
||||||
|
if (tmp->remotelyblocked)
|
||||||
|
blockstr[1] = 'R';
|
||||||
|
else
|
||||||
|
blockstr[1] = ' ';
|
||||||
|
|
||||||
|
blockstr[2] = '\0';
|
||||||
|
|
||||||
|
snprintf(statestr, sizeof(statestr), "%s", tmp->inservice ? "In Service" : "Out of Service");
|
||||||
|
|
||||||
|
ast_cli(fd, FORMAT, tmps, tmp->exten, tmp->context, tmp->language, tmp->mohinterpret, blockstr, statestr);
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
ast_mutex_unlock(lock);
|
ast_mutex_unlock(lock);
|
||||||
|
Reference in New Issue
Block a user