diff options
author | pabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-30 17:28:04 +0000 |
---|---|---|
committer | pabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-30 17:28:04 +0000 |
commit | 09ff356e5942113ae21274ce588e44ef5c349d1d (patch) | |
tree | 964610ce2d0b4b996856818b90f76f0e66195ae3 /res | |
parent | d23e32bf0aa8a19aea205773c0057fe53cfec0b3 (diff) |
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/trunk@273233 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_rtp_asterisk.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 0de03de28..282e187cd 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -2532,10 +2532,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; } @@ -2545,7 +2546,7 @@ static char *rtcp_do_debug_ip(struct ast_cli_args *a) struct hostent *hp; struct ast_hostent ahp; int port = 0; - char *p, *arg = ast_strdupa(a->argv[3]); + char *p, *arg = ast_strdupa(a->argv[4]); p = strstr(arg, ":"); if (p) { @@ -2561,10 +2562,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; } |