[asterisk-commits] mjordan: branch 13 r429029 - in /branches/13: ./ apps/app_meetme.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Dec 6 11:27:27 CST 2014


Author: mjordan
Date: Sat Dec  6 11:27:22 2014
New Revision: 429029

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=429029
Log:
apps/app_meetme: Apply default values on initial load with no config file

When the app_meetme module is loaded without its configuration file, the
module settings aren't initialized. In particular, this impacts the use
of logging realtime members. This patch guarantees that we always set the
default module settings on initial load.

Review: https://reviewboard.asterisk.org/r/4242/

ASTERISK-24572 #close
Reported by: Nuno Borges
patches:
  24572.patch uploaded by Nuno Borges (License 6116)
........

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

Merged revisions 429028 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    branches/13/   (props changed)
    branches/13/apps/app_meetme.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: branches/13/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/apps/app_meetme.c?view=diff&rev=429029&r1=429028&r2=429029
==============================================================================
--- branches/13/apps/app_meetme.c (original)
+++ branches/13/apps/app_meetme.c Sat Dec  6 11:27:22 2014
@@ -5770,21 +5770,8 @@
 	return AST_DEVICE_INUSE;
 }
 
-static void load_config_meetme(void)
-{
-	struct ast_config *cfg;
-	struct ast_flags config_flags = { 0 };
-	const char *val;
-
-	if (!(cfg = ast_config_load(CONFIG_FILE_NAME, config_flags))) {
-		return;
-	} else if (cfg == CONFIG_STATUS_FILEINVALID) {
-		ast_log(LOG_ERROR, "Config file " CONFIG_FILE_NAME " is in an invalid format.  Aborting.\n");
-		return;
-	}
-
-	audio_buffers = DEFAULT_AUDIO_BUFFERS;
-
+static void meetme_set_defaults(void)
+{
 	/*  Scheduling support is off by default */
 	rt_schedule = 0;
 	fuzzystart = 0;
@@ -5793,7 +5780,29 @@
 	extendby = 0;
 
 	/*  Logging of participants defaults to ON for compatibility reasons */
-	rt_log_members = 1;  
+	rt_log_members = 1;
+}
+
+static void load_config_meetme(int reload)
+{
+	struct ast_config *cfg;
+	struct ast_flags config_flags = { 0 };
+	const char *val;
+
+	if (!reload) {
+		meetme_set_defaults();
+	}
+
+	if (!(cfg = ast_config_load(CONFIG_FILE_NAME, config_flags))) {
+		return;
+	} else if (cfg == CONFIG_STATUS_FILEINVALID) {
+		ast_log(LOG_ERROR, "Config file " CONFIG_FILE_NAME " is in an invalid format.  Aborting.\n");
+		return;
+	}
+
+	if (reload) {
+		meetme_set_defaults();
+	}
 
 	if ((val = ast_variable_retrieve(cfg, "general", "audiobuffers"))) {
 		if ((sscanf(val, "%30d", &audio_buffers) != 1)) {
@@ -8000,7 +8009,7 @@
 
 static int load_config(int reload)
 {
-	load_config_meetme();
+	load_config_meetme(reload);
 	return sla_load_config(reload);
 }
 




More information about the asterisk-commits mailing list