ApCommon.h
2.85 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
106
107
108
109
110
111
112
113
114
115
116
117
/*
* 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.
*/
#ifndef APCOMMON_H
#define APCOMMON_H
#ifdef _WIN32
#include <hash_set>
#include <hash_map>
using namespace stdext;
#else
#include <ext/hash_map>
#endif
#include <bgcc.h>
#include <acd.h>
#ifdef _WIN32
const char APCONFIG[] = "conf\\Ap.cfg";
const char APLOGCONFIG[] = "conf\\Aplog.cfg";
#else
const char APCONFIG[] = "conf/Ap.cfg";
const char APLOGCONFIG[] = "conf/Aplog.cfg";
using namespace __gnu_cxx; //for hash_map
namespace __gnu_cxx {
template<> struct hash< std::string > {
size_t operator()(const std::string& x) const {
return hash< const char* >()(x.c_str());
}
};
}
#endif
#ifdef _WIN32
#define int64ld "I64d"
#define uint64ld "U64d"
#else
#define int64ld "ld"
#define uint64ld "lu"
#endif
#include "Queue.h"
using namespace acd;
#define CALLBACKTHREADNUM 4
#define CHECKHBTHREADNUM 2
/**
* @brief AP与ACD的连接状态
* @see
* @note
* @date 2012年06月28日 12时59分21秒
*/
enum APCONNACDSTATE {
AP_CONNACD_MASTER,
AP_CONNACD_SLAVE,
AP_CONNACD_BACKING,
AP_CONNACD_UNKNOW,
};
/**
* @brief AP保存的agentbar信息,用于回调事件推送
* @see
* @note
* @date 2012年06月28日 13时03分12秒
*/
struct AgentData {
std::string agentId; /*坐席工号,并唯一标示一个agentbar连接*/
std::string agentDn; /*座席使用的电话号码*/
std::string agentPwd; /*座席签入的密码*/
StatusChangeT statusChangetype; /*挂断后状态(自动示闲、自动示忙)*/
bool autoAnswer; /*挂断后,从示闲或示忙状态到后处理的时间间隔,默认5秒*/
bool fcSignin; /*坐席已签入,是否强制签出后迁入 */
std::string skill; /*技能和技能级别描述*/
int64_t handle;
int32_t flag; /*表示坐席是否signout*/
int64_t timestamp; /*标示至flag的时间*/
std::string agentIP;
std::string proxyname;
std::string proxyname_old;
};
typedef hash_map<std::string, AgentData*> MapAgentIdDataType; /*坐席工号、连接代理数据*/
/**
* @brief 事件队列结构体,用于发送回调事件
* @see
* @note
* @date 2012年06月28日 14时05分06秒
*/
struct ApEventQ {
Queue<AgentEventT > _qEventCall;
Queue<MediaEventT> _qEventMedia;
Queue<RouteEventT> _qEventRoute;
Queue<OtherEventT > _qEventOther;
};
typedef struct ApEventQ ApEventQT;
#endif // APCOMMON_H