tencent cloud

Cloud Contact Center

Web

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-05-12 14:24:14
Note
TCCC becomes a global variable after the SDK is loaded, allowing direct access to its functionalities.

Data Structure

AgentStatus

Agent status.
Field
Description
free
Idle: Agent is online at their workstation but not currently engaged in a call.
busy
In Call: Agent is handling an inbound or outbound call and will not receive new call assignments during this time.
arrange
After-call-work
notReady
Busy: agent will not receive new inbound calls, but can make outbound calls.
rest
On Break: agents can select a break reason such as "Meal," "Meeting," or "Training" (reasons are configured by the admin in the Management Panel).

ServerType

Service Endpoint Type: Describes the type of agent device used during call sessions.
Field
Description
staffSeat
Web agent to make and answer calls through the web server.
staffPhoneSeat
Agent who make and answer calls through mobile device.
miniProgramSeat
Agent who make and answer calls through wechat mini-program.
staffExtensionSeat
Agent who make and answer calls through SIP phone device.

CommonSDKResponse

Parameter
Type
Required
Remarks
options
status
'success' |'error'
Yes
SDK API call result, returns success on success, error on failure
errorMsg
string
No
Error message returned when status is error

Call (API Function of Voice and Audio Agent)

Outbound call

tccc.Call.startOutboundCall(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
phoneNumber
String
Yes
Contact Number
phoneDesc
String
No
Number Remark will display in call bar instead of number
uui
String
No
User-defined data, which can be returned through call CDR data push data push after being input
skillGroupId
String
No
Skill group ID associated with outbound call number.
callerPhoneNumber
String
No
Number that uses to make outbound call.
servingNumberGroupIds
String[]
No
Specified Number ID List
phoneEncodeType
'number'
No
Currently only support 'number'. Actual number is mandatory when enabling number mapping.

tccc.Call.startOutboundCall(options): Promise<CallResponse>

CallResponse description as follows:
Parameter
Type
Required
Remarks
response
sessionId
String
Yes
Specify session ID
calleeLocation
String
No
Callee number location
calleePhoneNumber
String
Yes
Contact Number
callerPhoneNumber
String
Yes
Caller Number that is used to make the outbound call
serverType
String
Yes
Service Endpoint Type: Describes the type of agent device used during call sessions. Enum value: staffSeat, staffPhoneSeat, and staffExtensionSeat. For details, see Session Service Type.
remark
String
No
Callee number remarks

Answer Video Session

tccc.Call.accept(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID, obtain from tccc.events.callIn event

End Video Session

tccc.Call.hungUp(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Delete Call

tccc.Call.deleteCall(options)

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Mute.

tccc.Call.muteMic(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Unmute.

tccc.Call.unmuteMic(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Whether Mic is Muted

tccc.Call.isMicMuted(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Initiate Internal Call

tccc.Call.startInternalCall(): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
calleeUserId
String
Yes
Agent account (Callee Side)
useMobile
Boolean
No
Whether to call agent mobile or not

Transfer Video Session

tccc.Call.transfer(): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID
skillGroupId
String
No
Transfer to designated skill group
userId
String
No
Transfer to designated agent

Call on Hold

tccc.Call.hold(): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Call Monitoring

tccc.Call.monitor(options): Promise<CommonSDKResponse>

Start call monitoring with audio as the default option, allowing only one session at a time. If textOnly: true is enabled, you can monitor multiple text sessions simultaneously, but this requires real-time speech to text feature to be turned on.
Note: This API can only be called by users with an administrator or quality inspector role.
Parameter
Type
Required
Remarks
options
sessionId
String
Yes
The monitored conversation ID can be obtained from the Get PSTN Session List.
textOnly
Boolean
No
The default is false, which means audio monitoring is initiated. Set it to true to enable text monitoring instead.

Call Intercept

tccc.Call.intercept(options): Promise<CommonSDKResponse>

Admin can take over a in progress call during monitoring, replacing the current agent. When this happens, the original agent will automatically exit the call (Call Intercept can only be initiated during monitoring).
Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session has been taken over (intercepted) by Admin.


Cancel Call on Hold

tccc.Call.unHold(): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Send Phone Extension Number

tccc.Call.sendDigits(): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID
dtmfText
String
No
Extension number to send

Chat (Desk Agent API Functions)

Answer Video Session

tccc.Chat.accept(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

End Chat Session

tccc.Chat.end(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Transfer Video Session

tccc.Chat.transfer(): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID
skillGroupId
String
No
Transfer to designated skill group
userId
String
No
Transfer to designated agent

Video (Video Agent API Functions)

Answer Video Session

tccc.Video.accept(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

End Video Session

tccc.Video.end(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Mute.

tccc.Video.muteMic(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Unmute.

tccc.Video.unmuteMic(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Camera Turns Off

tccc.Video.muteVideo(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Camera Turns On

tccc.Video.unmuteVideo(options): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Transfer Video Session

tccc.Video.transfer(): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID
skillGroupId
String
No
Transfer to designated skill group
userId
String
No
Transfer to designated agent

Agent (Status Related API Function)

More agent status enum types, see Agent Status.

Swtich to Online Status

tccc.Agent.online(): void

Offline

tccc.Agent.offline(): void

Agent Status Setup

tccc.Agent.setStatus(optoins): Promise<CommonSDKResponse>

Parameter
Type
Required
Remarks
options
status
String
Yes
Agent status, value range:
free: Idle, available to start service
rest: Rest, temporarily unavailable
arrange: After-call-work
notReady: Busy
stopNotReady: Stop Busy
restReason
String
No
Break Reason

Get Agent Status

tccc.Agent.getStatus():AgentStatus

Devices (Device-Related API Functions)

Web Browser Availability Check

tccc.Devices.isBrowserSupported(): boolean

Note
Note: TCCC Web SDK supports Chrome 56 and Edge 80 or later.

Return Microphone List

tccc.Devices.getMicrophones(): Promise<MediaDeviceInfo []>

Return Speaker List

tccc.Devices.getSpeakers(): Promise<MediaDeviceInfo []>

UI (User Interface Related API Function)

Hide All SDK UIs

tccc.UI.hide(): void

Show All SDK UIs

tccc.UI.show(): void

Show Floating Button

tccc.UI.showfloatButton(): void

Hide Floating Button

tccc.UI.hidefloatButton(): void

Show Workstation

tccc.UI.showWorkbench(): void

Hide Workstation

tccc.UI.hideWorkbench(): void

Display Call Toolbar

tccc.UI.showNotificationBar(): void

Hide Call Toolbar

tccc.UI.hideNotificationBar(): void

Modify SDK Local Settings

You are able to turn off SDK ringtone and system notifications

tccc.UI.updateUserCustomSettings(settings): void

All parameters in settings are optional and support incremental updates.
Parameter
Type
Required
Remarks
settings
disableRingtone
Boolean
No
true means disable SDK's ringtones (e.g., inbound call and answer tones).
disableNotification
Boolean
No
true means disable SDK system notifications

Monitor Events

Monitor Events

tccc.on(event, callback)

Cancel Event Monitor

tccc.off(event, callback)

Complete SDK Initialization

tccc.events.ready

Trigger when SDK initialization is complete. At this point, you can securely invoke the API.
Callback Parameter
Type
Required
Remarks
options
tabUUID
String
Yes
A unique ID for the current page that changes after refresh, used for multi-tab SDK integration.

Inbound Session

tccc.events.callIn

Types of inbound sessions include:
phone: voice session (Phone)
im: chat session (Desk)
voip: audio session
video: video session
internal: internal session

Inbound Voice Call

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Conversation ID
type
'phone'
Yes
Type of voice session (e.g., Web, mobile, sip phone calls)
timeout
Number
Yes
Session connection timeout duration, (0 means no timeout is applied)
calleePhoneNumber
String
Yes
Contact Number
callerPhoneNumber
String
No
Caller Number
callerLocation
String
No
Caller number location
remark
String
No
Remarks
ivrPath
{key: String, label: String}[]
-
User IVR path: KEY represents the key pressed at each node, and LABEL represents the label for the key.
protectedCallee
String
No
When admin enables number masking to protect real numbers, the masked number will be shown in this field for the callee.
protectedCaller
String
No
When admin enables number masking to protect real numbers, the masked number will be shown in this field for the caller.
serverType
'staffSeat' | 'staffPhoneSeat' | 'staffExtensionSeat'
Yes
Indicates the device used by the agent to answer incoming calls: 1) staffSeat (default): Web agent. 2) StaffPhoneSeat: Agent's mobile phone. 3) MiniProgramSeat: Mini Program agent. 4) staffExtensionSeat: Agent's linked desk phone.

Inbound Chat Session

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Conversation ID
type
'phone'
Yes
Type of voice session (e.g., Web, mobile, sip phone calls)
timeout
Number
Yes
Session connection timeout duration, (0 means no timeout is applied)
nickname
String
Yes
Nickname.
avatar
String
No
User's profile photo
remark
String
No
Remarks
peerSource
String
No
Channel Source
channelName
String
No
custom parameter
clientData
String
No
user-defined parameter

Inbound Audio Session (VoIP Call)

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Conversation ID
type
'voip'
Yes
Audio session type
timeout
Number
Yes
Session connection timeout duration, (0 means no timeout is applied)
callee
String
Yes
Channel
calleeRemark
String
No
Channel remarks
userId
String
Yes
user's openId
nickname
String
No
WeChat nickname can be obtained with user authorization
avatar
String
No
WeChat avatar can be obtained with user authorization
remark
String
No
Remarks
peerSource
String
No
Caller number location
ivrPath
{key: String, label: String}[]
No
User IVR path: KEY represents the key pressed at each node, and LABEL represents the label for the key.
clientData
String
No
user-defined parameter

Inbound Video Session

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Conversation ID
type
'video'
Yes
Video session type
timeout
String
Yes
Session connection timeout duration, (0 means no timeout is applied)
userId
String
Yes
user's openId
nickname
String
No
WeChat nickname can be obtained with user authorization
avatar
String
No
WeChat avatar can be obtained with user authorization
remark
String
No
Remarks

Inbound Internal Session

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Conversation ID
type
'internal'
Yes
internal session type
timeout
Number
Yes
Session connection timeout duration, (0 means no timeout is applied)
peerUserId
String
Yes
Caller agent account

Agent Session Handling

tccc.events.userAccessed

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID
tabUUID
String
No
Present in multi-tab integration, it indicates which tab the agent used to answer.

Session Transfer Timeout Event

tccc.events.autoTransfer

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Session End Event

tccc.events.sessionEnded

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID
closeBy
String
Yes
Hang Up Party:
Client: client hang up
seat: agent hang up
admin: system hang up
timer: timer hang up
mainReason
String
No
This is only applied in voice call, present when the disconnector is "admin," indicating the reason for the hung up.
subReason
String
No
This is only applied in voice call, present when the disconnector is "admin," indicating the detailed reason for the hung up.

Outbound Call Succeeded Event

tccc.events.callOuted

Callback Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID
callerPhoneNumber
String
Yes
Caller number used for making an outbound call
calleePhoneNumber
String
Yes
Contact Number
serverType
'staffSeat' | 'staffPhoneSeat' | 'staffExtensionSeat' |
'MiniProgramSeat'
Yes
Indicates agent uses what device to make outbound calls:
`staffSeat` - default value, indicating agent is using web browser to make calls.
StaffPhoneSeat indicates mobile outbound call
MiniProgramSeat indicates mini program outbound call
staffExtensionSeat indicates telephone outbound call
tabUUID
String
No
Once multi-tab integration turned on, it indicates which tab the agent used to answer.

Outbound Call Answered Event

tccc.events.calloutAccepted

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Session Transfer Event

tccc.events.transfer

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Specify session ID

Agent Status Change Event

tccc.events.statusChanged

Parameter
Type
Required
Remarks

options
status
No
For more information, see Agent Status.


Agent Being Kicked Out Event

tccc.events.kickedOut

Multi-end login triggers when an agent logs in from multiple devices.

Speech Recognition Event

tccc.events.asr

Parameter
Type
Required
Remarks

options
sessionId
String
Yes
Specify session ID

result
ASR recognition result
Yes
Automatic speech recognition results. For more structure info, see ASR Document.

flow
'IN' | 'OUT'
Yes
Recognition direction
user-side
agent side


Multi-Tab Integrated SDK

By default, TCCC Web SDK only allows to login device. Multiple logins will trigger the kickedOut event. After enabling the multi-Tab feature, calls initiated from any page will be displayed on other pages. Developers can hide the UI according to business logic or monitor to corresponding events for handling.

Restriction

1. One browser mutli-window, no incognito mode.
2. SDK integration in the business system is in the same domain name.
3. Mobile browsers are not supported.

Integration Guidance

1. Initialize SDK. See Web.
2. Add the enableShared parameter to enable the multi-Tab feature.
function injectTcccWebSDK(SdkURL) {
if (window.tccc) {
console.warn('SDK already initialized, confirm whether to repeat initialization');
return;
}
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.setAttribute('crossorigin', 'anonymous');
script.src = SdkURL;
/*
Add enableShared to enable the multi-Tab feature.
*/
script.dataset.enableShared = 'true'
document.body.appendChild(script);
script.addEventListener('load', () => {
window.tccc.on(window.tccc.events.ready, ({ tabUUID }) => {
resolve('initialization successful, current tabUUID is ' + tabUUID)
});
window.tccc.on(window.tccc.events.tokenExpired, ({message}) => {
console.error('initialization failed', message)
reject(message)
})
})
})
}
3. Rational of multi-tab handling.
When the callOuted (outbound call succeeded) and userAccessed (agent answered successfully) events are triggered, the tabUUID field will be added to indicate which page initiated the call/answer.
let curTabUUID = '';

window.tccc.on(window.tccc.events.ready, ({ tabUUID }) => {
console.log('initialization successful, current tabUUID is ' + tabUUID)
curTabUUID = tabUUID;
});

window.tccc.on(window.tccc.events.callOuted, ({ sessionId, tabUUID }) => {
if (tabUUID && tabUUID !== curTabUUID) {
// Receiving outbound call success event from other pages, business can handle by itself
}
})

window.tccc.on(window.tccc.events.userAccessed, ({ sessionId, tabUUID }) => {
if (tabUUID && tabUUID !== curTabUUID) {
// Receiving answer success event from other pages, business can handle by itself
// Here is example code, ignore this event
return;
}
})


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백