Azure Communication Service for video call - function to know if incomingCall is out of time

Yodex 0 Reputation points
2024-04-09T06:46:40.6433333+00:00

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 ?

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
680 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 16,011 Reputation points
    2024-04-16T22:37:43.7433333+00:00

    Hi @Yodex aplogies for the delay in response. you can use the incomingCall.on('callEnded' ) event. This event on the callee side, means that on the callee side (person1), the incoming call has stopped ringing and callee(person1) took too long to answer the incoming call.

    -Grace

    0 comments No comments