tencent cloud

All product documents
Cloud Contact Center
Last updated: 2025-01-09 15:48:27
Web
Last updated: 2025-01-09 15:48:27
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 (ACW): Admins can set a wrap-up timer for agents to organize notes, during which no new calls are assigned.
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
Result of SDK API call. Returns 'success' on success, and 'error' on failure.
errorMsg
string
No
Error message, returned when status is 'error'

Call (API Function of Voice and Audio Agent)

Inbound call

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

Parameter
Type
Required
Remarks
options
phoneNumber
String
Yes
Callee Number
phoneDesc
String
No
Number remarks, which will replace the number displayed in the call bar
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
Number ID list
phoneEncodeType
'number'
No
Currently, only 'number' is supported, forcing the use of actual numbers when number mapping is enabled.

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

The description of CallResponse is as follows:
Parameter
Type
Required
Remarks
response
sessionId
String
Yes
Session ID
calleeLocation
String
No
Callee number location
calleePhoneNumber
String
Yes
Callee 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
Session ID, obtained from the tccc.events.callIn event

End Video Session

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Delete Call

tccc.Call.deleteCall(options)

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Mute

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Unmute

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Whether Mic is Muted

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
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
Session ID
skillGroupId
String
No
Transfers to a specified skill group.
userId
String
No
Transfers to a specified agent.

Call on Hold

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
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
Session ID

Send Phone Extension Number

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID
dtmfText
String
No
The extension number to be sent

Chat (Desk Agent API Functions)

Answer Video Session

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

End Chat Session

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Transfer Video Session

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID
skillGroupId
String
No
Transfers to a specified skill group.
userId
String
No
Transfers to a specified agent.

Video (Video Agent API Functions)

Answer Video Session

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

End Video Session

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Mute

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Unmute

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Camera Turns Off

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Camera Turns On

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Transfer Video Session

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

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID
skillGroupId
String
No
Transfers to a specified skill group.
userId
String
No
Transfers to a specified agent.

Agent (Agent Status API Functions)

For more agent status enumeration types, refer to Agent Status.

Swtich to Online Status

tccc.Agent.online(): void

Swtich to Offline Status

tccc.Agent.offline(): void

Agent Status Setup

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

Parameter
Type
Required
Remarks
options
status
String
Yes
Agent status, valid values:
free: Idle, available to start service
rest: On break
arrange: After-call-work
notReady: Busy
stopNotReady: Stops showing busy
restReason
String
No
Break Reason

Get Agent Status

tccc.Agent.getStatus():AgentStatus

Devices (Device API Functions)

Web Browser Availability Check

tccc.Devices.isBrowserSupported(): boolean

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

Return Microphone List

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

Return Speaker List

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

UI (User Interface API Functions)

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

Events

Monitor Events

tccc.on(event, callback)

Cancel Event Monitor

tccc.off(event, callback)

Complete SDK Initialization

tccc.events.ready

Triggered when SDK initialization is complete, at which point the API can be called safely.
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
Session 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
Callee 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
Session 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
User's 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
Session 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
Users will get a WeChat nickname after authorization.
avatar
String
No
Users will receive a WeChat profile photo after 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
Session 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
Users will get a WeChat nickname after authorization.
avatar
String
No
Users will receive a WeChat profile photo after authorization.
remark
String
No
Remarks

Inbound Internal Session

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

Agent Session Handling

tccc.events.userAccessed

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
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
Session ID

Session End Event

tccc.events.sessionEnded

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID
closeBy
String
Yes
Indicates the hang-up party:
client: Hang up by user
seat: Hang up by agent
admin: Hang up by system
timer: Hang up by timer
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
Session ID
callerPhoneNumber
String
Yes
Caller number used for making an outbound call
calleePhoneNumber
String
Yes
Callee 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 using mobile outbound call
MiniProgramSeat indicates using mini program outbound call
staffExtensionSeat indicates using the phone for outbound calls
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
Session ID

Session Transfer Event

tccc.events.transfer

Parameter
Type
Required
Remarks
options
sessionId
String
Yes
Session ID

Agent Status Change Event

tccc.events.statusChanged

Parameter
Type
Required
Remarks

options
status
No
For details, refer to Agent Status.


Agent Being Kicked Out Event

tccc.events.kickedOut

Triggered When Agent Logs in on Multiple Devices

Automatic Speech Recognition Event

tccc.events.asr

Parameter
Type
Required
Remarks

options
sessionId
String
Yes
Session ID

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

flow
'IN' | 'OUT'
Yes
Recognition direction
IN: User side
OUT: Agent side


Multi-Tab Integration 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. The SDK is integrated within the business system under the same domain name.
3. Mobile browsers are not supported.

Integration Guidance

1. Initialize the SDK, refer to Web.
2. Add the enableShared parameter to enable multi-tab feature.
function injectTcccWebSDK(SdkURL) {
if (window.tccc) {
console.warn('The SDK has been initialized. Please confirm whether the initialization is being executed repeatedly');
return;
}
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.setAttribute('crossorigin', 'anonymous');
script.src = SdkURL;
/*
* Add enableShared to enable multi-tab feature
*/
script.dataset.enableShared = 'true'
document.body.appendChild(script);
script.addEventListener('load', () => {
window.tccc.on(window.tccc.events.ready, ({ tabUUID }) => {
resolve('Initialization succeeded, 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 succeeded, current tabUUID is ' + tabUUID)
curTabUUID = tabUUID;
});

window.tccc.on(window.tccc.events.callOuted, ({ sessionId, tabUUID }) => {
if (tabUUID && tabUUID !== curTabUUID) {
// Received outbound call success event from another page, business logic can handle it
}
})

window.tccc.on(window.tccc.events.userAccessed, ({ sessionId, tabUUID }) => {
if (tabUUID && tabUUID !== curTabUUID) {
// Received call answered event from another page, business logic can handle it
// This is sample code, this event will be ignored
return;
}
})

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon