----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviewboard.asterisk.org/r/4313/ -----------------------------------------------------------
Review request for Asterisk Developers. Repository: Asterisk Description ------- I guess nobody uses templates with AST_CONFIG because today if you have a context that inherits from a template and you call AST_CONFIG on the context, you'll get the value from the template even if you've overridden it in the context. This is because AST_CONFIG only gets the first occurrence which is always from the template. This patch adds an optional 'index' parameter to AST_CONFIG which lets you specify the exact occurrence to retrieve, or '-1' to retrieve the last. The default behavior is the current behavior. >From the new help... [Syntax] AST_CONFIG(config_file,category,variable_name[,index]) [Arguments] index If there are multiple variables with the same name, you can specify '0' for the first item (default), '-1' for the last item, or any other number for that specific item. '-1' is useful when the variable is derived from a template and you want the effective value (the last occurrence), not the value from the template (the first occurrence). Diffs ----- branches/13/tests/test_config.c 430163 branches/13/funcs/func_config.c 430163 Diff: https://reviewboard.asterisk.org/r/4313/diff/ Testing ------- Added a unit test to test_config which passes of course. Thanks, George Joseph
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev