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;
window.tccc.on(window.tccc.events.callIn, (response) => {
sessionId = response.data.sessionId;
})
function accept() {
if (sessionId) {
window.tccc.Call.accept({ sessionId })
.then(() => {
})
.catch(err => {
const error = err.errorMsg;
})
} else {
console.error('The session to be answered was not found');
}
}
Method 2: Answer by Clicking on the Call Bar
Other Related Events
window.tccc.on(window.tccc.events.callIn, (response) => {
})
window.tccc.on(window.tccc.events.userAccessed, (response) => {
})
window.tccc.on(window.tccc.events.sessionEnded, (response) => {
})
Was this page helpful?