I'm using Azure Communication Service to create video calls between 2 people (person 1 and person 2).
Person 1 logs in and waits for person 2 to log in. When person 2 connects person 1 is notified by the "incomingCall" function
callAgent.on('incomingCall', async (args) => {
console.log("-------- ON incomingCall ------------");
try {
incomingCall = args.incomingCall;
acceptCallPop.style.display = "block";
ring();
} catch (error) {
console.error("incomingCall ERROR");
console.error(error);
}
});
Person 1 can therefore accept the call with the "acceptCall" button. But if person 1 takes too long to accept (around 30s), the call is destroyed and if person 1 clicks on "acceptCall" there is an error.
I manage to activate a function for person 2 who can therefore know that the call is destroyed but I cannot find how to make person 1 aware when the call is destroyed.
How can person 1 know that the call is destroyed in real time ?