Index: res/res_rtp_asterisk.c =================================================================== --- res/res_rtp_asterisk.c (revision 267926) +++ res/res_rtp_asterisk.c (working copy) @@ -2455,12 +2455,12 @@ static void ast_rtp_stop(struct ast_rtp_instance * ast_set_flag(rtp, FLAG_NEED_MARKER_BIT); } -static char *rtp_do_debug_ip(struct ast_cli_args *a) +static char *rtp_do_debug_ip(int fd, const char *host) { struct hostent *hp; struct ast_hostent ahp; int port = 0; - char *p, *arg = ast_strdupa(a->argv[4]); + char *p, *arg = ast_strdupa(host); p = strstr(arg, ":"); if (p) { @@ -2470,26 +2470,26 @@ static void ast_rtp_stop(struct ast_rtp_instance * } hp = ast_gethostbyname(arg, &ahp); if (hp == NULL) { - ast_cli(a->fd, "Lookup failed for '%s'\n", arg); + ast_cli(fd, "Lookup failed for '%s'\n", arg); return CLI_FAILURE; } rtpdebugaddr.sin_family = AF_INET; memcpy(&rtpdebugaddr.sin_addr, hp->h_addr, sizeof(rtpdebugaddr.sin_addr)); rtpdebugaddr.sin_port = htons(port); if (port == 0) - ast_cli(a->fd, "RTP Debugging Enabled for IP: %s\n", ast_inet_ntoa(rtpdebugaddr.sin_addr)); + ast_cli(fd, "RTP Debugging Enabled for IP: %s\n", ast_inet_ntoa(rtpdebugaddr.sin_addr)); else - ast_cli(a->fd, "RTP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(rtpdebugaddr.sin_addr), port); + ast_cli(fd, "RTP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(rtpdebugaddr.sin_addr), port); rtpdebug = 1; return CLI_SUCCESS; } -static char *rtcp_do_debug_ip(struct ast_cli_args *a) +static char *rtcp_do_debug_ip(int fd, const char *host) { struct hostent *hp; struct ast_hostent ahp; int port = 0; - char *p, *arg = ast_strdupa(a->argv[3]); + char *p, *arg = ast_strdupa(host); p = strstr(arg, ":"); if (p) { @@ -2499,16 +2499,16 @@ static void ast_rtp_stop(struct ast_rtp_instance * } hp = ast_gethostbyname(arg, &ahp); if (hp == NULL) { - ast_cli(a->fd, "Lookup failed for '%s'\n", arg); + ast_cli(fd, "Lookup failed for '%s'\n", arg); return CLI_FAILURE; } rtcpdebugaddr.sin_family = AF_INET; memcpy(&rtcpdebugaddr.sin_addr, hp->h_addr, sizeof(rtcpdebugaddr.sin_addr)); rtcpdebugaddr.sin_port = htons(port); if (port == 0) - ast_cli(a->fd, "RTCP Debugging Enabled for IP: %s\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr)); + ast_cli(fd, "RTCP Debugging Enabled for IP: %s\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr)); else - ast_cli(a->fd, "RTCP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr), port); + ast_cli(fd, "RTCP Debugging Enabled for IP: %s:%d\n", ast_inet_ntoa(rtcpdebugaddr.sin_addr), port); rtcpdebug = 1; return CLI_SUCCESS; } @@ -2539,8 +2539,8 @@ static char *handle_cli_rtp_set_debug(struct ast_c ast_cli(a->fd, "RTP Debugging Disabled\n"); return CLI_SUCCESS; } - } else if (a->argc == e->args +1) { /* ip */ - return rtp_do_debug_ip(a); + } else if (a->argc == e->args + 1) { /* ip */ + return rtp_do_debug_ip(a->fd, a->argv[4]); } return CLI_SHOWUSAGE; /* default, failure */ @@ -2572,8 +2572,8 @@ static char *handle_cli_rtcp_set_debug(struct ast_ ast_cli(a->fd, "RTCP Debugging Disabled\n"); return CLI_SUCCESS; } - } else if (a->argc == e->args +1) { /* ip */ - return rtcp_do_debug_ip(a); + } else if (a->argc == e->args + 1) { /* ip */ + return rtcp_do_debug_ip(a->fd, a->argv[4]); } return CLI_SHOWUSAGE; /* default, failure */