apps/app_verify.c
static char *handle_show_profiles(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
#define FORMAT  "%-20s %-7s %-8s %-10s %-13s %-11s %-9s %-11s %-14s\n"
#define FORMAT2 "%-20s %7s %8d %10d %13d %11d %9d %11d %14d\n"
	struct call_verify *v;

	switch(cmd) {
	case CLI_INIT:
		e->command = "verify show profiles";
		e->usage =
			"Usage: verify show profiles\n"
			"       Lists all verification profiles.\n";
		return NULL;
	case CLI_GENERATE:
		return NULL;
	}

	ast_cli(a->fd, FORMAT, "Name", "Method", "Total In", "Success In", "% In Verified", "Blacklisted", "Total Out", "Success Out", "% Out Verified");
	ast_cli(a->fd, FORMAT, "--------------------", "-------", "--------", "----------", "-------------", "-----------", "---------", "-----------", "--------------");
	AST_RWLIST_RDLOCK(&verifys);
	AST_LIST_TRAVERSE(&verifys, v, entry) {
		ast_cli(a->fd, FORMAT2, v->name, v->verifymethod, v->in, v->insuccess, (int) (v->in == 0 ? 0 : (100.0 * v->insuccess) / v->in),
			v->total_blacklisted,
			v->out, v->outsuccess, (int) (v->out == 0 ? 0 : (100.0 * v->outsuccess) / v->out));
	}
	AST_RWLIST_UNLOCK(&verifys);

	return CLI_SUCCESS;
#undef FORMAT
#undef FORMAT2
}
/*! \brief CLI command to list verification profiles */
\brief CLI command to list verification profiles
\ brief CLI command to list verification profiles
static char *handle_show_profiles(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
#define FORMAT  "%-20s %-7s %-8s %-10s %-13s %-11s %-9s %-11s %-14s\n"
#define FORMAT2 "%-20s %7s %8d %10d %13d %11d %9d %11d %14d\n"
	struct call_verify *v;
	switch(cmd) {
	case CLI_INIT:
		e->command = "verify show profiles";
		e->usage =
			"Usage: verify show profiles\n"
			"       Lists all verification profiles.\n";
		return NULL;
	case CLI_GENERATE:
		return NULL;
	}
	ast_cli(a->fd, FORMAT, "Name", "Method", "Total In", "Success In", "% In Verified", "Blacklisted", "Total Out", "Success Out", "% Out Verified");
	ast_cli(a->fd, FORMAT, "--------------------", "-------", "--------", "----------", "-------------", "-----------", "---------", "-----------", "--------------");
	AST_RWLIST_RDLOCK(&verifys);
	AST_LIST_TRAVERSE(&verifys, v, entry) {
		ast_cli(a->fd, FORMAT2, v->name, v->verifymethod, v->in, v->insuccess, (int) (v->in == 0 ? 0 : (100.0 * v->insuccess) / v->in),
			v->total_blacklisted,
			v->out, v->outsuccess, (int) (v->out == 0 ? 0 : (100.0 * v->outsuccess) / v->out));
	}
	AST_RWLIST_UNLOCK(&verifys);
	return CLI_SUCCESS;
#undef FORMAT
#undef FORMAT2
}
static char * handle_show_profiles ( struct ast_cli_entry * e , int cmd , struct ast_cli_args * a ) { #define FORMAT   "%-20s %-7s %-8s %-10s %-13s %-11s %-9s %-11s %-14s\n" #define FORMAT2  "%-20s %7s %8d %10d %13d %11d %9d %11d %14d\n" struct call_verify * v ; switch ( cmd ) { case CLI_INIT : e -> command = " " ; e -> usage = " \n " " \n " ; return NULL ; case CLI_GENERATE : return NULL ; } ast_cli ( a -> fd , FORMAT , " " , " " , " " , " " , " " , " " , " " , " " , " " ) ; ast_cli ( a -> fd , FORMAT , " " , " " , " " , " " , " " , " " , " " , " " , " " ) ; AST_RWLIST_RDLOCK ( & verifys ) ; AST_LIST_TRAVERSE ( & verifys , v , entry ) { ast_cli ( a -> fd , FORMAT2 , v -> name , v -> verifymethod , v -> in , v -> insuccess , ( int ) ( v -> in == 0 ? 0 : ( 100.0 * v -> insuccess ) / v -> in ) , v -> total_blacklisted , v -> out , v -> outsuccess , ( int ) ( v -> out == 0 ? 0 : ( 100.0 * v -> outsuccess ) / v -> out ) ) ; } AST_RWLIST_UNLOCK ( & verifys ) ; return CLI_SUCCESS ; #undef  FORMAT #undef  FORMAT2 }
\brief CLI command to list verification profiles
\ brief CLI command to list verification profiles