TCCC Agent API
ITCCCCallback.h
1//
2// 腾讯云呼叫中心的事件回调接口
3// tccc-workstation-sdk
4//
5// Created by gavinwjwang on 2022/7/19.
6//
7
8#ifndef TCCCCallback_h
9#define TCCCCallback_h
10#include "TCCCCode.h"
11#include "TCCCTypeDef.h"
15
16namespace tccc {
17
19 public:
20 virtual ~ITCCCCallback(){};
21
23 //
24 // 错误和警告事件
25 //
29
38 virtual void onError(TCCCError errCode, const char* errMsg, void* extraInfo) = 0;
48 virtual void onWarning(TCCCCWarning warningCode, const char* warningMsg, void* extraInfo) = 0;
49
52 //
53 // 呼叫呼入相关事件回调
54 //
58
64 virtual void onNewSession(TCCCSessionInfo info) = 0;
65
85 Rejected, // Only as UAS, UAC has distinct onFailure callback
89 };
90
100 virtual void onEnded(EndedReason reason, const char* reasonMessage, const char* sessionId) = 0;
101
107 virtual void onAccepted(const char* sessionId) = 0;
108
115 virtual void onAudioVolume(TCCCVolumeInfo* volumeInfo){};
116
119 //
120 // 网络和技术指标统计回调
121 //
125
140 virtual void onNetworkQuality(TCCCQualityInfo localQuality, TCCCQualityInfo* remoteQuality,
141 uint32_t remoteQualityCount){};
142
156 virtual void onStatistics(const TCCCStatistics& statistics) {}
157
166 };
167
181 virtual void onConnectionLost(TCCCServerType serverType){};
182
190 virtual void onTryToReconnect(TCCCServerType serverType){};
191
199 virtual void onConnectionRecovery(TCCCServerType serverType){};
200
201 // /**
202 // * 4.2 网速测试的结果回调
203 // *
204 // * 该统计回调由 {@link startSpeedTest:} 触发。
205 // *
206 // * @param result 网速测试数据数据,包括丢包、往返延迟、上下行的带宽速率,详情请参考 {@link TCCCSpeedTestResult}。
207 // */
208 // // virtual void onSpeedTestResult(const TCCCSpeedTestResult& result) = 0;
209
211
215 virtual void onRemoteUserJoin(const char* rtcUserId){};
219 virtual void onRemoteUserLeave(const char* rtcUserId, int reason){};
220};
221
226 public:
227 virtual ~ITXCallback(){};
231 virtual void OnSuccess() = 0;
238 virtual void OnError(TCCCError error_code, const char* error_message) = 0;
239};
240
244template <class T>
246 public:
247 virtual ~ITXValueCallback(){};
251 virtual void OnSuccess(const T& value) = 0;
258 virtual void OnError(TCCCError error_code, const char* error_message) = 0;
259};
260
261} // namespace tccc
262
264
265#endif /* TCCCCallback_h */
Definition: ITCCCCallback.h:18
virtual void onRemoteUserJoin(const char *rtcUserId)
Definition: ITCCCCallback.h:215
virtual void onStatistics(const TCCCStatistics &statistics)
Definition: ITCCCCallback.h:156
EndedReason
Definition: ITCCCCallback.h:69
@ Replaced
ended due to being replaced
Definition: ITCCCCallback.h:75
@ Rejected
对端拒绝
Definition: ITCCCCallback.h:85
@ LocalCancel
主叫取消拨打
Definition: ITCCCCallback.h:81
@ Error
系统错误
Definition: ITCCCCallback.h:71
@ Timeout
超时
Definition: ITCCCCallback.h:73
@ LocalBye
主叫挂断
Definition: ITCCCCallback.h:77
@ RemoteCancel
对端取消拨打
Definition: ITCCCCallback.h:83
@ Referred
被转接而结束
Definition: ITCCCCallback.h:87
@ RemoteBye
对端挂断
Definition: ITCCCCallback.h:79
virtual void onNewSession(TCCCSessionInfo info)=0
virtual void onWarning(TCCCCWarning warningCode, const char *warningMsg, void *extraInfo)=0
TCCCServerType
Definition: ITCCCCallback.h:161
@ TCCCServer
TCCC的服务
Definition: ITCCCCallback.h:163
@ TRTCServer
实时通话的RTC服务
Definition: ITCCCCallback.h:165
virtual void onNetworkQuality(TCCCQualityInfo localQuality, TCCCQualityInfo *remoteQuality, uint32_t remoteQualityCount)
Definition: ITCCCCallback.h:140
virtual void onEnded(EndedReason reason, const char *reasonMessage, const char *sessionId)=0
virtual void onConnectionRecovery(TCCCServerType serverType)
Definition: ITCCCCallback.h:199
virtual void onError(TCCCError errCode, const char *errMsg, void *extraInfo)=0
virtual void onTryToReconnect(TCCCServerType serverType)
Definition: ITCCCCallback.h:190
virtual void onAccepted(const char *sessionId)=0
virtual void onRemoteUserLeave(const char *rtcUserId, int reason)
Definition: ITCCCCallback.h:219
virtual void onConnectionLost(TCCCServerType serverType)
Definition: ITCCCCallback.h:181
virtual void onAudioVolume(TCCCVolumeInfo *volumeInfo)
Definition: ITCCCCallback.h:115
Definition: ITCCCCallback.h:225
virtual void OnSuccess()=0
virtual void OnError(TCCCError error_code, const char *error_message)=0
Definition: ITCCCCallback.h:245
virtual void OnError(TCCCError error_code, const char *error_message)=0
virtual void OnSuccess(const T &value)=0
Definition: TCCCTypeDef.h:254
Definition: TCCCTypeDef.h:135
Definition: TCCCTypeDef.h:566
Definition: TCCCTypeDef.h:336