Abort module load if config can't be opened. Refs FS-4438
This commit is contained in:
parent
42f296de9b
commit
52bf168b56
|
@ -1,6 +1,6 @@
|
||||||
<configuration name="cdr_mongodb.conf" description="MongoDB CDR logger">
|
<configuration name="cdr_mongodb.conf" description="MongoDB CDR logger">
|
||||||
<settings>
|
<settings>
|
||||||
<!-- Hostnames and IPv6 addrs not supported (yet) -->
|
<!-- IPv6 addresses not supported (yet) -->
|
||||||
<param name="host" value="127.0.0.1"/>
|
<param name="host" value="127.0.0.1"/>
|
||||||
<param name="port" value="27017"/>
|
<param name="port" value="27017"/>
|
||||||
|
|
||||||
|
|
|
@ -360,7 +360,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_cdr_mongodb_load)
|
||||||
memset(&globals, 0, sizeof(globals));
|
memset(&globals, 0, sizeof(globals));
|
||||||
globals.pool = pool;
|
globals.pool = pool;
|
||||||
if (load_config(pool) != SWITCH_STATUS_SUCCESS) {
|
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);
|
db_status = mongo_connect(globals.mongo_conn, globals.mongo_host, globals.mongo_port);
|
||||||
|
|
Loading…
Reference in New Issue