aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-30 17:32:23 +0000
committerpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-30 17:32:23 +0000
commiteb01fde579544c86b8bca1dafd2d7cc2e6bd8d65 (patch)
treeff1ae520e87a690c38eabb99324e76f33f37c583
parent4eb39c67940b4747a32664e2b4d13404231d8488 (diff)
Merged revisions 273233 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r273233 | pabelanger | 2010-06-30 13:28:04 -0400 (Wed, 30 Jun 2010) | 11 lines Fix rt(c)p set debug ip taking wrong argument Also clean up some coding errors. (closes issue #17469) Reported by: wdoekes Patches: astsvn-rtp-set-debug-ip.patch uploaded by wdoekes (license 717) Tested by: wdoekes, pabelanger ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@273234 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/rtp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 016d3b57e..6ac4fe7d8 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -4601,7 +4601,7 @@ static char *rtp_do_debug_ip(struct ast_cli_args *a)
int port = 0;
char *p, *arg;
- arg = a->argv[3];
+ arg = a->argv[4];
p = strstr(arg, ":");
if (p) {
*p = '\0';
@@ -4616,10 +4616,11 @@ static char *rtp_do_debug_ip(struct ast_cli_args *a)
rtpdebugaddr.sin_family = AF_INET;
memcpy(&rtpdebugaddr.sin_addr, hp->h_addr, sizeof(rtpdebugaddr.sin_addr));
rtpdebugaddr.sin_port = htons(port);
- if (port == 0)
+ if (port == 0) {
ast_cli(a->fd, "RTP Debugging Enabled for IP: %s\n", ast_inet_ntoa(rtpdebugaddr.sin_addr));
- else
+ } else {
ast_cli(a->fd, "RTP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(rtpdebugaddr.sin_addr), port);
+ }
rtpdebug = 1;
return CLI_SUCCESS;
}
@@ -4631,7 +4632,7 @@ static char *rtcp_do_debug_ip(struct ast_cli_args *a)
int port = 0;
char *p, *arg;
- arg = a->argv[3];
+ arg = a->argv[4];
p = strstr(arg, ":");
if (p) {
*p = '\0';
@@ -4646,10 +4647,11 @@ static char *rtcp_do_debug_ip(struct ast_cli_args *a)
rtcpdebugaddr.sin_family = AF_INET;
memcpy(&rtcpdebugaddr.sin_addr, hp->h_addr, sizeof(rtcpdebugaddr.sin_addr));
rtcpdebugaddr.sin_port = htons(port);
- if (port == 0)
+ if (port == 0) {
ast_cli(a->fd, "RTCP Debugging Enabled for IP: %s\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr));
- else
+ } else {
ast_cli(a->fd, "RTCP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr), port);
+ }
rtcpdebug = 1;
return CLI_SUCCESS;
}