diff options
author | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-12 13:10:18 +0000 |
---|---|---|
committer | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-09-12 13:10:18 +0000 |
commit | 4c98f29c8e0107743af74417b06425be9de473d5 (patch) | |
tree | 9b799e83a053d5371166a0dd3f7d988370fa6c60 /main | |
parent | e69584d5e90bb1caae546f66ab1a08bd0176320d (diff) |
Use the ip for the new 'rtp set debug ip <foo>'.
Since 1.6.X still has the deprecated 'rtp debug ip <foo>'
this patch is different from the fix that went into trunk
(closes issue #15711)
Reported by: davidw
Patches:
2009082800-rtpdebug.diff.txt uploaded by mvanbaak (license 7)
Tested by: davidw
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@218108 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/rtp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/main/rtp.c b/main/rtp.c index f8493883e..33a2211c9 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -3989,14 +3989,18 @@ enum ast_bridge_result ast_rtp_bridge(struct ast_channel *c0, struct ast_channel return res; } -static char *rtp_do_debug_ip(struct ast_cli_args *a) +static char *rtp_do_debug_ip(struct ast_cli_args *a, int deprecated) { struct hostent *hp; struct ast_hostent ahp; int port = 0; char *p, *arg; - arg = a->argv[3]; + if (deprecated == 1) { + arg = a->argv[3]; + } else { + arg = a->argv[4]; + } p = strstr(arg, ":"); if (p) { *p = '\0'; @@ -4078,7 +4082,7 @@ static char *handle_cli_rtp_debug_deprecated(struct ast_cli_entry *e, int cmd, s } else { if (strncasecmp(a->argv[2], "ip", 2)) return CLI_SHOWUSAGE; - return rtp_do_debug_ip(a); + return rtp_do_debug_ip(a, 1); } return CLI_SUCCESS; @@ -4111,7 +4115,7 @@ static char *handle_cli_rtp_set_debug(struct ast_cli_entry *e, int cmd, struct a return CLI_SUCCESS; } } else if (a->argc == e->args +1) { /* ip */ - return rtp_do_debug_ip(a); + return rtp_do_debug_ip(a, 0); } return CLI_SHOWUSAGE; /* default, failure */ |