[asterisk-commits] mmichelson: branch mmichelson/agent_experiment r376379 - /team/mmichelson/age...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 15 21:39:04 CST 2012


Author: mmichelson
Date: Thu Nov 15 21:39:00 2012
New Revision: 376379

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376379
Log:
Actually process configuration on startup.


Modified:
    team/mmichelson/agent_experiment/channels/chan_agent2.c

Modified: team/mmichelson/agent_experiment/channels/chan_agent2.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/agent_experiment/channels/chan_agent2.c?view=diff&rev=376379&r1=376378&r2=376379
==============================================================================
--- team/mmichelson/agent_experiment/channels/chan_agent2.c (original)
+++ team/mmichelson/agent_experiment/channels/chan_agent2.c Thu Nov 15 21:39:00 2012
@@ -516,10 +516,21 @@
 	aco_option_register(&cfg_info, "ackcall", ACO_EXACT, agent_options, "no", OPT_BOOL_T, 1, FLDSET(struct agent_cfg, ackcall));
 	aco_option_register(&cfg_info, "wrapuptime", ACO_EXACT, agent_options, "0", OPT_UINT_T, 0, FLDSET(struct agent_cfg, wrapuptime));
 
+	if (aco_process_config(&cfg_info, 0) == ACO_PROCESS_ERROR) {
+		goto failure;
+		ast_log(LOG_ERROR, "Unable to process agent config\n");
+		return AST_MODULE_LOAD_DECLINE;
+	}
+	
 	if (ast_register_application_xml(login_app, login_exec) < 0) {
-		return AST_MODULE_LOAD_FAILURE;
+		goto failure;
 	}
 	return AST_MODULE_LOAD_SUCCESS;
+
+failure:
+	ao2_ref(agents, -1);
+	aco_info_destroy(&cfg_info);
+	return AST_MODULE_LOAD_DECLINE;
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk agent channel and applications",




More information about the asterisk-commits mailing list