From: Michiel van Baak Date: Sat, 12 Sep 2009 13:15:39 +0000 (+0000) Subject: Use the ip for the new 'rtp set debug ip '. X-Git-Tag: 1.6.1.7-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6c26fc5ba81981c922e42fcaf500af4c5ac45bb;p=thirdparty%2Fasterisk.git Use the ip for the new 'rtp set debug ip '. Since 1.6.X still has the deprecated 'rtp debug ip ' this patch is different from the fix that went into trunk (closes issue 0015711) Reported by: davidw Patches: 2009082800-rtpdebug.diff.txt uploaded by mvanbaak (license 7) Tested by: davidw git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@218112 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/rtp.c b/main/rtp.c index bb73d253fc..dcd6807b20 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -4496,14 +4496,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'; @@ -4585,7 +4589,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; @@ -4618,7 +4622,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 */