mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Remove deprecated CLI apps from the core
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
127
main/frame.c
127
main/frame.c
@@ -595,50 +595,6 @@ char *ast_codec2str(int codec)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int show_codecs_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int i, found=0;
|
||||
char hex[25];
|
||||
|
||||
if ((argc < 2) || (argc > 3))
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
if (!ast_opt_dont_warn)
|
||||
ast_cli(fd, "Disclaimer: this command is for informational purposes only.\n"
|
||||
"\tIt does not indicate anything about your configuration.\n");
|
||||
|
||||
ast_cli(fd, "%11s %9s %10s TYPE %8s %s\n","INT","BINARY","HEX","NAME","DESC");
|
||||
ast_cli(fd, "--------------------------------------------------------------------------------\n");
|
||||
if ((argc == 2) || (!strcasecmp(argv[1],"audio"))) {
|
||||
found = 1;
|
||||
for (i=0;i<12;i++) {
|
||||
snprintf(hex,25,"(0x%x)",1<<i);
|
||||
ast_cli(fd, "%11u (1 << %2d) %10s audio %8s (%s)\n",1 << i,i,hex,ast_getformatname(1<<i),ast_codec2str(1<<i));
|
||||
}
|
||||
}
|
||||
|
||||
if ((argc == 2) || (!strcasecmp(argv[1],"image"))) {
|
||||
found = 1;
|
||||
for (i=16;i<18;i++) {
|
||||
snprintf(hex,25,"(0x%x)",1<<i);
|
||||
ast_cli(fd, "%11u (1 << %2d) %10s image %8s (%s)\n",1 << i,i,hex,ast_getformatname(1<<i),ast_codec2str(1<<i));
|
||||
}
|
||||
}
|
||||
|
||||
if ((argc == 2) || (!strcasecmp(argv[1],"video"))) {
|
||||
found = 1;
|
||||
for (i=18;i<22;i++) {
|
||||
snprintf(hex,25,"(0x%x)",1<<i);
|
||||
ast_cli(fd, "%11u (1 << %2d) %10s video %8s (%s)\n",1 << i,i,hex,ast_getformatname(1<<i),ast_codec2str(1<<i));
|
||||
}
|
||||
}
|
||||
|
||||
if (! found)
|
||||
return RESULT_SHOWUSAGE;
|
||||
else
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int show_codecs(int fd, int argc, char *argv[])
|
||||
{
|
||||
int i, found=0;
|
||||
@@ -687,28 +643,6 @@ static char frame_show_codecs_usage[] =
|
||||
"Usage: core list codecs [audio|video|image]\n"
|
||||
" Displays codec mapping\n";
|
||||
|
||||
static int show_codec_n_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int codec, i, found=0;
|
||||
|
||||
if (argc != 3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
if (sscanf(argv[2],"%d",&codec) != 1)
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
for (i = 0; i < 32; i++)
|
||||
if (codec & (1 << i)) {
|
||||
found = 1;
|
||||
ast_cli(fd, "%11u (1 << %2d) %s\n",1 << i,i,ast_codec2str(1<<i));
|
||||
}
|
||||
|
||||
if (!found)
|
||||
ast_cli(fd, "Codec %d not found\n", codec);
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int show_codec_n(int fd, int argc, char *argv[])
|
||||
{
|
||||
int codec, i, found=0;
|
||||
@@ -917,23 +851,6 @@ void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix)
|
||||
|
||||
|
||||
#ifdef TRACE_FRAMES
|
||||
static int show_frame_stats_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_frame *f;
|
||||
int x=1;
|
||||
if (argc != 3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
AST_LIST_LOCK(&headerlist);
|
||||
ast_cli(fd, " Framer Statistics \n");
|
||||
ast_cli(fd, "---------------------------\n");
|
||||
ast_cli(fd, "Total allocated headers: %d\n", headers);
|
||||
ast_cli(fd, "Queue Dump:\n");
|
||||
AST_LIST_TRAVERSE(&headerlist, f, frame_list)
|
||||
ast_cli(fd, "%d. Type %d, subclass %d from %s\n", x++, f->frametype, f->subclass, f->src ? f->src : "<Unknown>");
|
||||
AST_LIST_UNLOCK(&headerlist);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int show_frame_stats(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_frame *f;
|
||||
@@ -957,63 +874,31 @@ static char frame_stats_usage[] =
|
||||
#endif
|
||||
|
||||
/* Builtin Asterisk CLI-commands for debugging */
|
||||
static struct ast_cli_entry cli_show_codecs = {
|
||||
{ "show", "codecs", NULL },
|
||||
show_codecs_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_audio_codecs = {
|
||||
{ "show", "audio", "codecs", NULL },
|
||||
show_codecs_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_video_codecs = {
|
||||
{ "show", "video", "codecs", NULL },
|
||||
show_codecs_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_image_codecs = {
|
||||
{ "show", "image", "codecs", NULL },
|
||||
show_codecs_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_codec = {
|
||||
{ "show", "codec", NULL },
|
||||
show_codec_n_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
#ifdef TRACE_FRAMES
|
||||
static struct ast_cli_entry cli_show_frame_stats = {
|
||||
{ "show", "frame", "stats", NULL },
|
||||
show_frame_stats, NULL,
|
||||
NULL };
|
||||
#endif
|
||||
|
||||
static struct ast_cli_entry my_clis[] = {
|
||||
{ { "core", "list", "codecs", NULL },
|
||||
show_codecs, "Displays a list of codecs",
|
||||
frame_show_codecs_usage, NULL, &cli_show_codecs },
|
||||
frame_show_codecs_usage },
|
||||
|
||||
{ { "core", "list", "codecs", "audio", NULL },
|
||||
show_codecs, "Displays a list of audio codecs",
|
||||
frame_show_codecs_usage, NULL, &cli_show_audio_codecs },
|
||||
frame_show_codecs_usage },
|
||||
|
||||
{ { "core", "list", "codecs", "video", NULL },
|
||||
show_codecs, "Displays a list of video codecs",
|
||||
frame_show_codecs_usage, NULL, &cli_show_video_codecs },
|
||||
frame_show_codecs_usage },
|
||||
|
||||
{ { "core", "list", "codecs", "image", NULL },
|
||||
show_codecs, "Displays a list of image codecs",
|
||||
frame_show_codecs_usage, NULL, &cli_show_image_codecs },
|
||||
frame_show_codecs_usage },
|
||||
|
||||
{ { "core", "show", "codec", NULL },
|
||||
show_codec_n, "Shows a specific codec",
|
||||
frame_show_codec_n_usage, NULL, &cli_show_codec },
|
||||
frame_show_codec_n_usage },
|
||||
|
||||
#ifdef TRACE_FRAMES
|
||||
{ { "core", "show", "frame", "stats", NULL },
|
||||
show_frame_stats, "Shows frame statistics",
|
||||
frame_stats_usage, NULL, &cli_show_frame_stats },
|
||||
frame_stats_usage },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user