tencent cloud

Cloud Contact Center

Web

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-04-01 18:12:41

Initializing SDK

Please refer to Initializing SDK.
Note:
The following steps should be performed after the 'tccc.events.ready' event is successful.

Answering Methods

Method 1: Answer via SDK API

1. Bind the inbound call event tccc.events.callIn through tccc.on to monitor the inbound call and obtain sessionId;
2. Use tccc.Call.accept() to answer actively.
Sample code:
let sessionId; //Exists in the public zone, and can be conveniently used at any time

// Monitors inbound call events
window.tccc.on(window.tccc.events.callIn, (response) => {
// Triggered when a session calls in, and stores this session's sessionId in a public zone
sessionId = response.data.sessionId;
})

// Implements the answering method
function accept() {
if (sessionId) {
window.tccc.Call.accept({ sessionId })
.then(() => {
// Successfully answers and starts the call
})
.catch(err => {
// Failed to answer, and displays detailed error reason
const error = err.errorMsg;
})
} else {
console.error('The session to be answered was not found');
}
}

// Then, accept() can be executed at the required place to trigger answering the call

Method 2: Answer by Clicking on the Call Bar





Other Related Events

window.tccc.on(window.tccc.events.callIn, (response) => {
// Triggered when session calls in
})
window.tccc.on(window.tccc.events.userAccessed, (response) => {
// Agent connection
})
window.tccc.on(window.tccc.events.sessionEnded, (response) => {
// Triggered when session ends
})


도움말 및 지원

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

피드백