ConstDef.h
5.53 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/*
* 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 "acdcommon.h"
// Post消息类型,AcdClient和CCBar中使用
#define WM_AGENTEVENT WM_USER + 1001
#define WM_MEDIAEVENT WM_USER + 1002
#define WM_QUEUEEVENT WM_USER + 1003
#define WM_OTHEREVENT WM_USER + 1004
// 将void *转换成长整型,AcdClient和CCBar中使用
#define MAKELONGLONG(a, b) ((__int64)(((unsigned __int64)(a) & 0xffffffff) | ((unsigned __int64)(b) & 0xffffffff) << 32))
#define LOLONG(a) ((__int32)((unsigned __int64)(a) & 0xffffffff))
#define HILONG(a) ((__int32)((unsigned __int64)(a) >> 32))
//日志组件、info对话框使用
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#define access _access
// 控件的参数,CCBar中使用
const int BAR_WIDTH = 1440; //控件宽度,1440*900显示器的最大宽度
const int BAR_HEIGHT = 84; //控件高度
const int TOP_HEIGHT = 70; //按钮高度
const int BAR_TOP_POSITION = 10; //按钮离控件高度
// 定时器类型,CCBar中使用
const int TIMER_STATUS = 1; //状态定时器
const int TIMER_TALK = 2; //通话定时器
const int TIMESPAN_STATUS = 300; //状态定时器间隔时间
const int TIMESPAN_TALK = 300; //通话定时器间隔时间
const int TIMESPAN_HEARTBEAT = 10000; //心跳定时器间隔时间
const int TIMES_HEARTBEAT_EXCEPTION = 3; //心跳异常次数
// ACD回调线程数
//const int ACD_PROXY_NUM = 1;
// 日志等中广泛使用
const unsigned long LONG_STRING_LENGHT = 128;
const unsigned long TEXT_LENGHT = 1024;
typedef char LongString[LONG_STRING_LENGHT];
typedef char Text[TEXT_LENGHT];
typedef bgcc::Guard<bgcc::Mutex> SingleLocker;
// 事件原因,区分不同原因导致的事件
enum EVENTREASON
{
EVENTREASON_SUCCESS,
EVENTREASON_IMS_DISCONNECT = 1000,
EVENTREASON_IMS_MASTERCHANGE,
EVENTREASON_IMS_OPERATIONFAILED,
EVENTREASON_ACD_DISCONNECT,
EVENTREASON_ACD_MASTERCHANGE,
EVENTREASON_ACD_OPERATIONFAILED,
EVENTREASON_ACD_RELOGINSUCCESS,
EVENTREASON_ACD_RELOGINFAILED
};
// 错误类型,AcdClient和CCBar中使用
enum AGENTBARERROR
{
AGENTBARERROR_SUCCESS,
AGENTBARERROR_BGCC_CLIENTPROXYFAIL = 1000,
AGENTBARERROR_BGCC_EXCEPTION,
AGENTBARERROR_BAR_INITIAL,
AGENTBARERROR_BAR_UNINITIAL,
AGENTBARERROR_BAR_UNSIGNIN,
AGENTBARERROR_BAR_WRONGSTATE,
AGENTBARERROR_BAR_OUTEVENTERROR,
AGENTBARERROR_BAR_ANSWERERROR,
AGENTBARERROR_JSON_READERROR,
AGENTBARERROR_SOFTPHONE_ERROR, //suxiangmao
AGENTBARERROR_BAR_WRONGNUM //liuqiang
};
// 主叫变换类型
enum ANICHANGE
{
ANICHANGE_SYSTEM,
ANICHANGE_TRANSFER,
ANICHANGE_SPECIAL
};
// 日志级别
enum Level
{
Level_Low,
Level_Middle,
Level_High,
Level_Super
};
// 按钮状态,CCBar中使用
struct ButtonStatus
{
private:
static const LONGLONG LOGIN = 1;
static const LONGLONG LOGOUT = 1<<1;
static const LONGLONG ANSWER = 1 << 2;
static const LONGLONG CALLOUT = 1 << 3;
static const LONGLONG SENDDTMF = 1 << 4;
static const LONGLONG HANGUP = 1 << 5;
static const LONGLONG HOLD = 1 << 6;
static const LONGLONG RETRIEVE = 1 << 7;
static const LONGLONG CONSULT = 1 << 8;
static const LONGLONG RECONNECT = 1 << 9;
static const LONGLONG TRANSFER = 1 << 10;
static const LONGLONG CONFERENCE = 1 << 11;
static const LONGLONG SSTRANSFER = 1 << 12;
static const LONGLONG REST = 1 << 13;
static const LONGLONG READY = 1 << 14;
static const LONGLONG BUSY = 1 << 15;
static const LONGLONG SKILL = 1 << 16;
public:
bool btnLogin;
bool btnLogout;
bool btnAnswer;
bool btnCallout;
bool btnSenddtmf;
bool btnHangup;
bool btnHold;
bool btnRetrieve;
bool btnConsult;
bool btnReconnect;
bool btnTransfer;
bool btnConference; //没有SKILLCHANGE,有CONFERENCE
bool btnSSTransfer;
bool btnRest;
bool btnReady;
bool btnBusy;
bool btnSkill;
public:
ButtonStatus()
{
Reset();
}
void Reset()
{
btnLogin = false;
btnLogout = false;
btnAnswer = false;
btnCallout = false;
btnSenddtmf = false;
btnHangup = false;
btnHold = false;
btnRetrieve = false;
btnConsult = false;
btnReconnect = false;
btnTransfer = false;
btnConference = false; //没有SKILLCHANGE,有CONFERENCE
btnSSTransfer = false;
btnRest = false;
btnReady = false;
btnBusy = false;
btnSkill = false;
}
LONGLONG StatusAsLonglong()
{
LONGLONG res = 0;
if(btnLogin)
res |= LOGIN;
if(btnLogout)
res |= LOGOUT;
if(btnAnswer)
res |= ANSWER;
if(btnCallout)
res |= CALLOUT;
if(btnSenddtmf)
res |= SENDDTMF;
if(btnHangup)
res |= HANGUP;
if(btnHold)
res |= HOLD;
if(btnRetrieve)
res |= RETRIEVE;
if(btnConsult)
res |= CONSULT;
if(btnReconnect)
res |= RECONNECT;
if(btnTransfer)
res |= TRANSFER;
if(btnConference)
res |= CONFERENCE;
if(btnSSTransfer)
res |= SSTRANSFER;
if(btnRest)
res |= REST;
if(btnReady)
res |= READY;
if(btnBusy)
res |= BUSY;
if(btnSkill)
res |= SKILL;
return res;
}
};