summaryrefslogtreecommitdiff
path: root/main/udptl.c
diff options
context:
space:
mode:
authorJonathan Rose <jrose@digium.com>2013-08-21 23:09:14 +0000
committerJonathan Rose <jrose@digium.com>2013-08-21 23:09:14 +0000
commit75bb247d2b442762243de7bcac293fd003e1c4a2 (patch)
tree408be2e798b6ea1c56bade8018289254a49bcd2b /main/udptl.c
parentb816fe45b6bf3d61f873013b833908f500054d76 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/udptl.c')
-rw-r--r--main/udptl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/main/udptl.c b/main/udptl.c
index 8ae8334a9..d5d77388d 100644
--- a/main/udptl.c
+++ b/main/udptl.c
@@ -1458,8 +1458,15 @@ static int removed_options_handler(const struct aco_option *opt, struct ast_vari
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);
+ }
+ }
}
}