[asterisk-commits] jrose: trunk r397366 - in /trunk: ./ main/udptl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 21 18:09:17 CDT 2013


Author: jrose
Date: Wed Aug 21 18:09:14 2013
New Revision: 397366

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397366
Log:
UDPTL: Fix a regression where UDPTL won't load default settings

If the file udptl.conf is unavailable at startup, UDPTL will fail to
initialize and while it makes some noise, it isn't immediately
obvious why consumers start to fail when using it. This patch makes
UDPTL load as though an empty config was provided  when udptl is
unavailable at startup.

(closes issue ASTERISK-22349)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/2773/
........

Merged revisions 397365 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/main/udptl.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/udptl.c?view=diff&rev=397366&r1=397365&r2=397366
==============================================================================
--- trunk/main/udptl.c (original)
+++ trunk/main/udptl.c Wed Aug 21 18:09:14 2013
@@ -1458,8 +1458,15 @@
 
 static void __ast_udptl_reload(int reload)
 {
+	RAII_VAR(struct udptl_config *, udptl_cfg, udptl_snapshot_alloc(), ao2_cleanup);
+
 	if (aco_process_config(&cfg_info, reload) == ACO_PROCESS_ERROR) {
-		ast_log(LOG_WARNING, "Could not reload udptl config\n");
+		if (!reload) {
+			if (!aco_set_defaults(&general_option, "general", udptl_cfg->general)) {
+				ast_log(LOG_WARNING, "Could not load udptl config; using defaults\n");
+				ao2_global_obj_replace(globals, udptl_cfg);
+			}
+		}
 	}
 }
 




More information about the asterisk-commits mailing list