Index: main/http.c =================================================================== --- main/http.c (revision 82513) +++ main/http.c (working copy) @@ -1229,15 +1229,26 @@ return 0; } -static int handle_show_http(int fd, int argc, char *argv[]) +static char *handle_show_http(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { struct ast_http_uri *urih; struct http_uri_redirect *redirect; struct ast_http_post_mapping *post_map; - - if (argc != 3) - return RESULT_SHOWUSAGE; - + int fd; + switch ( cmd ) { + case CLI_INIT: + e->command = "http show status"; + e->usage = + "Usage: http show status\n" + " Lists status of internal HTTP engine\n"; + return NULL; + case CLI_GENERATE: + return NULL; + } + + if ( 3 != a->argc ) + return CLI_SHOWUSAGE; + fd = a->fd; ast_cli(fd, "HTTP Server Status:\n"); ast_cli(fd, "Prefix: %s\n", prefix); if (!http_desc.oldsin.sin_family) @@ -1278,7 +1289,7 @@ ast_cli(fd, "%s\n", AST_LIST_EMPTY(&post_mappings) ? "None.\n" : ""); AST_RWLIST_UNLOCK(&post_mappings); - return RESULT_SUCCESS; + return CLI_SUCCESS; } int ast_http_reload(void) @@ -1286,14 +1297,8 @@ return __ast_http_load(1); } -static char show_http_help[] = -"Usage: http show status\n" -" Lists status of internal HTTP engine\n"; - static struct ast_cli_entry cli_http[] = { - { { "http", "show", "status", NULL }, - handle_show_http, "Display HTTP server status", - show_http_help }, + NEW_CLI(handle_show_http, "Display HTTP server status"), }; int ast_http_init(void)