mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 07:01:09 +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:
@@ -95,7 +95,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
enum {
|
||||
QUEUE_STRATEGY_RINGALL = 0,
|
||||
QUEUE_STRATEGY_ROUNDROBIN,
|
||||
QUEUE_STRATEGY_LEASTRECENT,
|
||||
QUEUE_STRATEGY_FEWESTCALLS,
|
||||
QUEUE_STRATEGY_RANDOM,
|
||||
@@ -107,7 +106,6 @@ static struct strategy {
|
||||
char *name;
|
||||
} strategies[] = {
|
||||
{ QUEUE_STRATEGY_RINGALL, "ringall" },
|
||||
{ QUEUE_STRATEGY_ROUNDROBIN, "roundrobin" },
|
||||
{ QUEUE_STRATEGY_LEASTRECENT, "leastrecent" },
|
||||
{ QUEUE_STRATEGY_FEWESTCALLS, "fewestcalls" },
|
||||
{ QUEUE_STRATEGY_RANDOM, "random" },
|
||||
@@ -403,16 +401,6 @@ static AST_LIST_HEAD_STATIC(queues, call_queue);
|
||||
|
||||
static int set_member_paused(char *queuename, char *interface, int paused);
|
||||
|
||||
static void rr_dep_warning(void)
|
||||
{
|
||||
static unsigned int warned = 0;
|
||||
|
||||
if (!warned) {
|
||||
ast_log(LOG_NOTICE, "The 'roundrobin' queue strategy is deprecated. Please use the 'rrmemory' strategy instead.\n");
|
||||
warned = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void set_queue_result(struct ast_channel *chan, enum queue_result res)
|
||||
{
|
||||
int i;
|
||||
@@ -1052,9 +1040,6 @@ static struct call_queue *find_queue_by_name_rt(const char *queuename, struct as
|
||||
queue_set_param(q, tmp_name, v->value, -1, 0);
|
||||
}
|
||||
|
||||
if (q->strategy == QUEUE_STRATEGY_ROUNDROBIN)
|
||||
rr_dep_warning();
|
||||
|
||||
/* Temporarily set non-dynamic members dead so we can detect deleted ones. */
|
||||
for (m = q->members; m; m = m->next) {
|
||||
if (!m->dynamic)
|
||||
@@ -2223,18 +2208,6 @@ static int calc_metric(struct call_queue *q, struct member *mem, int pos, struct
|
||||
/* Everyone equal, except for penalty */
|
||||
tmp->metric = mem->penalty * 1000000;
|
||||
break;
|
||||
case QUEUE_STRATEGY_ROUNDROBIN:
|
||||
if (!pos) {
|
||||
if (!q->wrapped) {
|
||||
/* No more channels, start over */
|
||||
q->rrpos = 0;
|
||||
} else {
|
||||
/* Prioritize next entry */
|
||||
q->rrpos++;
|
||||
}
|
||||
q->wrapped = 0;
|
||||
}
|
||||
/* Fall through */
|
||||
case QUEUE_STRATEGY_RRMEMORY:
|
||||
if (pos < q->rrpos) {
|
||||
tmp->metric = 1000 + pos;
|
||||
@@ -3814,9 +3787,6 @@ static int reload_queues(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (q->strategy == QUEUE_STRATEGY_ROUNDROBIN)
|
||||
rr_dep_warning();
|
||||
|
||||
if (new) {
|
||||
AST_LIST_INSERT_HEAD(&queues, q, list);
|
||||
} else
|
||||
@@ -4373,42 +4343,22 @@ static char qam_cmd_usage[] =
|
||||
static char qrm_cmd_usage[] =
|
||||
"Usage: queue remove member <channel> from <queue>\n";
|
||||
|
||||
static struct ast_cli_entry cli_show_queues_deprecated = {
|
||||
{ "show", "queues", NULL },
|
||||
queue_list, NULL,
|
||||
NULL, NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_queue_deprecated = {
|
||||
{ "show", "queue", NULL },
|
||||
queue_show, NULL,
|
||||
NULL, complete_queue };
|
||||
|
||||
static struct ast_cli_entry cli_add_queue_member_deprecated = {
|
||||
{ "add", "queue", "member", NULL },
|
||||
handle_queue_add_member, NULL,
|
||||
NULL, complete_queue_add_member };
|
||||
|
||||
static struct ast_cli_entry cli_remove_queue_member_deprecated = {
|
||||
{ "remove", "queue", "member", NULL },
|
||||
handle_queue_remove_member, NULL,
|
||||
NULL, complete_queue_remove_member };
|
||||
|
||||
static struct ast_cli_entry cli_queue[] = {
|
||||
{ { "queue", "list", NULL },
|
||||
queue_list, "Show status of queues",
|
||||
queue_list_usage, NULL, &cli_show_queues_deprecated },
|
||||
queue_list_usage, NULL, NULL },
|
||||
|
||||
{ { "queue", "show", NULL },
|
||||
queue_show, "Show status of a specified queue",
|
||||
queue_show_usage, complete_queue, &cli_show_queue_deprecated },
|
||||
queue_show_usage, complete_queue, NULL },
|
||||
|
||||
{ { "queue", "add", "member", NULL },
|
||||
handle_queue_add_member, "Add a channel to a specified queue",
|
||||
qam_cmd_usage, complete_queue_add_member, &cli_add_queue_member_deprecated },
|
||||
qam_cmd_usage, complete_queue_add_member, NULL },
|
||||
|
||||
{ { "queue", "remove", "member", NULL },
|
||||
handle_queue_remove_member, "Removes a channel from a specified queue",
|
||||
qrm_cmd_usage, complete_queue_remove_member, &cli_remove_queue_member_deprecated },
|
||||
qrm_cmd_usage, complete_queue_remove_member, NULL },
|
||||
};
|
||||
|
||||
static int unload_module(void)
|
||||
|
@@ -1,173 +0,0 @@
|
||||
/*
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Copyright (C) 1999 - 2005, Digium, Inc.
|
||||
*
|
||||
* Justin Huff <jjhuff@mspin.net>
|
||||
*
|
||||
* See http://www.asterisk.org for more information about
|
||||
* the Asterisk project. Please do not directly contact
|
||||
* any of the maintainers of this project for assistance;
|
||||
* the project provides a web site, mailing lists and IRC
|
||||
* channels for your use.
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
*/
|
||||
|
||||
/*! \file
|
||||
*
|
||||
* \brief Applictions connected with CDR engine
|
||||
*
|
||||
* \author Justin Huff <jjhuff@mspin.net>
|
||||
*
|
||||
* \ingroup applications
|
||||
*/
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "asterisk/channel.h"
|
||||
#include "asterisk/cdr.h"
|
||||
#include "asterisk/module.h"
|
||||
#include "asterisk/pbx.h"
|
||||
#include "asterisk/logger.h"
|
||||
#include "asterisk/config.h"
|
||||
#include "asterisk/manager.h"
|
||||
#include "asterisk/utils.h"
|
||||
|
||||
|
||||
static char *setcdruserfield_descrip =
|
||||
"[Synopsis]\n"
|
||||
"SetCDRUserField(value)\n\n"
|
||||
"[Description]\n"
|
||||
"SetCDRUserField(value): Set the CDR 'user field' to value\n"
|
||||
" The Call Data Record (CDR) user field is an extra field you\n"
|
||||
" can use for data not stored anywhere else in the record.\n"
|
||||
" CDR records can be used for billing or storing other arbitrary data\n"
|
||||
" (I.E. telephone survey responses)\n"
|
||||
" Also see AppendCDRUserField().\n";
|
||||
|
||||
|
||||
static char *setcdruserfield_app = "SetCDRUserField";
|
||||
static char *setcdruserfield_synopsis = "Set the CDR user field";
|
||||
|
||||
static char *appendcdruserfield_descrip =
|
||||
"[Synopsis]\n"
|
||||
"AppendCDRUserField(value)\n\n"
|
||||
"[Description]\n"
|
||||
"AppendCDRUserField(value): Append value to the CDR user field\n"
|
||||
" The Call Data Record (CDR) user field is an extra field you\n"
|
||||
" can use for data not stored anywhere else in the record.\n"
|
||||
" CDR records can be used for billing or storing other arbitrary data\n"
|
||||
" (I.E. telephone survey responses)\n"
|
||||
" Also see SetCDRUserField().\n";
|
||||
|
||||
static char *appendcdruserfield_app = "AppendCDRUserField";
|
||||
static char *appendcdruserfield_synopsis = "Append to the CDR user field";
|
||||
|
||||
|
||||
static int action_setcdruserfield(struct mansession *s, struct message *m)
|
||||
{
|
||||
struct ast_channel *c = NULL;
|
||||
char *userfield = astman_get_header(m, "UserField");
|
||||
char *channel = astman_get_header(m, "Channel");
|
||||
char *append = astman_get_header(m, "Append");
|
||||
|
||||
if (ast_strlen_zero(channel)) {
|
||||
astman_send_error(s, m, "No Channel specified");
|
||||
return 0;
|
||||
}
|
||||
if (ast_strlen_zero(userfield)) {
|
||||
astman_send_error(s, m, "No UserField specified");
|
||||
return 0;
|
||||
}
|
||||
c = ast_get_channel_by_name_locked(channel);
|
||||
if (!c) {
|
||||
astman_send_error(s, m, "No such channel");
|
||||
return 0;
|
||||
}
|
||||
if (ast_true(append))
|
||||
ast_cdr_appenduserfield(c, userfield);
|
||||
else
|
||||
ast_cdr_setuserfield(c, userfield);
|
||||
ast_mutex_unlock(&c->lock);
|
||||
astman_send_ack(s, m, "CDR Userfield Set");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setcdruserfield_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
struct ast_module_user *u;
|
||||
int res = 0;
|
||||
static int dep_warning = 0;
|
||||
|
||||
u = ast_module_user_add(chan);
|
||||
|
||||
if (chan->cdr && data) {
|
||||
ast_cdr_setuserfield(chan, (char*)data);
|
||||
}
|
||||
|
||||
if (!dep_warning) {
|
||||
dep_warning = 1;
|
||||
ast_log(LOG_WARNING, "SetCDRUserField is deprecated. Please use CDR(userfield) instead.\n");
|
||||
}
|
||||
|
||||
ast_module_user_remove(u);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int appendcdruserfield_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
struct ast_module_user *u;
|
||||
int res = 0;
|
||||
static int dep_warning = 0;
|
||||
|
||||
u = ast_module_user_add(chan);
|
||||
|
||||
if (chan->cdr && data) {
|
||||
ast_cdr_appenduserfield(chan, (char*)data);
|
||||
}
|
||||
|
||||
if (!dep_warning) {
|
||||
dep_warning = 1;
|
||||
ast_log(LOG_WARNING, "AppendCDRUserField is deprecated. Please use CDR(userfield) instead.\n");
|
||||
}
|
||||
|
||||
ast_module_user_remove(u);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int unload_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = ast_unregister_application(setcdruserfield_app);
|
||||
res |= ast_unregister_application(appendcdruserfield_app);
|
||||
res |= ast_manager_unregister("SetCDRUserField");
|
||||
|
||||
ast_module_user_hangup_all();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int load_module(void)
|
||||
{
|
||||
int res;
|
||||
|
||||
res = ast_register_application(setcdruserfield_app, setcdruserfield_exec, setcdruserfield_synopsis, setcdruserfield_descrip);
|
||||
res |= ast_register_application(appendcdruserfield_app, appendcdruserfield_exec, appendcdruserfield_synopsis, appendcdruserfield_descrip);
|
||||
res |= ast_manager_register("SetCDRUserField", EVENT_FLAG_CALL, action_setcdruserfield, "Set the CDR UserField");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "CDR user field apps");
|
@@ -438,52 +438,6 @@ int64_t ast_mark(int i, int startstop)
|
||||
return prof_data->e[i].mark;
|
||||
}
|
||||
|
||||
static int handle_show_profile_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int i, min, max;
|
||||
char *search = NULL;
|
||||
|
||||
if (prof_data == NULL)
|
||||
return 0;
|
||||
|
||||
min = 0;
|
||||
max = prof_data->entries;
|
||||
if (argc >= 3) { /* specific entries */
|
||||
if (isdigit(argv[2][0])) {
|
||||
min = atoi(argv[2]);
|
||||
if (argc == 4 && strcmp(argv[3], "-"))
|
||||
max = atoi(argv[3]);
|
||||
} else
|
||||
search = argv[2];
|
||||
}
|
||||
if (max > prof_data->entries)
|
||||
max = prof_data->entries;
|
||||
if (!strcmp(argv[0], "clear")) {
|
||||
for (i= min; i < max; i++) {
|
||||
if (!search || strstr(prof_data->e[i].name, search)) {
|
||||
prof_data->e[i].value = 0;
|
||||
prof_data->e[i].events = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
ast_cli(fd, "profile values (%d, allocated %d)\n-------------------\n",
|
||||
prof_data->entries, prof_data->max_size);
|
||||
ast_cli(fd, "%6s %8s %10s %12s %12s %s\n", "ID", "Scale", "Events",
|
||||
"Value", "Average", "Name");
|
||||
for (i = min; i < max; i++) {
|
||||
struct profile_entry *e = &prof_data->e[i];
|
||||
if (!search || strstr(prof_data->e[i].name, search))
|
||||
ast_cli(fd, "%6d: [%8ld] %10ld %12lld %12lld %s\n",
|
||||
i,
|
||||
(long)e->scale,
|
||||
(long)e->events, (long long)e->value,
|
||||
(long long)(e->events ? e->value / e->events : e->value),
|
||||
e->name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int handle_show_profile(int fd, int argc, char *argv[])
|
||||
{
|
||||
int i, min, max;
|
||||
@@ -1517,23 +1471,6 @@ static int show_license(int fd, int argc, char *argv[])
|
||||
|
||||
#define ASTERISK_PROMPT2 "%s*CLI> "
|
||||
|
||||
#if !defined(LOW_MEMORY)
|
||||
static struct ast_cli_entry cli_show_version_files_deprecated = {
|
||||
{ "show", "version", "files", NULL },
|
||||
handle_show_version_files, NULL,
|
||||
NULL, complete_show_version_files };
|
||||
|
||||
static struct ast_cli_entry cli_show_profile_deprecated = {
|
||||
{ "show", "profile", NULL },
|
||||
handle_show_profile_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_clear_profile_deprecated = {
|
||||
{ "clear", "profile", NULL },
|
||||
handle_show_profile_deprecated, NULL,
|
||||
NULL };
|
||||
#endif /* ! LOW_MEMORY */
|
||||
|
||||
static struct ast_cli_entry cli_asterisk[] = {
|
||||
{ { "abort", "halt", NULL },
|
||||
handle_abort_halt, "Cancel a running halt",
|
||||
@@ -1581,7 +1518,7 @@ static struct ast_cli_entry cli_asterisk[] = {
|
||||
#if !defined(LOW_MEMORY)
|
||||
{ { "file", "list", "version", NULL },
|
||||
handle_show_version_files, "List versions of files used to build Asterisk",
|
||||
show_version_files_help, complete_show_version_files, &cli_show_version_files_deprecated },
|
||||
show_version_files_help, complete_show_version_files },
|
||||
|
||||
{ { "show", "threads", NULL },
|
||||
handle_show_threads, "Show running threads",
|
||||
@@ -1589,11 +1526,11 @@ static struct ast_cli_entry cli_asterisk[] = {
|
||||
|
||||
{ { "profile", "list", NULL },
|
||||
handle_show_profile, "Display profiling info",
|
||||
NULL, NULL, &cli_show_profile_deprecated },
|
||||
NULL },
|
||||
|
||||
{ { "profile", "clear", NULL },
|
||||
handle_show_profile, "Clear profiling info",
|
||||
NULL, NULL, &cli_clear_profile_deprecated },
|
||||
NULL },
|
||||
#endif /* ! LOW_MEMORY */
|
||||
};
|
||||
|
||||
|
14
main/astmm.c
14
main/astmm.c
@@ -404,24 +404,14 @@ static char show_memory_summary_help[] =
|
||||
" Summarizes heap memory allocations by file, or optionally\n"
|
||||
"by function, if a file is specified\n";
|
||||
|
||||
static struct ast_cli_entry cli_show_memory_allocations_deprecated = {
|
||||
{ "show", "memory", "allocations", NULL },
|
||||
handle_show_memory, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_memory_summary_deprecated = {
|
||||
{ "show", "memory", "summary", NULL },
|
||||
handle_show_memory_summary, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_memory[] = {
|
||||
{ { "memory", "show", "allocations", NULL },
|
||||
handle_show_memory, "Display outstanding memory allocations",
|
||||
show_memory_help, NULL, &cli_show_memory_allocations_deprecated },
|
||||
show_memory_help },
|
||||
|
||||
{ { "memory", "show", "summary", NULL },
|
||||
handle_show_memory_summary, "Summarize outstanding memory allocations",
|
||||
show_memory_summary_help, NULL, &cli_show_memory_summary_deprecated },
|
||||
show_memory_summary_help },
|
||||
};
|
||||
|
||||
void __ast_mm_init(void)
|
||||
|
@@ -295,24 +295,14 @@ static char show_channeltype_usage[] =
|
||||
"Usage: channeltype show <name>\n"
|
||||
" Show details about the specified channel type, <name>.\n";
|
||||
|
||||
static struct ast_cli_entry cli_show_channeltypes_deprecated = {
|
||||
{ "show", "channeltypes", NULL },
|
||||
show_channeltypes, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_channeltype_deprecated = {
|
||||
{ "show", "channeltype", NULL },
|
||||
show_channeltype, NULL,
|
||||
NULL, complete_channeltypes };
|
||||
|
||||
static struct ast_cli_entry cli_channel[] = {
|
||||
{ { "channeltype", "list", NULL },
|
||||
show_channeltypes, "List available channel types",
|
||||
show_channeltypes_usage, NULL, &cli_show_channeltypes_deprecated },
|
||||
show_channeltypes_usage },
|
||||
|
||||
{ { "channeltype", "show", NULL },
|
||||
show_channeltype, "Give more details on that channel type",
|
||||
show_channeltype_usage, complete_channeltypes, &cli_show_channeltype_deprecated },
|
||||
show_channeltype_usage, complete_channeltypes },
|
||||
};
|
||||
|
||||
/*! \brief Checks to see if a channel is needing hang up */
|
||||
|
292
main/cli.c
292
main/cli.c
@@ -138,17 +138,6 @@ static char group_show_channels_help[] =
|
||||
" Optional regular expression pattern is matched to group names for each\n"
|
||||
" channel.\n";
|
||||
|
||||
static int handle_load_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
return RESULT_SHOWUSAGE;
|
||||
if (ast_load_resource(argv[1])) {
|
||||
ast_cli(fd, "Unable to load module %s\n", argv[1]);
|
||||
return RESULT_FAILURE;
|
||||
}
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_load(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 3)
|
||||
@@ -160,29 +149,6 @@ static int handle_load(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_reload_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int x;
|
||||
int res;
|
||||
if (argc < 1)
|
||||
return RESULT_SHOWUSAGE;
|
||||
if (argc > 1) {
|
||||
for (x=1;x<argc;x++) {
|
||||
res = ast_module_reload(argv[x]);
|
||||
switch(res) {
|
||||
case 0:
|
||||
ast_cli(fd, "No such module '%s'\n", argv[x]);
|
||||
break;
|
||||
case 1:
|
||||
ast_cli(fd, "Module '%s' does not support reload\n", argv[x]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
ast_module_reload(NULL);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_reload(int fd, int argc, char *argv[])
|
||||
{
|
||||
int x;
|
||||
@@ -206,33 +172,6 @@ static int handle_reload(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_set_verbose_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int val = 0;
|
||||
int oldval = option_verbose;
|
||||
|
||||
/* "set verbose [atleast] N" */
|
||||
if (argc == 3)
|
||||
option_verbose = atoi(argv[2]);
|
||||
else if (argc == 4) {
|
||||
if (strcasecmp(argv[2], "atleast"))
|
||||
return RESULT_SHOWUSAGE;
|
||||
val = atoi(argv[3]);
|
||||
if (val > option_verbose)
|
||||
option_verbose = val;
|
||||
} else
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
if (oldval != option_verbose && option_verbose > 0)
|
||||
ast_cli(fd, "Verbosity was %d and is now %d\n", oldval, option_verbose);
|
||||
else if (oldval > 0 && option_verbose > 0)
|
||||
ast_cli(fd, "Verbosity is at least %d\n", option_verbose);
|
||||
else if (oldval > 0 && option_verbose == 0)
|
||||
ast_cli(fd, "Verbosity is now OFF\n");
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_verbose(int fd, int argc, char *argv[])
|
||||
{
|
||||
int oldval = option_verbose;
|
||||
@@ -254,33 +193,6 @@ static int handle_verbose(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_set_debug_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int val = 0;
|
||||
int oldval = option_debug;
|
||||
|
||||
/* "set debug [atleast] N" */
|
||||
if (argc == 3)
|
||||
option_debug = atoi(argv[2]);
|
||||
else if (argc == 4) {
|
||||
if (strcasecmp(argv[2], "atleast"))
|
||||
return RESULT_SHOWUSAGE;
|
||||
val = atoi(argv[3]);
|
||||
if (val > option_debug)
|
||||
option_debug = val;
|
||||
} else
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
if (oldval != option_debug && option_debug > 0)
|
||||
ast_cli(fd, "Core debug was %d and is now %d\n", oldval, option_debug);
|
||||
else if (oldval > 0 && option_debug > 0)
|
||||
ast_cli(fd, "Core debug is at least %d\n", option_debug);
|
||||
else if (oldval > 0 && option_debug == 0)
|
||||
ast_cli(fd, "Core debug is now OFF\n");
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_debug(int fd, int argc, char *argv[])
|
||||
{
|
||||
int oldval = option_debug;
|
||||
@@ -335,25 +247,6 @@ static int handle_nodebug(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_debuglevel_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int newlevel;
|
||||
char *filename = "<any>";
|
||||
if ((argc < 3) || (argc > 4))
|
||||
return RESULT_SHOWUSAGE;
|
||||
if (sscanf(argv[2], "%d", &newlevel) != 1)
|
||||
return RESULT_SHOWUSAGE;
|
||||
option_debug = newlevel;
|
||||
if (argc == 4) {
|
||||
filename = argv[3];
|
||||
ast_copy_string(debug_filename, filename, sizeof(debug_filename));
|
||||
} else {
|
||||
debug_filename[0] = '\0';
|
||||
}
|
||||
ast_cli(fd, "Debugging level set to %d, file '%s'\n", newlevel, filename);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_logger_mute(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -362,34 +255,6 @@ static int handle_logger_mute(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_unload_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
int x;
|
||||
int force=AST_FORCE_SOFT;
|
||||
if (argc < 2)
|
||||
return RESULT_SHOWUSAGE;
|
||||
for (x=1;x<argc;x++) {
|
||||
if (argv[x][0] == '-') {
|
||||
switch(argv[x][1]) {
|
||||
case 'f':
|
||||
force = AST_FORCE_FIRM;
|
||||
break;
|
||||
case 'h':
|
||||
force = AST_FORCE_HARD;
|
||||
break;
|
||||
default:
|
||||
return RESULT_SHOWUSAGE;
|
||||
}
|
||||
} else if (x != argc - 1)
|
||||
return RESULT_SHOWUSAGE;
|
||||
else if (ast_unload_resource(argv[x], force)) {
|
||||
ast_cli(fd, "Unable to unload resource %s\n", argv[x]);
|
||||
return RESULT_FAILURE;
|
||||
}
|
||||
}
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_unload(int fd, int argc, char *argv[])
|
||||
{
|
||||
int x;
|
||||
@@ -775,38 +640,6 @@ static int handle_debugchan(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_nodebugchan_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_channel *c=NULL;
|
||||
int is_all;
|
||||
/* 'no debug channel {all|chan_id}' */
|
||||
if (argc != 4)
|
||||
return RESULT_SHOWUSAGE;
|
||||
is_all = !strcasecmp("all", argv[3]);
|
||||
if (is_all) {
|
||||
global_fin &= ~DEBUGCHAN_FLAG;
|
||||
global_fout &= ~DEBUGCHAN_FLAG;
|
||||
c = ast_channel_walk_locked(NULL);
|
||||
} else {
|
||||
c = ast_get_channel_by_name_locked(argv[3]);
|
||||
if (c == NULL)
|
||||
ast_cli(fd, "No such channel %s\n", argv[3]);
|
||||
}
|
||||
while(c) {
|
||||
if ((c->fin & DEBUGCHAN_FLAG) || (c->fout & DEBUGCHAN_FLAG)) {
|
||||
c->fin &= ~DEBUGCHAN_FLAG;
|
||||
c->fout &= ~DEBUGCHAN_FLAG;
|
||||
ast_cli(fd, "Debugging disabled on channel %s\n", c->name);
|
||||
}
|
||||
ast_channel_unlock(c);
|
||||
if (!is_all)
|
||||
break;
|
||||
c = ast_channel_walk_locked(c);
|
||||
}
|
||||
ast_cli(fd, "Debugging on new channels is disabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_nodebugchan(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_channel *c=NULL;
|
||||
@@ -972,21 +805,6 @@ static char *complete_ch_3(const char *line, const char *word, int pos, int stat
|
||||
return ast_complete_channels(line, word, pos, state, 2);
|
||||
}
|
||||
|
||||
static char *complete_ch_4(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
return ast_complete_channels(line, word, pos, state, 3);
|
||||
}
|
||||
|
||||
static char *complete_mod_2_nr(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
return ast_module_helper(line, word, pos, state, 1, 0);
|
||||
}
|
||||
|
||||
static char *complete_mod_2(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
return ast_module_helper(line, word, pos, state, 1, 1);
|
||||
}
|
||||
|
||||
static char *complete_mod_3_nr(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
return ast_module_helper(line, word, pos, state, 2, 0);
|
||||
@@ -1002,27 +820,6 @@ static char *complete_mod_4(const char *line, const char *word, int pos, int sta
|
||||
return ast_module_helper(line, word, pos, state, 3, 0);
|
||||
}
|
||||
|
||||
static char *complete_fn_deprecated(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
char *c;
|
||||
char filename[256];
|
||||
|
||||
if (pos != 1)
|
||||
return NULL;
|
||||
|
||||
if (word[0] == '/')
|
||||
ast_copy_string(filename, word, sizeof(filename));
|
||||
else
|
||||
snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_MODULE_DIR, word);
|
||||
|
||||
c = filename_completion_function(filename, state);
|
||||
|
||||
if (c && word[0] != '/')
|
||||
c += (strlen(ast_config_AST_MODULE_DIR) + 1);
|
||||
|
||||
return c ? strdup(c) : c;
|
||||
}
|
||||
|
||||
static char *complete_fn(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
char *c;
|
||||
@@ -1128,91 +925,26 @@ static struct ast_cli_entry builtins[] = {
|
||||
{ { NULL }, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static struct ast_cli_entry cli_debug_channel_deprecated = {
|
||||
{ "debug", "channel", NULL },
|
||||
handle_debugchan, NULL,
|
||||
NULL, complete_ch_3 };
|
||||
|
||||
static struct ast_cli_entry cli_debug_level_deprecated = {
|
||||
{ "debug", "level", NULL },
|
||||
handle_debuglevel_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_group_show_channels_deprecated = {
|
||||
{ "group", "show", "channels", NULL },
|
||||
group_show_channels, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_load_deprecated = {
|
||||
{ "load", NULL },
|
||||
handle_load_deprecated, NULL,
|
||||
NULL, complete_fn_deprecated };
|
||||
|
||||
static struct ast_cli_entry cli_no_debug_channel_deprecated = {
|
||||
{ "no", "debug", "channel", NULL },
|
||||
handle_nodebugchan_deprecated, NULL,
|
||||
NULL, complete_ch_4 };
|
||||
|
||||
static struct ast_cli_entry cli_reload_deprecated = {
|
||||
{ "reload", NULL },
|
||||
handle_reload_deprecated, NULL,
|
||||
NULL, complete_mod_2 };
|
||||
|
||||
static struct ast_cli_entry cli_set_debug_deprecated = {
|
||||
{ "set", "debug", NULL },
|
||||
handle_set_debug_deprecated, NULL,
|
||||
NULL, NULL, &cli_debug_level_deprecated };
|
||||
|
||||
static struct ast_cli_entry cli_set_verbose_deprecated = {
|
||||
{ "set", "verbose", NULL },
|
||||
handle_set_verbose_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_channel_deprecated = {
|
||||
{ "show", "channel", NULL },
|
||||
handle_showchan, NULL,
|
||||
NULL, complete_ch_3 };
|
||||
|
||||
static struct ast_cli_entry cli_show_channels_deprecated = {
|
||||
{ "show", "channels", NULL },
|
||||
handle_chanlist, NULL,
|
||||
NULL, complete_show_channels };
|
||||
|
||||
static struct ast_cli_entry cli_show_modules_deprecated = {
|
||||
{ "show", "modules", NULL },
|
||||
handle_modlist, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_modules_like_deprecated = {
|
||||
{ "show", "modules", "like", NULL },
|
||||
handle_modlist, NULL,
|
||||
NULL, complete_mod_4 };
|
||||
|
||||
static struct ast_cli_entry cli_unload_deprecated = {
|
||||
{ "unload", NULL },
|
||||
handle_unload_deprecated, NULL,
|
||||
NULL, complete_mod_2_nr };
|
||||
|
||||
static struct ast_cli_entry cli_cli[] = {
|
||||
{ { "channel", "list", NULL },
|
||||
handle_chanlist, "Display information on channels",
|
||||
chanlist_help, complete_show_channels, &cli_show_channels_deprecated },
|
||||
chanlist_help, complete_show_channels },
|
||||
|
||||
{ { "channel", "show", NULL },
|
||||
handle_showchan, "Display information on a specific channel",
|
||||
showchan_help, complete_ch_3, &cli_show_channel_deprecated },
|
||||
showchan_help, complete_ch_3 },
|
||||
|
||||
{ { "channel", "debug", NULL },
|
||||
handle_debugchan, "Enable debugging on a channel",
|
||||
debugchan_help, complete_ch_3, &cli_debug_channel_deprecated },
|
||||
debugchan_help, complete_ch_3 },
|
||||
|
||||
{ { "channel", "nodebug", NULL },
|
||||
handle_nodebugchan, "Disable debugging on a channel",
|
||||
nodebugchan_help, complete_ch_3, &cli_no_debug_channel_deprecated },
|
||||
nodebugchan_help, complete_ch_3 },
|
||||
|
||||
{ { "core", "debug", NULL },
|
||||
handle_debug, "Set level of debug chattiness",
|
||||
debug_help, NULL, &cli_set_debug_deprecated },
|
||||
debug_help },
|
||||
|
||||
{ { "core", "nodebug", NULL },
|
||||
handle_nodebug, "Turns off debug chattiness",
|
||||
@@ -1220,11 +952,11 @@ static struct ast_cli_entry cli_cli[] = {
|
||||
|
||||
{ { "core", "verbose", NULL },
|
||||
handle_verbose, "Set level of verboseness",
|
||||
verbose_help, NULL, &cli_set_verbose_deprecated },
|
||||
verbose_help },
|
||||
|
||||
{ { "group", "list", "channels", NULL },
|
||||
group_show_channels, "Display active channels with group(s)",
|
||||
group_show_channels_help, NULL, &cli_group_show_channels_deprecated },
|
||||
group_show_channels_help },
|
||||
|
||||
{ { "help", NULL },
|
||||
handle_help, "Display help list, or specific help on a command",
|
||||
@@ -1236,23 +968,23 @@ static struct ast_cli_entry cli_cli[] = {
|
||||
|
||||
{ { "module", "list", NULL },
|
||||
handle_modlist, "List modules and info",
|
||||
modlist_help, NULL, &cli_show_modules_deprecated },
|
||||
modlist_help },
|
||||
|
||||
{ { "module", "list", "like", NULL },
|
||||
handle_modlist, "List modules and info",
|
||||
modlist_help, complete_mod_4, &cli_show_modules_like_deprecated },
|
||||
modlist_help, complete_mod_4 },
|
||||
|
||||
{ { "module", "load", NULL },
|
||||
handle_load, "Load a module by name",
|
||||
load_help, complete_fn, &cli_load_deprecated },
|
||||
load_help, complete_fn },
|
||||
|
||||
{ { "module", "reload", NULL },
|
||||
handle_reload, "Reload configuration",
|
||||
reload_help, complete_mod_3, &cli_reload_deprecated },
|
||||
reload_help, complete_mod_3 },
|
||||
|
||||
{ { "module", "unload", NULL },
|
||||
handle_unload, "Unload a module by name",
|
||||
unload_help, complete_mod_3_nr, &cli_unload_deprecated },
|
||||
unload_help, complete_mod_3_nr },
|
||||
|
||||
{ { "show", "uptime", NULL },
|
||||
handle_showuptime, "Show uptime information",
|
||||
|
@@ -1235,15 +1235,10 @@ static char show_config_help[] =
|
||||
"Usage: core list config mappings\n"
|
||||
" Shows the filenames to config engines.\n";
|
||||
|
||||
static struct ast_cli_entry cli_show_config_mappings_deprecated = {
|
||||
{ "show", "config", "mappings", NULL },
|
||||
config_command, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_config[] = {
|
||||
{ { "core", "list", "config", "mappings", NULL },
|
||||
config_command, "Display config mappings (file names to config engines)",
|
||||
show_config_help, NULL, &cli_show_config_mappings_deprecated },
|
||||
show_config_help },
|
||||
};
|
||||
|
||||
int register_config_cli()
|
||||
|
@@ -1152,15 +1152,10 @@ char show_file_formats_usage[] =
|
||||
"Usage: core list file formats\n"
|
||||
" Displays currently registered file formats (if any)\n";
|
||||
|
||||
struct ast_cli_entry cli_show_file_formats_deprecated = {
|
||||
{ "show", "file", "formats" },
|
||||
show_file_formats, NULL,
|
||||
NULL };
|
||||
|
||||
struct ast_cli_entry cli_file[] = {
|
||||
{ { "file", "list", "formats" },
|
||||
show_file_formats, "Displays file formats",
|
||||
show_file_formats_usage, NULL, &cli_show_file_formats_deprecated },
|
||||
show_file_formats_usage },
|
||||
};
|
||||
|
||||
int ast_file_init(void)
|
||||
|
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
|
||||
};
|
||||
|
||||
|
@@ -684,15 +684,10 @@ static char show_http_help[] =
|
||||
"Usage: http list status\n"
|
||||
" Lists status of internal HTTP engine\n";
|
||||
|
||||
static struct ast_cli_entry cli_http_show_status_deprecated = {
|
||||
{ "http", "show", "status", NULL },
|
||||
handle_show_http, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_http[] = {
|
||||
{ { "http", "list", "status", NULL },
|
||||
handle_show_http, "Display HTTP server status",
|
||||
show_http_help, NULL, &cli_http_show_status_deprecated },
|
||||
show_http_help },
|
||||
};
|
||||
|
||||
int ast_http_init(void)
|
||||
|
20
main/image.c
20
main/image.c
@@ -180,19 +180,6 @@ int ast_send_image(struct ast_channel *chan, char *filename)
|
||||
return res;
|
||||
}
|
||||
|
||||
static int show_image_formats_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
#define FORMAT "%10s %10s %50s %10s\n"
|
||||
#define FORMAT2 "%10s %10s %50s %10s\n"
|
||||
struct ast_imager *i;
|
||||
if (argc != 3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
ast_cli(fd, FORMAT, "Name", "Extensions", "Description", "Format");
|
||||
AST_LIST_TRAVERSE(&imagers, i, list)
|
||||
ast_cli(fd, FORMAT2, i->name, i->exts, i->desc, ast_getformatname(i->format));
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int show_image_formats(int fd, int argc, char *argv[])
|
||||
{
|
||||
#define FORMAT "%10s %10s %50s %10s\n"
|
||||
@@ -206,16 +193,11 @@ static int show_image_formats(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
struct ast_cli_entry cli_show_image_formats_deprecated = {
|
||||
{ "show", "image", "formats" },
|
||||
show_image_formats_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
struct ast_cli_entry cli_image[] = {
|
||||
{ { "file", "list", "formats", "image" },
|
||||
show_image_formats, "Displays image formats",
|
||||
"Usage: file list formats image\n"
|
||||
" displays currently registered image formats (if any)\n", NULL, &cli_show_image_formats_deprecated },
|
||||
" displays currently registered image formats (if any)\n" },
|
||||
};
|
||||
|
||||
int ast_image_init(void)
|
||||
|
@@ -557,15 +557,10 @@ static char logger_show_channels_help[] =
|
||||
"Usage: logger list channels\n"
|
||||
" List configured logger channels.\n";
|
||||
|
||||
static struct ast_cli_entry cli_logger_show_channels_deprecated = {
|
||||
{ "logger", "show", "channels", NULL },
|
||||
handle_logger_show_channels, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_logger[] = {
|
||||
{ { "logger", "list", "channels", NULL },
|
||||
handle_logger_show_channels, "List configured log channels",
|
||||
logger_show_channels_help, NULL, &cli_logger_show_channels_deprecated },
|
||||
logger_show_channels_help },
|
||||
|
||||
{ { "logger", "reload", NULL },
|
||||
handle_logger_reload, "Reopens the log files",
|
||||
|
@@ -601,42 +601,22 @@ static char showmanager_help[] =
|
||||
" Usage: manager show user <user>\n"
|
||||
" Display all information related to the manager user specified.\n";
|
||||
|
||||
static struct ast_cli_entry cli_show_manager_command_deprecated = {
|
||||
{ "show", "manager", "command", NULL },
|
||||
handle_showmancmd, NULL,
|
||||
NULL, complete_show_mancmd };
|
||||
|
||||
static struct ast_cli_entry cli_show_manager_commands_deprecated = {
|
||||
{ "show", "manager", "commands", NULL },
|
||||
handle_showmancmds, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_manager_connected_deprecated = {
|
||||
{ "show", "manager", "connected", NULL },
|
||||
handle_showmanconn, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_manager_eventq_deprecated = {
|
||||
{ "show", "manager", "eventq", NULL },
|
||||
handle_showmaneventq, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_manager[] = {
|
||||
{ { "manager", "show", "command", NULL },
|
||||
handle_showmancmd, "Show a manager interface command",
|
||||
showmancmd_help, complete_show_mancmd, &cli_show_manager_command_deprecated },
|
||||
showmancmd_help, complete_show_mancmd },
|
||||
|
||||
{ { "manager", "list", "commands", NULL },
|
||||
handle_showmancmds, "List manager interface commands",
|
||||
showmancmds_help, NULL, &cli_show_manager_commands_deprecated },
|
||||
showmancmds_help },
|
||||
|
||||
{ { "manager", "list", "connected", NULL },
|
||||
handle_showmanconn, "List connected manager interface users",
|
||||
showmanconn_help, NULL, &cli_show_manager_connected_deprecated },
|
||||
showmanconn_help },
|
||||
|
||||
{ { "manager", "list", "eventq", NULL },
|
||||
handle_showmaneventq, "List manager interface queued events",
|
||||
showmaneventq_help, NULL, &cli_show_manager_eventq_deprecated },
|
||||
showmaneventq_help },
|
||||
|
||||
{ { "manager", "list", "users", NULL },
|
||||
handle_showmanagers, "List configured manager users",
|
||||
|
310
main/pbx.c
310
main/pbx.c
@@ -1201,36 +1201,6 @@ void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, c
|
||||
}
|
||||
}
|
||||
|
||||
/*! \brief CLI function to show installed custom functions
|
||||
\addtogroup CLI_functions
|
||||
*/
|
||||
static int handle_show_functions_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_custom_function *acf;
|
||||
int count_acf = 0;
|
||||
int like = 0;
|
||||
|
||||
if (argc == 4 && (!strcmp(argv[2], "like")) ) {
|
||||
like = 1;
|
||||
} else if (argc != 2) {
|
||||
return RESULT_SHOWUSAGE;
|
||||
}
|
||||
|
||||
ast_cli(fd, "%s Custom Functions:\n--------------------------------------------------------------------------------\n", like ? "Matching" : "Installed");
|
||||
|
||||
AST_LIST_LOCK(&acf_root);
|
||||
AST_LIST_TRAVERSE(&acf_root, acf, acflist) {
|
||||
if (!like || strstr(acf->name, argv[3])) {
|
||||
count_acf++;
|
||||
ast_cli(fd, "%-20.20s %-35.35s %s\n", acf->name, acf->syntax, acf->synopsis);
|
||||
}
|
||||
}
|
||||
AST_LIST_UNLOCK(&acf_root);
|
||||
|
||||
ast_cli(fd, "%d %scustom functions installed.\n", count_acf, like ? "matching " : "");
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
static int handle_show_functions(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_custom_function *acf;
|
||||
@@ -1259,62 +1229,6 @@ static int handle_show_functions(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_show_function_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_custom_function *acf;
|
||||
/* Maximum number of characters added by terminal coloring is 22 */
|
||||
char infotitle[64 + AST_MAX_APP + 22], syntitle[40], destitle[40];
|
||||
char info[64 + AST_MAX_APP], *synopsis = NULL, *description = NULL;
|
||||
char stxtitle[40], *syntax = NULL;
|
||||
int synopsis_size, description_size, syntax_size;
|
||||
|
||||
if (argc < 3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
if (!(acf = ast_custom_function_find(argv[2]))) {
|
||||
ast_cli(fd, "No function by that name registered.\n");
|
||||
return RESULT_FAILURE;
|
||||
|
||||
}
|
||||
|
||||
if (acf->synopsis)
|
||||
synopsis_size = strlen(acf->synopsis) + 23;
|
||||
else
|
||||
synopsis_size = strlen("Not available") + 23;
|
||||
synopsis = alloca(synopsis_size);
|
||||
|
||||
if (acf->desc)
|
||||
description_size = strlen(acf->desc) + 23;
|
||||
else
|
||||
description_size = strlen("Not available") + 23;
|
||||
description = alloca(description_size);
|
||||
|
||||
if (acf->syntax)
|
||||
syntax_size = strlen(acf->syntax) + 23;
|
||||
else
|
||||
syntax_size = strlen("Not available") + 23;
|
||||
syntax = alloca(syntax_size);
|
||||
|
||||
snprintf(info, 64 + AST_MAX_APP, "\n -= Info about function '%s' =- \n\n", acf->name);
|
||||
term_color(infotitle, info, COLOR_MAGENTA, 0, 64 + AST_MAX_APP + 22);
|
||||
term_color(stxtitle, "[Syntax]\n", COLOR_MAGENTA, 0, 40);
|
||||
term_color(syntitle, "[Synopsis]\n", COLOR_MAGENTA, 0, 40);
|
||||
term_color(destitle, "[Description]\n", COLOR_MAGENTA, 0, 40);
|
||||
term_color(syntax,
|
||||
acf->syntax ? acf->syntax : "Not available",
|
||||
COLOR_CYAN, 0, syntax_size);
|
||||
term_color(synopsis,
|
||||
acf->synopsis ? acf->synopsis : "Not available",
|
||||
COLOR_CYAN, 0, synopsis_size);
|
||||
term_color(description,
|
||||
acf->desc ? acf->desc : "Not available",
|
||||
COLOR_CYAN, 0, description_size);
|
||||
|
||||
ast_cli(fd,"%s%s%s\n\n%s%s\n\n%s%s\n", infotitle, stxtitle, syntax, syntitle, synopsis, destitle, description);
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_show_function(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_custom_function *acf;
|
||||
@@ -3026,76 +2940,6 @@ static char *complete_show_application(const char *line, const char *word, int p
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int handle_show_application_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_app *a;
|
||||
int app, no_registered_app = 1;
|
||||
|
||||
if (argc < 3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
/* ... go through all applications ... */
|
||||
AST_LIST_LOCK(&apps);
|
||||
AST_LIST_TRAVERSE(&apps, a, list) {
|
||||
/* ... compare this application name with all arguments given
|
||||
* to 'show application' command ... */
|
||||
for (app = 2; app < argc; app++) {
|
||||
if (!strcasecmp(a->name, argv[app])) {
|
||||
/* Maximum number of characters added by terminal coloring is 22 */
|
||||
char infotitle[64 + AST_MAX_APP + 22], syntitle[40], destitle[40];
|
||||
char info[64 + AST_MAX_APP], *synopsis = NULL, *description = NULL;
|
||||
int synopsis_size, description_size;
|
||||
|
||||
no_registered_app = 0;
|
||||
|
||||
if (a->synopsis)
|
||||
synopsis_size = strlen(a->synopsis) + 23;
|
||||
else
|
||||
synopsis_size = strlen("Not available") + 23;
|
||||
synopsis = alloca(synopsis_size);
|
||||
|
||||
if (a->description)
|
||||
description_size = strlen(a->description) + 23;
|
||||
else
|
||||
description_size = strlen("Not available") + 23;
|
||||
description = alloca(description_size);
|
||||
|
||||
if (synopsis && description) {
|
||||
snprintf(info, 64 + AST_MAX_APP, "\n -= Info about application '%s' =- \n\n", a->name);
|
||||
term_color(infotitle, info, COLOR_MAGENTA, 0, 64 + AST_MAX_APP + 22);
|
||||
term_color(syntitle, "[Synopsis]\n", COLOR_MAGENTA, 0, 40);
|
||||
term_color(destitle, "[Description]\n", COLOR_MAGENTA, 0, 40);
|
||||
term_color(synopsis,
|
||||
a->synopsis ? a->synopsis : "Not available",
|
||||
COLOR_CYAN, 0, synopsis_size);
|
||||
term_color(description,
|
||||
a->description ? a->description : "Not available",
|
||||
COLOR_CYAN, 0, description_size);
|
||||
|
||||
ast_cli(fd,"%s%s%s\n\n%s%s\n", infotitle, syntitle, synopsis, destitle, description);
|
||||
} else {
|
||||
/* ... one of our applications, show info ...*/
|
||||
ast_cli(fd,"\n -= Info about application '%s' =- \n\n"
|
||||
"[Synopsis]\n %s\n\n"
|
||||
"[Description]\n%s\n",
|
||||
a->name,
|
||||
a->synopsis ? a->synopsis : "Not available",
|
||||
a->description ? a->description : "Not available");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
AST_LIST_UNLOCK(&apps);
|
||||
|
||||
/* we found at least one app? no? */
|
||||
if (no_registered_app) {
|
||||
ast_cli(fd, "Your application(s) is (are) not registered\n");
|
||||
return RESULT_FAILURE;
|
||||
}
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int handle_show_application(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_app *a;
|
||||
@@ -3220,77 +3064,6 @@ static int handle_show_switches(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* 'show applications' CLI command implementation functions ...
|
||||
*/
|
||||
static int handle_show_applications_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_app *a;
|
||||
int like = 0, describing = 0;
|
||||
int total_match = 0; /* Number of matches in like clause */
|
||||
int total_apps = 0; /* Number of apps registered */
|
||||
|
||||
AST_LIST_LOCK(&apps);
|
||||
|
||||
if (AST_LIST_EMPTY(&apps)) {
|
||||
ast_cli(fd, "There are no registered applications\n");
|
||||
AST_LIST_UNLOCK(&apps);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* show applications like <keyword> */
|
||||
if ((argc == 4) && (!strcmp(argv[2], "like"))) {
|
||||
like = 1;
|
||||
} else if ((argc > 3) && (!strcmp(argv[2], "describing"))) {
|
||||
describing = 1;
|
||||
}
|
||||
|
||||
/* show applications describing <keyword1> [<keyword2>] [...] */
|
||||
if ((!like) && (!describing)) {
|
||||
ast_cli(fd, " -= Registered Asterisk Applications =-\n");
|
||||
} else {
|
||||
ast_cli(fd, " -= Matching Asterisk Applications =-\n");
|
||||
}
|
||||
|
||||
AST_LIST_TRAVERSE(&apps, a, list) {
|
||||
int printapp = 0;
|
||||
total_apps++;
|
||||
if (like) {
|
||||
if (strcasestr(a->name, argv[3])) {
|
||||
printapp = 1;
|
||||
total_match++;
|
||||
}
|
||||
} else if (describing) {
|
||||
if (a->description) {
|
||||
/* Match all words on command line */
|
||||
int i;
|
||||
printapp = 1;
|
||||
for (i = 3; i < argc; i++) {
|
||||
if (!strcasestr(a->description, argv[i])) {
|
||||
printapp = 0;
|
||||
} else {
|
||||
total_match++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
printapp = 1;
|
||||
}
|
||||
|
||||
if (printapp) {
|
||||
ast_cli(fd," %20s: %s\n", a->name, a->synopsis ? a->synopsis : "<Synopsis not available>");
|
||||
}
|
||||
}
|
||||
if ((!like) && (!describing)) {
|
||||
ast_cli(fd, " -= %d Applications Registered =-\n",total_apps);
|
||||
} else {
|
||||
ast_cli(fd, " -= %d Applications Matching =-\n",total_match);
|
||||
}
|
||||
|
||||
AST_LIST_UNLOCK(&apps);
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
static int handle_show_applications(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct ast_app *a;
|
||||
@@ -3360,13 +3133,6 @@ static int handle_show_applications(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static char *complete_show_applications_deprecated(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
static char* choices[] = { "like", "describing", NULL };
|
||||
|
||||
return (pos != 2) ? NULL : ast_cli_complete(word, choices, state);
|
||||
}
|
||||
|
||||
static char *complete_show_applications(const char *line, const char *word, int pos, int state)
|
||||
{
|
||||
static char* choices[] = { "like", "describing", NULL };
|
||||
@@ -3649,19 +3415,6 @@ static int handle_show_globals(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
/*! \brief CLI support for setting global variables */
|
||||
static int handle_set_global_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 4)
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
pbx_builtin_setvar_helper(NULL, argv[2], argv[3]);
|
||||
ast_cli(fd, "\n -- Global variable %s set to %s\n", argv[2], argv[3]);
|
||||
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static int handle_set_global(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 5)
|
||||
@@ -3678,87 +3431,42 @@ static int handle_set_global(int fd, int argc, char *argv[])
|
||||
/*
|
||||
* CLI entries for upper commands ...
|
||||
*/
|
||||
static struct ast_cli_entry cli_show_applications_deprecated = {
|
||||
{ "show", "applications", NULL },
|
||||
handle_show_applications_deprecated, NULL,
|
||||
NULL, complete_show_applications_deprecated };
|
||||
|
||||
static struct ast_cli_entry cli_show_functions_deprecated = {
|
||||
{ "show", "functions", NULL },
|
||||
handle_show_functions_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_switches_deprecated = {
|
||||
{ "show", "switches", NULL },
|
||||
handle_show_switches, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_hints_deprecated = {
|
||||
{ "show", "hints", NULL },
|
||||
handle_show_hints, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_globals_deprecated = {
|
||||
{ "show", "globals", NULL },
|
||||
handle_show_globals, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_show_function_deprecated = {
|
||||
{ "show" , "function", NULL },
|
||||
handle_show_function_deprecated, NULL,
|
||||
NULL, complete_show_function };
|
||||
|
||||
static struct ast_cli_entry cli_show_application_deprecated = {
|
||||
{ "show", "application", NULL },
|
||||
handle_show_application_deprecated, NULL,
|
||||
NULL, complete_show_application };
|
||||
|
||||
static struct ast_cli_entry cli_show_dialplan_deprecated = {
|
||||
{ "show", "dialplan", NULL },
|
||||
handle_show_dialplan, NULL,
|
||||
NULL, complete_show_dialplan_context };
|
||||
|
||||
static struct ast_cli_entry cli_set_global_deprecated = {
|
||||
{ "set", "global", NULL },
|
||||
handle_set_global_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry pbx_cli[] = {
|
||||
{ { "core", "list", "applications", NULL },
|
||||
handle_show_applications, "Shows registered dialplan applications",
|
||||
show_applications_help, complete_show_applications, &cli_show_applications_deprecated },
|
||||
show_applications_help, complete_show_applications },
|
||||
|
||||
{ { "core", "list", "functions", NULL },
|
||||
handle_show_functions, "Shows registered dialplan functions",
|
||||
show_functions_help, NULL, &cli_show_functions_deprecated },
|
||||
show_functions_help },
|
||||
|
||||
{ { "core", "list", "switches", NULL },
|
||||
handle_show_switches, "Show alternative switches",
|
||||
show_switches_help, NULL, &cli_show_switches_deprecated },
|
||||
show_switches_help },
|
||||
|
||||
{ { "core", "list", "hints", NULL },
|
||||
handle_show_hints, "Show dialplan hints",
|
||||
show_hints_help, NULL, &cli_show_hints_deprecated },
|
||||
show_hints_help },
|
||||
|
||||
{ { "core", "list", "globals", NULL },
|
||||
handle_show_globals, "Show global dialplan variables",
|
||||
show_globals_help, NULL, &cli_show_globals_deprecated },
|
||||
show_globals_help },
|
||||
|
||||
{ { "core", "show" , "function", NULL },
|
||||
handle_show_function, "Describe a specific dialplan function",
|
||||
show_function_help, complete_show_function, &cli_show_function_deprecated },
|
||||
show_function_help, complete_show_function },
|
||||
|
||||
{ { "core", "show", "application", NULL },
|
||||
handle_show_application, "Describe a specific dialplan application",
|
||||
show_application_help, complete_show_application, &cli_show_application_deprecated },
|
||||
show_application_help, complete_show_application },
|
||||
|
||||
{ { "core", "set", "global", NULL },
|
||||
handle_set_global, "Set global dialplan variable",
|
||||
set_global_help, NULL, &cli_set_global_deprecated },
|
||||
set_global_help },
|
||||
|
||||
{ { "dialplan", "show", NULL },
|
||||
handle_show_dialplan, "Show dialplan",
|
||||
show_dialplan_help, complete_show_dialplan_context, &cli_show_dialplan_deprecated },
|
||||
show_dialplan_help, complete_show_dialplan_context },
|
||||
};
|
||||
|
||||
int ast_unregister_application(const char *app)
|
||||
|
136
main/rtp.c
136
main/rtp.c
@@ -3144,36 +3144,6 @@ static int rtp_do_debug_ip(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_do_debug_ip_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct hostent *hp;
|
||||
struct ast_hostent ahp;
|
||||
int port = 0;
|
||||
char *p, *arg;
|
||||
if (argc != 5)
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
arg = argv[4];
|
||||
p = strstr(arg, ":");
|
||||
if (p) {
|
||||
*p = '\0';
|
||||
p++;
|
||||
port = atoi(p);
|
||||
}
|
||||
hp = ast_gethostbyname(arg, &ahp);
|
||||
if (hp == NULL)
|
||||
return RESULT_SHOWUSAGE;
|
||||
rtcpdebugaddr.sin_family = AF_INET;
|
||||
memcpy(&rtcpdebugaddr.sin_addr, hp->h_addr, sizeof(rtcpdebugaddr.sin_addr));
|
||||
rtcpdebugaddr.sin_port = htons(port);
|
||||
if (port == 0)
|
||||
ast_cli(fd, "RTCP Debugging Enabled for IP: %s\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr));
|
||||
else
|
||||
ast_cli(fd, "RTCP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr), port);
|
||||
rtcpdebug = 1;
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_do_debug_ip(int fd, int argc, char *argv[])
|
||||
{
|
||||
struct hostent *hp;
|
||||
@@ -3217,18 +3187,6 @@ static int rtp_do_debug(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_do_debug_deprecated(int fd, int argc, char *argv[]) {
|
||||
if (argc != 3) {
|
||||
if (argc != 5)
|
||||
return RESULT_SHOWUSAGE;
|
||||
return rtcp_do_debug_ip_deprecated(fd, argc, argv);
|
||||
}
|
||||
rtcpdebug = 1;
|
||||
memset(&rtcpdebugaddr,0,sizeof(rtcpdebugaddr));
|
||||
ast_cli(fd, "RTCP Debugging Enabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_do_debug(int fd, int argc, char *argv[]) {
|
||||
if (argc != 2) {
|
||||
if (argc != 4)
|
||||
@@ -3241,15 +3199,6 @@ static int rtcp_do_debug(int fd, int argc, char *argv[]) {
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_do_stats_deprecated(int fd, int argc, char *argv[]) {
|
||||
if (argc != 3) {
|
||||
return RESULT_SHOWUSAGE;
|
||||
}
|
||||
rtcpstats = 1;
|
||||
ast_cli(fd, "RTCP Stats Enabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_do_stats(int fd, int argc, char *argv[]) {
|
||||
if (argc != 2) {
|
||||
return RESULT_SHOWUSAGE;
|
||||
@@ -3259,15 +3208,6 @@ static int rtcp_do_stats(int fd, int argc, char *argv[]) {
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtp_no_debug_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
rtpdebug = 0;
|
||||
ast_cli(fd,"RTP Debugging Disabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtp_no_debug(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -3277,15 +3217,6 @@ static int rtp_no_debug(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_no_debug_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 4)
|
||||
return RESULT_SHOWUSAGE;
|
||||
rtcpdebug = 0;
|
||||
ast_cli(fd,"RTCP Debugging Disabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_no_debug(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -3295,15 +3226,6 @@ static int rtcp_no_debug(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_no_stats_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 4)
|
||||
return RESULT_SHOWUSAGE;
|
||||
rtcpstats = 0;
|
||||
ast_cli(fd,"RTCP Stats Disabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int rtcp_no_stats(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -3323,15 +3245,6 @@ static int stun_do_debug(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int stun_no_debug_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
stundebug = 0;
|
||||
ast_cli(fd,"STUN Debugging Disabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int stun_no_debug(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -3373,41 +3286,6 @@ static char rtcp_no_stats_usage[] =
|
||||
"Usage: rtcp nostats\n"
|
||||
" Disable all RTCP stats\n";
|
||||
|
||||
static struct ast_cli_entry cli_rtp_no_debug_deprecated = {
|
||||
{ "rtp", "no", "debug", NULL },
|
||||
rtp_no_debug_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_rtp_rtcp_debug_ip_deprecated = {
|
||||
{ "rtp", "rtcp", "debug", "ip", NULL },
|
||||
rtcp_do_debug_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_rtp_rtcp_debug_deprecated = {
|
||||
{ "rtp", "rtcp", "debug", NULL },
|
||||
rtcp_do_debug_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_rtp_rtcp_no_debug_deprecated = {
|
||||
{ "rtp", "rtcp", "no", "debug", NULL },
|
||||
rtcp_no_debug_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_rtp_rtcp_stats_deprecated = {
|
||||
{ "rtp", "rtcp", "stats", NULL },
|
||||
rtcp_do_stats_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_rtp_rtcp_no_stats_deprecated = {
|
||||
{ "rtp", "rtcp", "no", "stats", NULL },
|
||||
rtcp_no_stats_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_stun_no_debug_deprecated = {
|
||||
{ "stun", "no", "debug", NULL },
|
||||
stun_no_debug_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_rtp[] = {
|
||||
{ { "rtp", "debug", "ip", NULL },
|
||||
rtp_do_debug, "Enable RTP debugging on IP",
|
||||
@@ -3419,27 +3297,27 @@ static struct ast_cli_entry cli_rtp[] = {
|
||||
|
||||
{ { "rtp", "nodebug", NULL },
|
||||
rtp_no_debug, "Disable RTP debugging",
|
||||
no_debug_usage, NULL, &cli_rtp_no_debug_deprecated },
|
||||
no_debug_usage },
|
||||
|
||||
{ { "rtcp", "debug", "ip", NULL },
|
||||
rtcp_do_debug, "Enable RTCP debugging on IP",
|
||||
rtcp_debug_usage, NULL, &cli_rtp_rtcp_debug_ip_deprecated },
|
||||
rtcp_debug_usage },
|
||||
|
||||
{ { "rtcp", "debug", NULL },
|
||||
rtcp_do_debug, "Enable RTCP debugging",
|
||||
rtcp_debug_usage, NULL, &cli_rtp_rtcp_debug_deprecated },
|
||||
rtcp_debug_usage },
|
||||
|
||||
{ { "rtcp", "nodebug", NULL },
|
||||
rtcp_no_debug, "Disable RTCP debugging",
|
||||
rtcp_no_debug_usage, NULL, &cli_rtp_rtcp_no_debug_deprecated },
|
||||
rtcp_no_debug_usage },
|
||||
|
||||
{ { "rtcp", "stats", NULL },
|
||||
rtcp_do_stats, "Enable RTCP stats",
|
||||
rtcp_stats_usage, NULL, &cli_rtp_rtcp_stats_deprecated },
|
||||
rtcp_stats_usage },
|
||||
|
||||
{ { "rtcp", "nostats", NULL },
|
||||
rtcp_no_stats, "Disable RTCP stats",
|
||||
rtcp_no_stats_usage, NULL, &cli_rtp_rtcp_no_stats_deprecated },
|
||||
rtcp_no_stats_usage },
|
||||
|
||||
{ { "stun", "debug", NULL },
|
||||
stun_do_debug, "Enable STUN debugging",
|
||||
@@ -3447,7 +3325,7 @@ static struct ast_cli_entry cli_rtp[] = {
|
||||
|
||||
{ { "stun", "nodebug", NULL },
|
||||
stun_no_debug, "Disable STUN debugging",
|
||||
stun_no_debug_usage, NULL, &cli_stun_no_debug_deprecated },
|
||||
stun_no_debug_usage },
|
||||
};
|
||||
|
||||
int ast_rtp_reload(void)
|
||||
|
@@ -474,76 +474,6 @@ static void rebuild_matrix(int samples)
|
||||
}
|
||||
}
|
||||
|
||||
/*! \brief CLI "show translation" command handler */
|
||||
static int show_translation_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
#define SHOW_TRANS 12
|
||||
int x, y, z;
|
||||
int curlen = 0, longest = 0;
|
||||
|
||||
if (argc > 4)
|
||||
return RESULT_SHOWUSAGE;
|
||||
|
||||
AST_LIST_LOCK(&translators);
|
||||
|
||||
if (argv[2] && !strcasecmp(argv[2], "recalc")) {
|
||||
z = argv[3] ? atoi(argv[3]) : 1;
|
||||
|
||||
if (z <= 0) {
|
||||
ast_cli(fd, " C'mon let's be serious here... defaulting to 1.\n");
|
||||
z = 1;
|
||||
}
|
||||
|
||||
if (z > MAX_RECALC) {
|
||||
ast_cli(fd, " Maximum limit of recalc exceeded by %d, truncating value to %d\n", z - MAX_RECALC, MAX_RECALC);
|
||||
z = MAX_RECALC;
|
||||
}
|
||||
ast_cli(fd, " Recalculating Codec Translation (number of sample seconds: %d)\n\n", z);
|
||||
rebuild_matrix(z);
|
||||
}
|
||||
|
||||
ast_cli(fd, " Translation times between formats (in milliseconds) for one second of data\n");
|
||||
ast_cli(fd, " Source Format (Rows) Destination Format (Columns)\n\n");
|
||||
/* Get the length of the longest (usable?) codec name, so we know how wide the left side should be */
|
||||
for (x = 0; x < SHOW_TRANS; x++) {
|
||||
curlen = strlen(ast_getformatname(1 << (x + 1)));
|
||||
if (curlen > longest)
|
||||
longest = curlen;
|
||||
}
|
||||
for (x = -1; x < SHOW_TRANS; x++) {
|
||||
char line[80];
|
||||
char *buf = line;
|
||||
size_t left = sizeof(line) - 1; /* one initial space */
|
||||
/* next 2 lines run faster than using ast_build_string() */
|
||||
*buf++ = ' ';
|
||||
*buf = '\0';
|
||||
for (y = -1; y < SHOW_TRANS; y++) {
|
||||
curlen = strlen(ast_getformatname(1 << (y)));
|
||||
|
||||
if (x >= 0 && y >= 0 && tr_matrix[x][y].step) {
|
||||
/* XXX 999 is a little hackish
|
||||
We don't want this number being larger than the shortest (or current) codec
|
||||
For now, that is "gsm" */
|
||||
ast_build_string(&buf, &left, "%*d", curlen + 1, tr_matrix[x][y].cost > 999 ? 0 : tr_matrix[x][y].cost);
|
||||
} else if (x == -1 && y >= 0) {
|
||||
/* Top row - use a dynamic size */
|
||||
ast_build_string(&buf, &left, "%*s", curlen + 1, ast_getformatname(1 << (x + y + 1)) );
|
||||
} else if (y == -1 && x >= 0) {
|
||||
/* Left column - use a static size. */
|
||||
ast_build_string(&buf, &left, "%*s", longest, ast_getformatname(1 << (x + y + 1)) );
|
||||
} else if (x >= 0 && y >= 0) {
|
||||
ast_build_string(&buf, &left, "%*s", curlen + 1, "-");
|
||||
} else {
|
||||
ast_build_string(&buf, &left, "%*s", longest, "");
|
||||
}
|
||||
}
|
||||
ast_build_string(&buf, &left, "\n");
|
||||
ast_cli(fd, line);
|
||||
}
|
||||
AST_LIST_UNLOCK(&translators);
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int show_translation(int fd, int argc, char *argv[])
|
||||
{
|
||||
#define SHOW_TRANS 12
|
||||
@@ -620,15 +550,10 @@ static char show_trans_usage[] =
|
||||
"with optional number of seconds to test a new test will be performed\n"
|
||||
"as the chart is being displayed.\n";
|
||||
|
||||
static struct ast_cli_entry cli_show_translation_deprecated = {
|
||||
{ "show", "translation", NULL },
|
||||
show_translation_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_translate[] = {
|
||||
{ { "core", "show", "translation", NULL },
|
||||
show_translation, "Display translation matrix",
|
||||
show_trans_usage, NULL, &cli_show_translation_deprecated },
|
||||
show_trans_usage, NULL, NULL },
|
||||
};
|
||||
|
||||
/*! \brief register codec translator */
|
||||
|
16
main/udptl.c
16
main/udptl.c
@@ -1135,15 +1135,6 @@ static int udptl_do_debug(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int udptl_nodebug_deprecated(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc !=3)
|
||||
return RESULT_SHOWUSAGE;
|
||||
udptldebug = 0;
|
||||
ast_cli(fd,"UDPTL Debugging Disabled\n");
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
static int udptl_nodebug(int fd, int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -1161,11 +1152,6 @@ static char nodebug_usage[] =
|
||||
"Usage: udptl nodebug\n"
|
||||
" Disable all UDPTL debugging\n";
|
||||
|
||||
static struct ast_cli_entry cli_udptl_no_debug = {
|
||||
{ "udptl", "no", "debug", NULL },
|
||||
udptl_nodebug_deprecated, NULL,
|
||||
NULL };
|
||||
|
||||
static struct ast_cli_entry cli_udptl[] = {
|
||||
{ { "udptl", "debug", NULL },
|
||||
udptl_do_debug, "Enable UDPTL debugging",
|
||||
@@ -1177,7 +1163,7 @@ static struct ast_cli_entry cli_udptl[] = {
|
||||
|
||||
{ { "udptl", "nodebug", NULL },
|
||||
udptl_nodebug, "Disable UDPTL debugging",
|
||||
nodebug_usage, NULL, &cli_udptl_no_debug },
|
||||
nodebug_usage, NULL, NULL },
|
||||
};
|
||||
|
||||
void ast_udptl_reload(void)
|
||||
|
Reference in New Issue
Block a user