From: Scott Griepentrog Date: Fri, 11 Jul 2014 16:39:41 +0000 (+0000) Subject: config: inform config hook of change when writing file X-Git-Tag: certified/11.6-cert5~2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34f1adbf96085d6cf5656e67214d8b2be07c49ba;p=thirdparty%2Fasterisk.git config: inform config hook of change when writing file When updated configuration is written back to the conf file - for example when a user changes their voicemail pin, make sure that any config hook that wants to know of changes is informed. Review: https://reviewboard.asterisk.org/r/3708/ ........ Merged revisions 418366 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/certified/branches/11.6@418368 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/config.c b/main/config.c index 3c1b95602e..40a135d012 100644 --- a/main/config.c +++ b/main/config.c @@ -69,7 +69,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") static char *extconfig_conf = "extconfig.conf"; static struct ao2_container *cfg_hooks; -static void config_hook_exec(const char *filename, const char *module, struct ast_config *cfg); +static void config_hook_exec(const char *filename, const char *module, const struct ast_config *cfg); /*! \brief Structure to keep comments for rewriting configuration files */ struct ast_comment { @@ -2271,6 +2271,9 @@ int ast_config_text_file_save(const char *configfile, const struct ast_config *c } ao2_ref(fileset, -1); /* this should destroy the hash container */ + /* pass new configuration to any config hooks */ + config_hook_exec(configfile, generator, cfg); + return 0; } @@ -3288,7 +3291,7 @@ void ast_config_hook_unregister(const char *name) ao2_find(cfg_hooks, &tmp, OBJ_POINTER | OBJ_UNLINK | OBJ_NODATA); } -static void config_hook_exec(const char *filename, const char *module, struct ast_config *cfg) +static void config_hook_exec(const char *filename, const char *module, const struct ast_config *cfg) { struct ao2_iterator it; struct cfg_hook *hook;