acd_tool.h
3.4 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
/*
* 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 "acd_config.h"
#include "logger.h"
#include "acd_log_timer.h"
#include "acd_receive_event_manager.h"
#include "acd_send_event_manager.h"
#include "acd_agent_manager.h"
#include "acd_skill_manager.h"
#include "acd_backup.h"
#include "acd_ims.h"
#include "acd_server.h"
#include "acd_data_collection.h"
using acd::AcdCallDataCollection;
class IDCreater {
private:
int64_t m_ID;
bgcc::Mutex mLocker;
public:
IDCreater();
~IDCreater();
int64_t GetID();
};
class acd_tool {
private:
static acd_config m_config;
static IDCreater m_handle;
static IDCreater m_eventId;
static IDCreater m_skillId;
public:
static Logger m_logger;
private:
static Logger m_eventlogger;
public:
static Logger m_calllogger;
static acd_log_timer m_calllog_timer;
static acd_receive_event_manager m_receive_event_manager;
static acd_send_event_manager m_send_event_manager;
static acd_agent_manager m_agent_manager;
static acd_skill_manager m_skill_manager;
static acd_backup* p_m_acd_backup;
static acd_ims* p_m_acd_ims;
static acd_main_server m_main_server;
static AcdCallDataCollection _acd_calldata;
private:
static void init_log();
static void un_init_log();
static void init_manager();
static void un_init_manager();
static void init_connect();
static void un_init_connect();
static void init_collection();
static void un_init_collection();
public:
static void init();
static void un_init();
static acd::AcdResultT validate_agent(const string& agentId, const string& skill);
static acd::AcdResultT validate_agent(const string& agentId, const string& agentPwd,
const string& skill);
static void GetSkill(acd::StringListT& skill);
static void GetRestReason(acd::StringListT& restReason);
static int64_t CreatHandle();
static int64_t CreatEventId();
static int64_t CreatSkillId();
static uint32_t LocalPort();
static bool ResetConfig();
static void write_ims_event_log(const ims::CallEventT& event);
static void write_ims_event_log(const ims::MediaEventT& event);
static void write_ims_event_log(const ims::RouteEventT& event);
static void write_ims_event_log(const ims::OtherEventT& event);
static void write_acd_event_log(const SendEventT& event);
static acd::CallEventTypeT TranslateCallEvent(const ims::CallEventTypeT& type);
static acd::PartyAttributeT TranslatePartyAtt(const ims::PartyAttributeT& type);
static acd::CallEventReasonT TranslateCallReason(const ims::CallEventReasonT& type);
static acd::MediaEventTypeT TranslateMediaEvent(const ims::MediaEventTypeT& type);
static acd::MediaStateT TranslateMediaState(const ims::MediaStateT& type);
static acd::MediaEventReasonT TranslateMediaReason(const ims::MediaEventReasonT& type);
};