CCBar.h
6.14 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
/*
* 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 "ButtonEx.h"
#include "StaticEx.h"
#include "CallOut.h"
#include "AcdClient.h"
#include "SipphoneClient.h"
class CCCAgentBarCtrl;
class CCCBar : public CDialog
{
DECLARE_DYNAMIC(CCCBar)
public:
CCCBar(CWnd* pParent = NULL); // 标准构造函数
virtual ~CCCBar();
// 对话框数据
enum { IDD = IDD_DIALOG_CCBAR };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
// 自定义变量
private:
CCCAgentBarCtrl *p_m_BarCtrl;
AcdClient m_acd;
SipphoneClient m_sip;
CRect m_RectTop;
CRect m_RectBottom;
CBrush m_BrushTop;
CBrush m_BrushBottom;
acd::AgentStatusT m_AgentStatus;
ButtonStatus m_lastBtnStatus;
ButtonStatus m_btnStatus;
CTime m_beginStatusTime;
CTime m_lastStatusTime; // 处理坐席自己改时间
CTime m_beginTalkTime;
CTime m_lastTalkTime; // 处理坐席自己改时间
CTimeSpan m_totalTime; // 本次signin之后的开始通话时长
CCallOut m_dlgCallOut;
int m_heartbeatCount;
string m_strActiveCallID; //当前活动呼叫的callid
LONGLONG m_lDetaTime;
bgcc::SharedPointer<bgcc::Thread> m_thrd_heartbeat; //心跳线程
// 私有函数
private:
void SetButton();
// 事件补充器
void PostMessageEx(const acd::AgentStatusT &agentStatus, const acd::CallEventReasonT &reason);
void PostMessageEx(const acd::OtherEventTypeT &otherEventType);
void Backup();
void ReSignIn();
// 控件
private:
CButtonEx m_btnSignInOut;
CButtonEx m_btnAnswer;
CButtonEx m_btnCallOut;
CButtonEx m_btnHangup;
CButtonEx m_btnHold;
CButtonEx m_btnConsult;
CButtonEx m_btnTransfer;
CButtonEx m_btnConference;
CButtonEx m_btnSingleStepTransfer;
CButtonEx m_btnRest;
CButtonEx m_btnReady;
CButtonEx m_btnBusy;
CButtonEx m_btnSkillChange;
CButtonEx m_btnFengeOne;
CButtonEx m_btnFengeTwo;
CButtonEx m_btnFengeThree;
CButtonEx m_btnFengeFour;
CStaticEx m_stcAgentState;
CStaticEx m_stcStateTime;
CStaticEx m_stcTalk;
CStaticEx m_stcTalkTime;
CStaticEx m_stcTotalTalk;
CStaticEx m_stcTotalTalkTime;
CComboBox m_cmbRest;
CComboBox m_cmbSkill;
// 函数重载和消息响应
protected:
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDestroy();
afx_msg void OnBnClickedButtonSigninout();
afx_msg void OnBnClickedButtonAnswer();
afx_msg void OnBnClickedButtonCallout();
afx_msg void OnBnClickedButtonHungup();
afx_msg void OnBnClickedButtonHold();
afx_msg void OnBnClickedButtonConsult();
afx_msg void OnBnClickedButtonTransfer();
afx_msg void OnBnClickedButtonConference();
afx_msg void OnBnClickedButtonSinglesteptransfer();
afx_msg void OnBnClickedButtonRest();
afx_msg void OnBnClickedButtonReady();
afx_msg void OnBnClickedButtonBusy();
afx_msg void OnBnClickedButtonSkillchange();
afx_msg LRESULT OnAgentEvent(WPARAM wParam, LPARAM lParam); // 主线程事件
afx_msg LRESULT OnMediaEvent(WPARAM wParam, LPARAM lParam); // 主线程事件
afx_msg LRESULT OnRouteEvent(WPARAM wParam, LPARAM lParam); // 主线程事件
afx_msg LRESULT OnOtherEvent(WPARAM wParam, LPARAM lParam); // 主线程事件
// 公共变量
public:
CString m_strAgentID;
CString m_strPassWord;
CString m_strDN;
acd::StatusChangeT m_intStatusChangeType;
BOOL m_intAutoAnswer;
BOOL m_intForceSignIn;
CString m_strServiceList;
CString m_strMainCTIIP;
CString m_strBackCTIIP;
LONG m_intCTIPort;
LONG m_intTimeOut;
BOOL m_intIsInitial;
BOOL m_intIsSignIn;
BOOL m_intIsSIPPhone;
CString m_strSIPServerIP;
LONG m_intSIPServerPort;
CString m_strPhoneNum;
CString m_strPhonePwd;
CString m_strAgentTag;
CString m_strCustomerTag;
ANICHANGE m_intANIChangeType;
BOOL m_intIsShowCallOut;
BOOL m_intIsCallOut;
Level m_intLogLevel;
BOOL m_intEnableSeniorCall;
CString m_callingNo;
CString m_orgCallingNo;
CString m_calledNo;
CString m_orgCalledNo;
// 公共函数
public:
// 回调函数
LONG BInitial();
LONG BUnInitial();
LONG BSignIn();
LONG BSignOut();
LONG BSetIdle();
LONG BSetBusy();
LONG BSetRest(const char *reason);
LONG BGetAgentStatus(acd::AgentStatusT &agentStatus);
// BSetAgentStatus和BGetAgentStatus此处不实现
LONG BResetSkill(const char *skillList);
LONG BReset();
LONG BMakeCall(const char *dest, const char *showANI, const char *showDest, acd::CallModeT callMode, acd::CallTypeT callType);
LONG BAnswer();
LONG BReleaseCall();
LONG BHold();
LONG BRetrieve();
LONG BConsult(const char *consultNum, const char *showANI, const char *showDest, acd::CallTypeT callType);
LONG BReconnect();
LONG BTransfer();
LONG BSingleStepTransfer(const char *transferNum, const char *showANI, const char *showDest, BOOL transferStyle, acd::CallTypeT callType);
LONG BTransferIVR(const char *transferNum, const char *callerNum=NULL); //chenyz add 20130220
LONG BConference();
// BSetAssociateData和BGetAssociateData此处不实现
LONG BListen(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum);
LONG BStopListen(const char *destAgentId);
LONG BInsert(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum);
LONG BStopInsert(const char *destAgentId);
LONG BSwitchInsertorListen(const char *destAgentId, const char *forCallerDispNum, const char *forCalleeDispNum);
LONG BSendDTMF(const char *digitals);
LONG BGetRestReason(acd::StringListT &restReason);
LONG BSynchronizeCTITime();
LONG BHeartbeat();
AcdClient &GetAcdClient();
SipphoneClient &GetSipphoneClient(); // suxiangmao
// 其他函数此处不实现
};
class HeartBeatTask : public bgcc::Runnable{
private:
CCCBar *m_bar;
public:
HeartBeatTask(CCCBar *_bar):m_bar(_bar){}
int32_t operator()(const bool *isstopped, void *param=NULL); //心跳线程实现
};