summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/main/channel.c b/main/channel.c
index c71d19b81..c7847cbd4 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -304,25 +304,23 @@ static char *handle_cli_core_show_channeltypes(struct ast_cli_entry *e, int cmd,
static char *complete_channeltypes(struct ast_cli_args *a)
{
struct chanlist *cl;
- int which = 0;
int wordlen;
- char *ret = NULL;
- if (a->pos != 3)
+ if (a->pos != 3) {
return NULL;
+ }
wordlen = strlen(a->word);
AST_RWLIST_RDLOCK(&backends);
AST_RWLIST_TRAVERSE(&backends, cl, list) {
- if (!strncasecmp(a->word, cl->tech->type, wordlen) && ++which > a->n) {
- ret = ast_strdup(cl->tech->type);
- break;
+ if (!strncasecmp(a->word, cl->tech->type, wordlen)) {
+ ast_cli_completion_add(ast_strdup(cl->tech->type));
}
}
AST_RWLIST_UNLOCK(&backends);
- return ret;
+ return NULL;
}
/*! \brief Show details about a channel driver - CLI command */
@@ -782,7 +780,7 @@ static int does_id_conflict(const char *uniqueid)
}
/*! \brief Create a new channel structure */
-static struct ast_channel * attribute_malloc __attribute__((format(printf, 15, 0)))
+static struct ast_channel *__attribute__((format(printf, 15, 0)))
__ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char *cid_name,
const char *acctcode, const char *exten, const char *context, const struct ast_assigned_ids *assignedids,
const struct ast_channel *requestor, enum ama_flags amaflag, struct ast_endpoint *endpoint,
@@ -7583,22 +7581,6 @@ static int ast_channel_hash_cb(const void *obj, const int flags)
return ast_str_case_hash(name);
}
-int ast_plc_reload(void)
-{
- struct ast_variable *var;
- struct ast_flags config_flags = { 0 };
- struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
- if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEUNCHANGED || cfg == CONFIG_STATUS_FILEINVALID)
- return 0;
- for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
- if (!strcasecmp(var->name, "genericplc")) {
- ast_set2_flag(&ast_options, ast_true(var->value), AST_OPT_FLAG_GENERIC_PLC);
- }
- }
- ast_config_destroy(cfg);
- return 0;
-}
-
/*!
* \internal
* \brief Print channel object key (name).
@@ -7822,8 +7804,6 @@ int ast_channels_init(void)
ast_cli_register_multiple(cli_channel, ARRAY_LEN(cli_channel));
- ast_plc_reload();
-
ast_register_cleanup(channels_shutdown);
AST_RWLIST_HEAD_INIT(&ami_vars);