tccc.events.callIn through tccc.on to monitor the inbound call and obtain sessionId;tccc.Call.accept() to answer actively.let sessionId; //Exists in the public zone, and can be conveniently used at any time// Monitors inbound call eventswindow.tccc.on(window.tccc.events.callIn, (response) => {// Triggered when a session calls in, and stores this session's sessionId in a public zonesessionId = response.data.sessionId;})// Implements the answering methodfunction accept() {if (sessionId) {window.tccc.Call.accept({ sessionId }).then(() => {// Successfully answers and starts the call}).catch(err => {// Failed to answer, and displays detailed error reasonconst 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

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})
Feedback