acd_config.h
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* CC/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include "const_define.h"
#include "safe_set.h"
#include "safe_map.h"
class acd_config {
private:
// mysql configuration para
string m_dbhost;
uint32_t m_dbport;
string m_dbusername;
string m_dbpasswd;
string m_dbname;
bgcc::Mutex m_Locker;
public:
// log para
uint32_t m_log_count;
uint32_t m_log_filecount;
Level m_log_level;
// eventlog para
uint32_t m_eventlog_count;
uint32_t m_eventlog_filecount;
Level m_eventlog_level;
// calllog para
uint32_t m_calllog_count;
uint32_t m_calllog_filecount;
Level m_calllog_level;
uint32_t m_calllog_timeout;
// acd manager
uint32_t m_sendevent_threadcount;
uint32_t m_agent_timeout;
string m_default_anishow;
string m_default_destshow;
string m_password;
uint32_t m_request_timespan;
uint32_t m_queue_timespan;
uint32_t m_skill_count;
// acd heartbeat
string m_other_acdhost;
uint32_t m_other_acdport;
uint32_t m_this_acdport;
uint32_t m_acdheartbeat_timesmax;
uint32_t m_acdheartbeat_timespan;
// ims configuration para
string m_main_server_ip;
uint32_t m_main_server_port;
string m_back_server_ip;
uint32_t m_back_server_port;
uint32_t m_imsheartbeat_timesmax;
uint32_t m_imsheartbeat_timespan;
uint32_t m_ims_proxy_num;
// agent server
uint32_t m_this_agentport;
uint32_t m_thread_num;
// agent info
SafeSet<string> m_setSkills;
SafeSet<string> m_setRestReason;
SafeMap<string, string> m_mapAgent;
private:
static void copy_unit(const string& unit, acd::StringListT& lst);
void Clear();
bool LoadConf(); // 读取配置文件
bool LoadSkills(); // 读取技能
bool LoadRestReason(); // 读取休息原因
bool LoadAgent(); // 读取坐席信息
bool ValidateSkill(const string& skill);
public:
acd_config(void);
~acd_config(void);
bool read_config();
bool reset_config();
acd::AcdResultT validate_agent(const string& agentId, const string& skill);
acd::AcdResultT validate_agent(const string& agentId, const string& agentPwd, const string& skill);
void GetSkill(acd::StringListT& skill);
void GetRestReason(acd::StringListT& restReason);
};