Temporary fix for people using sample features.conf from previous Asterisk versions.
authorMark Michelson <mmichelson@digium.com>
Mon, 10 Jun 2013 15:32:02 +0000 (15:32 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 10 Jun 2013 15:32:02 +0000 (15:32 +0000)
People who use the features.conf.sample file from Asterisk 11 and before in trunk were
given a rude awakening when features configuration changes were made. Because it uses the
config framework and the config framework is strict about what is accepted and what isn't,
people that had parking options configured found that Asterisk no longer started. This is
because parking options are currently handled in res_parking.conf instead of features.conf.

This fix seeks to create a temporary band-aid fix for the problem, but having parking options
from the general section be passed to a handler that will simply print that the option is no
longer supported. This will not cause Asterisk to exit.

The fix only applies to options in the general section. There are two main reasons for this:

1) The sample features.conf file only has parking options in the general section. There are no
configured parking lots. Therefore it's not quite as "urgent" to get the parking lot parsing
fixed.

2) The plan is to move parking configuration back from res_parking.conf to features.conf. When
that happens, the parking lots will also be addressed at that time.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391269 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/features_config.c

index 4e5a65e..163c37d 100644 (file)
@@ -1168,6 +1168,13 @@ static int pickup_handler(const struct aco_option *opt,
        return pickup_set(pickup, var->name, var->value);
 }
 
        return pickup_set(pickup, var->name, var->value);
 }
 
+static int unsupported_handler(const struct aco_option *opt,
+               struct ast_variable *var, void *obj)
+{
+       ast_log(LOG_WARNING, "The option '%s' is no longer configurable in features.conf.\n", var->name);
+       return 0;
+}
+
 static int featuremap_handler(const struct aco_option *opt,
                struct ast_variable *var, void *obj)
 {
 static int featuremap_handler(const struct aco_option *opt,
                struct ast_variable *var, void *obj)
 {
@@ -1378,6 +1385,41 @@ static int load_config(int reload)
        aco_option_register_custom(&cfg_info, "pickupfailsound", ACO_EXACT, global_options,
                        DEFAULT_PICKUPFAILSOUND, pickup_handler, 0);
 
        aco_option_register_custom(&cfg_info, "pickupfailsound", ACO_EXACT, global_options,
                        DEFAULT_PICKUPFAILSOUND, pickup_handler, 0);
 
+       aco_option_register_custom(&cfg_info, "context", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkext", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkext_exclusive", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkinghints", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkedmusicclass", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkingtime", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkpos", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "findslot", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkedcalltransfers", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkedcallreparking", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkedcallhangup", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkedcallrecording", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "comebackcontext", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "comebacktoorigin", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "comebackdialtime", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "parkeddynamic", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+       aco_option_register_custom(&cfg_info, "adsipark", ACO_EXACT, global_options,
+                       "", unsupported_handler, 0);
+
        aco_option_register_custom(&cfg_info, "blindxfer", ACO_EXACT, featuremap_options,
                        DEFAULT_FEATUREMAP_BLINDXFER, featuremap_handler, 0);
        aco_option_register_custom(&cfg_info, "disconnect", ACO_EXACT, featuremap_options,
        aco_option_register_custom(&cfg_info, "blindxfer", ACO_EXACT, featuremap_options,
                        DEFAULT_FEATUREMAP_BLINDXFER, featuremap_handler, 0);
        aco_option_register_custom(&cfg_info, "disconnect", ACO_EXACT, featuremap_options,