Abort module load if config can't be opened. Refs FS-4438

This commit is contained in:
Daniel Swarbrick 2012-07-20 02:38:12 +02:00
parent 42f296de9b
commit 52bf168b56
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<configuration name="cdr_mongodb.conf" description="MongoDB CDR logger">
<settings>
<!-- Hostnames and IPv6 addrs not supported (yet) -->
<!-- IPv6 addresses not supported (yet) -->
<param name="host" value="127.0.0.1"/>
<param name="port" value="27017"/>

View File

@ -360,7 +360,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_mongodb_load)
memset(&globals, 0, sizeof(globals));
globals.pool = pool;
if (load_config(pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Unable to load or parse config!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to load or parse config!\n");
return SWITCH_STATUS_FALSE;
}
db_status = mongo_connect(globals.mongo_conn, globals.mongo_host, globals.mongo_port);