diff --git a/main/config_options.c b/main/config_options.c index 167647dc52..f047f7df50 100644 --- a/main/config_options.c +++ b/main/config_options.c @@ -473,7 +473,7 @@ static int process_category(struct ast_config *cfg, struct aco_info *info, struc field = info->internal->pending + type->item_offset; if (!*field) { - ast_log(LOG_ERROR, "No object to update!\n"); + ast_log(LOG_ERROR, "In %s: %s - No object to update!\n", file->filename, cat); return -1; } diff --git a/main/features_config.c b/main/features_config.c index fee1138623..64bb2abd5c 100644 --- a/main/features_config.c +++ b/main/features_config.c @@ -180,7 +180,7 @@ format for the recording is determined by the TOUCH_MONITOR_FORMAT channel variable. If this variable is not specified, then wav is the default. The filename is constructed in the following manner: - + prefix-timestamp-filename where prefix is either the value of the TOUCH_MONITOR_PREFIX @@ -547,9 +547,15 @@ static void *featuregroup_alloc(const char *cat) return group; } +/* Used for deprecated parking configuration */ +struct dummy_config { + char dummy; +}; + struct features_config { struct features_global_config *global; struct ast_featuremap_config *featuremap; + struct dummy_config *parkinglots; struct ao2_container *applicationmap; struct ao2_container *featuregroups; }; @@ -588,14 +594,24 @@ static struct aco_type featuregroup_option = { .item_find = featuregroup_find, }; +static struct aco_type parkinglot_option = { + .type = ACO_GLOBAL, + .name = "parkinglot", + .category_match = ACO_WHITELIST, + .category = "^parkinglot_.*$", + .item_offset = offsetof(struct features_config, parkinglots), + .hidden = 1, +}; + static struct aco_type *global_options[] = ACO_TYPES(&global_option); static struct aco_type *featuremap_options[] = ACO_TYPES(&featuremap_option); static struct aco_type *applicationmap_options[] = ACO_TYPES(&applicationmap_option); static struct aco_type *featuregroup_options[] = ACO_TYPES(&featuregroup_option); +static struct aco_type *parkinglot_options[] = ACO_TYPES(&parkinglot_option); static struct aco_file features_conf = { .filename = "features.conf", - .types = ACO_TYPES(&global_option, &featuremap_option, &applicationmap_option, &featuregroup_option), + .types = ACO_TYPES(&global_option, &featuremap_option, &applicationmap_option, &featuregroup_option, &parkinglot_option), }; AO2_GLOBAL_OBJ_STATIC(globals); @@ -714,6 +730,11 @@ static struct features_config *__features_config_alloc(int allocate_applicationm return NULL; } + cfg->parkinglots = ao2_alloc(sizeof(*cfg->parkinglots), NULL); + if (!cfg->parkinglots) { + return NULL; + } + if (allocate_applicationmap) { cfg->applicationmap = applicationmap_alloc(1); if (!cfg->applicationmap) { @@ -1433,9 +1454,15 @@ static int pickup_handler(const struct aco_option *opt, return pickup_set(pickup, var->name, var->value); } +static int parking_warning = 0; static int unsupported_handler(const struct aco_option *opt, struct ast_variable *var, void *obj) { + if (!parking_warning) { + ast_log(LOG_WARNING, "Parkinglots are no longer configurable in features.conf; " + "parking is now handled by res_parking.conf\n"); + parking_warning = 1; + } ast_log(LOG_WARNING, "The option '%s' is no longer configurable in features.conf.\n", var->name); return 0; } @@ -1708,6 +1735,9 @@ static int load_config(void) aco_option_register_custom(&cfg_info, "^.*$", ACO_REGEX, featuregroup_options, "", featuregroup_handler, 0); + aco_option_register_custom_nodoc(&cfg_info, "^.*$", ACO_REGEX, parkinglot_options, + "", unsupported_handler, 0); + if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) { RAII_VAR(struct features_config *, features_cfg, __features_config_alloc(0), ao2_cleanup);