45 AST_RWLIST_TRAVERSE(&
switches, asw, list) {
46 if (!strcasecmp(asw->
name, sw))
63 AST_RWLIST_TRAVERSE(&
switches, tmp, list) {
64 if (!strcasecmp(tmp->
name, sw->
name)) {
66 ast_log(LOG_WARNING,
"Switch '%s' already found\n", sw->
name);
70 AST_RWLIST_INSERT_TAIL(&
switches, sw, list);
79 AST_RWLIST_REMOVE(&
switches, sw, list);
90 e->
command =
"core show switches";
92 "Usage: core show switches\n"
93 " List registered switches\n";
103 ast_cli(a->fd,
"There are no registered alternative switches\n");
107 ast_cli(a->fd,
"\n -= Registered Asterisk Alternative Switches =-\n");
108 AST_RWLIST_TRAVERSE(&
switches, sw, list)
120 static void unload_pbx_switch(
void)
static char * handle_show_switches(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
handle_show_switches: CLI support for listing registered dial plan switches
Asterisk main include file. File version handling, generic pbx functions.
Private include file for pbx.
int ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
Unregister multiple commands.
descriptor for a cli entry.
#define AST_RWLIST_RDLOCK(head)
Read locks a list.
#define AST_RWLIST_WRLOCK(head)
Write locks a list.
#define ast_cli_register_multiple(e, len)
Register multiple commands.
int ast_register_switch(struct ast_switch *sw)
Register an alternative dialplan switch.
#define AST_RWLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized...
void ast_unregister_switch(struct ast_switch *sw)
Unregister an alternative switch.
int ast_register_cleanup(void(*func)(void))
Register a function to be executed before Asterisk gracefully exits.
A set of macros to manage forward-linked lists.
Core PBX routines and definitions.
Prototypes for public functions only of internal interest,.
Standard Command Line Interface.
struct ast_switch * pbx_findswitch(const char *sw)
int load_pbx_switch(void)
#define AST_RWLIST_UNLOCK(head)
Attempts to unlock a read/write based list.