/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
- * Copyright (C) 2005-2016, Anthony Minessale II <anthm@freeswitch.org>
+ * Copyright (C) 2005-2021, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
int debug;
char *odbc_dsn;
char *dbname;
- char *cc_instance_id;
+ const char *cc_instance_id;
switch_bool_t reserve_agents;
switch_bool_t truncate_tiers;
switch_bool_t truncate_agents;
return 0;
}
-static switch_status_t load_config(void)
+static switch_status_t load_config(switch_memory_pool_t *pool)
{
switch_status_t status = SWITCH_STATUS_SUCCESS;
switch_xml_t cfg, xml, settings, param, x_queues, x_queue, x_agents, x_agent, x_tiers;
} else if (!strcasecmp(var, "global-database-lock")) {
globals.global_database_lock = switch_true(val);
} else if (!strcasecmp(var, "cc-instance-id")) {
- globals.cc_instance_id = strdup(val);
+ globals.cc_instance_id = switch_core_strdup(pool, val);
} else if (!strcasecmp(var, "agent-originate-timeout")) {
globals.agent_originate_timeout = atoi(val);
}
globals.dbname = strdup(CC_SQLITE_DB_NAME);
}
if (zstr(globals.cc_instance_id)) {
- globals.cc_instance_id = strdup("single_box");
+ globals.cc_instance_id = switch_core_strdup(pool, "single_box");
}
if (!globals.reserve_agents) {
globals.reserve_agents = SWITCH_FALSE;
switch_core_hash_init(&globals.queue_hash);
switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, globals.pool);
- if ((status = load_config()) != SWITCH_STATUS_SUCCESS) {
+ if ((status = load_config(pool)) != SWITCH_STATUS_SUCCESS) {
switch_event_unbind(&globals.node);
switch_event_free_subclass(CALLCENTER_EVENT);
switch_core_hash_destroy(&globals.queue_hash);
switch_safe_free(globals.odbc_dsn);
switch_safe_free(globals.dbname);
- switch_safe_free(globals.cc_instance_id);
switch_mutex_unlock(globals.mutex);
return SWITCH_STATUS_SUCCESS;