Don't reload a configuration file if nothing has changed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-08-16 21:09:46 +00:00
parent c0060cd99a
commit 56b9568164
75 changed files with 881 additions and 561 deletions

View File

@@ -134,11 +134,12 @@ static struct ast_translator lintoalaw = {
.buf_size = BUFFER_SAMPLES,
};
static void parse_config(void)
static void parse_config(int reload)
{
struct ast_variable *var;
struct ast_config *cfg = ast_config_load("codecs.conf");
if (!cfg)
struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
struct ast_config *cfg = ast_config_load("codecs.conf", config_flags);
if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
return;
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
if (!strcasecmp(var->name, "genericplc")) {
@@ -153,7 +154,7 @@ static void parse_config(void)
static int reload(void)
{
parse_config();
parse_config(1);
return 0;
}
@@ -171,7 +172,7 @@ static int load_module(void)
{
int res;
parse_config();
parse_config(0);
res = ast_register_translator(&alawtolin);
if (!res)
res = ast_register_translator(&lintoalaw);