summaryrefslogtreecommitdiff
path: root/main/pbx.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2016-01-04 19:20:35 -0500
committerCorey Farrell <git@cfware.com>2016-01-04 19:20:35 -0500
commit54a8f1a396bb1866573b6c85bac34abcda18581f (patch)
tree4df349d8f956658109a5e45f9648b00aee3d74a3 /main/pbx.c
parentc3c8b8e41dac290cbfbecb3e4a6dfde2d57d4e35 (diff)
main/pbx: Move switch routines to pbx_switch.c.
This is the fifth patch in a series meant to reduce the bulk of pbx.c. This moves ast_switch functions to their own source. Change-Id: Ic2592a18a5c4d8a3c2dcf9786c9a6f650a8c628e
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/main/pbx.c b/main/pbx.c
index a7342b582..8a7528315 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -767,8 +767,6 @@ AST_MUTEX_DEFINE_STATIC(context_merge_lock);
*/
static AST_RWLIST_HEAD_STATIC(apps, ast_app);
-static AST_RWLIST_HEAD_STATIC(switches, ast_switch);
-
static int stateid = 1;
/*!
* \note When holding this container's lock, do _not_ do
@@ -1024,20 +1022,6 @@ struct ast_app *pbx_findapp(const char *app)
return ret;
}
-static struct ast_switch *pbx_findswitch(const char *sw)
-{
- struct ast_switch *asw;
-
- AST_RWLIST_RDLOCK(&switches);
- AST_RWLIST_TRAVERSE(&switches, asw, list) {
- if (!strcasecmp(asw->name, sw))
- break;
- }
- AST_RWLIST_UNLOCK(&switches);
-
- return asw;
-}
-
static inline int include_valid(struct ast_include *i)
{
if (!i->hastime)
@@ -5405,35 +5389,6 @@ int ast_register_application2(const char *app, int (*execute)(struct ast_channel
}
/*
- * Append to the list. We don't have a tail pointer because we need
- * to scan the list anyways to check for duplicates during insertion.
- */
-int ast_register_switch(struct ast_switch *sw)
-{
- struct ast_switch *tmp;
-
- AST_RWLIST_WRLOCK(&switches);
- AST_RWLIST_TRAVERSE(&switches, tmp, list) {
- if (!strcasecmp(tmp->name, sw->name)) {
- AST_RWLIST_UNLOCK(&switches);
- ast_log(LOG_WARNING, "Switch '%s' already found\n", sw->name);
- return -1;
- }
- }
- AST_RWLIST_INSERT_TAIL(&switches, sw, list);
- AST_RWLIST_UNLOCK(&switches);
-
- return 0;
-}
-
-void ast_unregister_switch(struct ast_switch *sw)
-{
- AST_RWLIST_WRLOCK(&switches);
- AST_RWLIST_REMOVE(&switches, sw, list);
- AST_RWLIST_UNLOCK(&switches);
-}
-
-/*
* Help for CLI commands ...
*/
@@ -5720,40 +5675,6 @@ static char *handle_show_hint(struct ast_cli_entry *e, int cmd, struct ast_cli_a
return CLI_SUCCESS;
}
-
-/*! \brief handle_show_switches: CLI support for listing registered dial plan switches */
-static char *handle_show_switches(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
-{
- struct ast_switch *sw;
-
- switch (cmd) {
- case CLI_INIT:
- e->command = "core show switches";
- e->usage =
- "Usage: core show switches\n"
- " List registered switches\n";
- return NULL;
- case CLI_GENERATE:
- return NULL;
- }
-
- AST_RWLIST_RDLOCK(&switches);
-
- if (AST_RWLIST_EMPTY(&switches)) {
- AST_RWLIST_UNLOCK(&switches);
- ast_cli(a->fd, "There are no registered alternative switches\n");
- return CLI_SUCCESS;
- }
-
- ast_cli(a->fd, "\n -= Registered Asterisk Alternative Switches =-\n");
- AST_RWLIST_TRAVERSE(&switches, sw, list)
- ast_cli(a->fd, "%s: %s\n", sw->name, sw->description);
-
- AST_RWLIST_UNLOCK(&switches);
-
- return CLI_SUCCESS;
-}
-
#if 0
/* This code can be used to test if the system survives running out of memory.
* It might be an idea to put this in only if ENABLE_AUTODESTRUCT_TESTS is enabled.
@@ -6596,7 +6517,6 @@ static struct ast_cli_entry pbx_cli[] = {
AST_CLI_DEFINE(handle_eat_memory, "Eats all available memory"),
#endif
AST_CLI_DEFINE(handle_show_applications, "Shows registered dialplan applications"),
- AST_CLI_DEFINE(handle_show_switches, "Show alternative switches"),
AST_CLI_DEFINE(handle_show_hints, "Show dialplan hints"),
AST_CLI_DEFINE(handle_show_hint, "Show dialplan hint"),
#ifdef AST_DEVMODE