diff options
author | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-31 21:00:20 +0000 |
---|---|---|
committer | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-31 21:00:20 +0000 |
commit | 73925ee14a02afb50f6c0aea3cc4e54f99493440 (patch) | |
tree | 5eac7fd790352b502dbbc4fc21ae517fe7c388ad /apps/app_queue.c | |
parent | 43c75db33e757e08cdec37b1713a0e275d9a039b (diff) |
everything that loads a config that needs a config file to run
now reports AST_MODULE_LOAD_DECLINE when loading if config file
is not there, also fixed an error in res_config_pgsql where it
had a non static function when it should.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41633 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index 448e8ca74..878c67a4a 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3642,7 +3642,7 @@ static struct ast_custom_function queuememberlist_function = { .read = queue_function_queuememberlist, }; -static void reload_queues(void) +static int reload_queues(void) { struct call_queue *q; struct ast_config *cfg; @@ -3656,7 +3656,7 @@ static void reload_queues(void) if (!(cfg = ast_config_load("queues.conf"))) { ast_log(LOG_NOTICE, "No call queueing config file (queues.conf), so no call queues\n"); - return; + return 0; } memset(interface, 0, sizeof(interface)); AST_LIST_LOCK(&queues); @@ -3794,6 +3794,7 @@ static void reload_queues(void) } AST_LIST_TRAVERSE_SAFE_END; AST_LIST_UNLOCK(&queues); + return 1; } static int __queues_show(struct mansession *s, int manager, int fd, int argc, char **argv, int queue_show) @@ -4359,7 +4360,10 @@ static int unload_module(void) static int load_module(void) { int res; - + if(!reload_queues()) + return AST_MODULE_LOAD_DECLINE; + if (queue_persistent_members) + reload_queue_members(); res = ast_register_application(app, queue_exec, synopsis, descrip); res |= ast_cli_register(&cli_show_queue); res |= ast_cli_register(&cli_show_queues); @@ -4381,12 +4385,6 @@ static int load_module(void) res |= ast_custom_function_register(&queuewaitingcount_function); res |= ast_devstate_add(statechange_queue, NULL); - if (!res) { - reload_queues(); - if (queue_persistent_members) - reload_queue_members(); - } - return res; } |