[asterisk-commits] twilson: branch twilson/config_work r361949 - /team/twilson/config_work/apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 11 16:46:48 CDT 2012


Author: twilson
Date: Wed Apr 11 16:46:45 2012
New Revision: 361949

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361949
Log:
Stash a minor fix to app_skel before trying out something new

Modified:
    team/twilson/config_work/apps/app_skel.c

Modified: team/twilson/config_work/apps/app_skel.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/apps/app_skel.c?view=diff&rev=361949&r1=361948&r2=361949
==============================================================================
--- team/twilson/config_work/apps/app_skel.c (original)
+++ team/twilson/config_work/apps/app_skel.c Wed Apr 11 16:46:45 2012
@@ -300,7 +300,6 @@
 static struct skel_pvt_config *new_pvt_cfg(struct ast_config *cfg, const char *cat)
 {
 	struct skel_pvt_config *pvtcfg;
-	struct ast_variable *var;
 
 	if (!(pvtcfg = ao2_alloc(sizeof(*pvtcfg), skel_pvt_config_destructor))) {
 		return NULL;
@@ -323,12 +322,9 @@
 		return NULL;
 	}
 
-	for (var = ast_variable_browse(cfg, cat); var; var = var->next) {
-		if (ast_config_parse_category_options(config_opts, cfg, cat, pvtcfg)) {
-			ast_log(LOG_WARNING, "Config parsing failed at lineno %d, %s=%s\n", var->lineno, var->name, var->value);
-			ao2_ref(pvtcfg, -1);
-			return NULL;
-		}
+	if (ast_config_parse_category_options(config_opts, cfg, cat, pvtcfg)) {
+		ao2_ref(pvtcfg, -1);
+		return NULL;
 	}
 
 	return pvtcfg;
@@ -589,6 +585,7 @@
 	ast_config_option_register(config_opts, "blah", CONTEXT_ALLOW, "general", NULL, OPT_BOOL_T, struct skel_global_config, 1, blah);
 	ast_config_option_register(config_opts, "bindaddr", CONTEXT_ALLOW, "general", "0.0.0.0:1234", OPT_SOCKADDR_T, struct skel_global_config, PARSE_PORT_REQUIRE, bindaddr);
 
+	/* Private Options */
 	ast_config_option_register(config_opts, "description", CONTEXT_DENY, "general", NULL, OPT_STRINGFIELD_T, struct skel_pvt_config, 0, description);
 	ast_config_option_register(config_opts, "allow", CONTEXT_DENY, "general", "ulaw,alaw", OPT_CODEC_T, struct skel_pvt_config, 1, prefs, caps);
 	ast_config_option_register(config_opts, "permit", CONTEXT_DENY, "general", NULL, OPT_ACL_T, struct skel_pvt_config, 1, permit);




More information about the asterisk-commits mailing list