mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
issue #5599
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2005-11-07 Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* asterisk.c (main): force a dnsmgr background refresh after all other modules are initialized (issue #5599)
|
||||
* dnsmgr.c: add ability to start a background refresh on demand (issue #5599)
|
||||
|
||||
* apps/app_dial.c (HANDLE_CAUSE): set CDR disposition to match cause code (issue #5602)
|
||||
|
||||
* asterisk.c: support 'runuser' and 'rungroup' options in asterisk.conf (issue #5621)
|
||||
|
@@ -2255,6 +2255,9 @@ int main(int argc, char *argv[])
|
||||
printf(term_quit());
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dnsmgr_start_refresh();
|
||||
|
||||
#if 0
|
||||
/* This should no longer be necessary */
|
||||
/* sync cust config and reload some internals in case a custom config handler binded to them */
|
||||
|
19
dnsmgr.c
19
dnsmgr.c
@@ -187,8 +187,16 @@ static int refresh_list(void *data)
|
||||
|
||||
ast_mutex_unlock(&refresh_lock);
|
||||
|
||||
/* automatically reschedule */
|
||||
return -1;
|
||||
/* automatically reschedule based on the interval */
|
||||
return refresh_interval * 1000;
|
||||
}
|
||||
|
||||
void dnsmgr_start_refresh(void)
|
||||
{
|
||||
if (refresh_sched > -1) {
|
||||
ast_sched_del(sched, refresh_sched);
|
||||
refresh_sched = ast_sched_add(sched, 100, refresh_list, &master_refresh_info);
|
||||
}
|
||||
}
|
||||
|
||||
static int do_reload(int loading);
|
||||
@@ -328,10 +336,8 @@ static int do_reload(int loading)
|
||||
ast_config_destroy(config);
|
||||
}
|
||||
|
||||
if (enabled && refresh_interval) {
|
||||
refresh_sched = ast_sched_add(sched, refresh_interval * 1000, refresh_list, &master_refresh_info);
|
||||
if (enabled && refresh_interval)
|
||||
ast_log(LOG_NOTICE, "Managed DNS entries will be refreshed every %d seconds.\n", refresh_interval);
|
||||
}
|
||||
|
||||
/* if this reload enabled the manager, create the background thread
|
||||
if it does not exist */
|
||||
@@ -340,10 +346,11 @@ static int do_reload(int loading)
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
if (ast_pthread_create(&refresh_thread, &attr, do_refresh, NULL) < 0) {
|
||||
ast_log(LOG_ERROR, "Unable to start refresh thread.\n");
|
||||
ast_sched_del(sched, refresh_sched);
|
||||
}
|
||||
else {
|
||||
ast_cli_register(&cli_refresh);
|
||||
/* make a background refresh happen right away */
|
||||
refresh_sched = ast_sched_add(sched, 100, refresh_list, &master_refresh_info);
|
||||
res = 0;
|
||||
}
|
||||
}
|
||||
|
@@ -42,27 +42,28 @@ extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH];
|
||||
extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH];
|
||||
|
||||
/* Provided by asterisk.c */
|
||||
extern int ast_set_priority(int);
|
||||
int ast_set_priority(int);
|
||||
/* Provided by module.c */
|
||||
extern int load_modules(const int preload_only);
|
||||
int load_modules(const int preload_only);
|
||||
/* Provided by pbx.c */
|
||||
extern int load_pbx(void);
|
||||
int load_pbx(void);
|
||||
/* Provided by logger.c */
|
||||
extern int init_logger(void);
|
||||
extern void close_logger(void);
|
||||
int init_logger(void);
|
||||
void close_logger(void);
|
||||
/* Provided by frame.c */
|
||||
extern int init_framer(void);
|
||||
int init_framer(void);
|
||||
/* Provided by logger.c */
|
||||
extern int reload_logger(int);
|
||||
int reload_logger(int);
|
||||
/* Provided by term.c */
|
||||
extern int term_init(void);
|
||||
int term_init(void);
|
||||
/* Provided by db.c */
|
||||
extern int astdb_init(void);
|
||||
int astdb_init(void);
|
||||
/* Provided by channel.c */
|
||||
extern void ast_channels_init(void);
|
||||
void ast_channels_init(void);
|
||||
/* Provided by dnsmgr.c */
|
||||
extern int dnsmgr_init(void);
|
||||
extern void dnsmgr_reload(void);
|
||||
int dnsmgr_init(void);
|
||||
void dnsmgr_start_refresh(void);
|
||||
void dnsmgr_reload(void);
|
||||
|
||||
/*!
|
||||
* \brief Register the version of a source code file with the core.
|
||||
|
Reference in New Issue
Block a user