aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-10 17:01:06 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-10 17:01:06 +0000
commit597aa05da580ab8d40c4e2bec66c321ed20803f3 (patch)
treef383932b2ec9f93ee875d3ca5e4bfca778865778 /channels/chan_sip.c
parentfc1882af792ad211d1f52de1a6ce7e1172ae991f (diff)
Merged revisions 47436 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r47436 | tilghman | 2006-11-10 10:51:55 -0600 (Fri, 10 Nov 2006) | 2 lines Discussion of these CLI changes resulted in more consistency (Bug 8236) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47439 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 818673ee5..cb45e7652 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -10859,9 +10859,10 @@ static int sip_do_debug_ip(int fd, int argc, char *argv[])
int port = 0;
char *p, *arg;
- if (argc != 4)
+ /* sip set debug ip <ip> */
+ if (argc != 5)
return RESULT_SHOWUSAGE;
- p = arg = argv[3];
+ p = arg = argv[4];
strsep(&p, ":");
if (p)
port = atoi(p);
@@ -10886,9 +10887,9 @@ static int sip_do_debug_ip(int fd, int argc, char *argv[])
static int sip_do_debug_peer(int fd, int argc, char *argv[])
{
struct sip_peer *peer;
- if (argc != 4)
+ if (argc != 5)
return RESULT_SHOWUSAGE;
- peer = find_peer(argv[3], NULL, 1);
+ peer = find_peer(argv[4], NULL, 1);
if (peer) {
if (peer->addr.sin_addr.s_addr) {
debugaddr.sin_family = AF_INET;
@@ -10897,10 +10898,10 @@ static int sip_do_debug_peer(int fd, int argc, char *argv[])
ast_cli(fd, "SIP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(debugaddr.sin_addr), ntohs(debugaddr.sin_port));
ast_set_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONSOLE);
} else
- ast_cli(fd, "Unable to get IP address of peer '%s'\n", argv[3]);
+ ast_cli(fd, "Unable to get IP address of peer '%s'\n", argv[4]);
unref_peer(peer);
} else
- ast_cli(fd, "No such peer '%s'\n", argv[3]);
+ ast_cli(fd, "No such peer '%s'\n", argv[4]);
return RESULT_SUCCESS;
}
@@ -10908,12 +10909,12 @@ static int sip_do_debug_peer(int fd, int argc, char *argv[])
static int sip_do_debug(int fd, int argc, char *argv[])
{
int oldsipdebug = sipdebug_console;
- if (argc != 2) {
- if (argc != 4)
+ if (argc != 4) {
+ if (argc != 5)
return RESULT_SHOWUSAGE;
- else if (strcmp(argv[2], "ip") == 0)
+ else if (strcmp(argv[3], "ip") == 0)
return sip_do_debug_ip(fd, argc, argv);
- else if (strcmp(argv[2], "peer") == 0)
+ else if (strcmp(argv[3], "peer") == 0)
return sip_do_debug_peer(fd, argc, argv);
else
return RESULT_SHOWUSAGE;
@@ -10983,7 +10984,7 @@ static int sip_notify(int fd, int argc, char *argv[])
/*! \brief Disable SIP Debugging in CLI */
static int sip_no_debug(int fd, int argc, char *argv[])
{
- if (argc != 3)
+ if (argc != 4)
return RESULT_SHOWUSAGE;
ast_clear_flag(&global_flags[1], SIP_PAGE2_DEBUG_CONSOLE);
ast_cli(fd, "SIP Debugging Disabled\n");
@@ -11284,8 +11285,7 @@ static char history_usage[] =
static char sip_reload_usage[] =
"Usage: sip reload\n"
-" Reloads SIP configuration from sip.conf\n"
-" Deprecated: please use 'reload chan_sip.so'\n";
+" Reloads SIP configuration from sip.conf\n";
static char show_subscriptions_usage[] =
"Usage: sip show subscriptions\n"
@@ -17006,12 +17006,6 @@ static int sip_do_reload(enum channelreloadreason reason)
/*! \brief Force reload of module from cli */
static int sip_reload(int fd, int argc, char *argv[])
{
- static int deprecated = 0;
- if (!deprecated && argc > 0) {
- ast_log(LOG_WARNING, "\"sip reload\" is deprecated. Please use 'reload chan_sip.so' instead.\n");
- deprecated = 1;
- }
-
ast_mutex_lock(&sip_reload_lock);
if (sip_reloading)
ast_verbose("Previous SIP reload not yet done\n");
@@ -17104,19 +17098,19 @@ static struct ast_cli_entry cli_sip[] = {
sip_prune_realtime, "Prune cached Realtime user(s)",
prune_realtime_usage, complete_sip_prune_realtime_user },
- { { "sip", "debug", NULL },
+ { { "sip", "set", "debug", NULL },
sip_do_debug, "Enable SIP debugging",
debug_usage },
- { { "sip", "debug", "ip", NULL },
+ { { "sip", "set", "debug", "ip", NULL },
sip_do_debug, "Enable SIP debugging on IP",
debug_usage },
- { { "sip", "debug", "peer", NULL },
+ { { "sip", "set", "debug", "peer", NULL },
sip_do_debug, "Enable SIP debugging on Peername",
debug_usage, complete_sip_debug_peer },
- { { "sip", "debug", "off", NULL },
+ { { "sip", "set", "debug", "off", NULL },
sip_no_debug, "Disable SIP debugging",
no_debug_usage },