Handle ICE state failed
- Handle sending call end on ICE state failed
- Minor fix for startcall function
GitLab: 189
Change-Id: Iae4353614d22b3b6856b58babee7d8feea8c8f82
diff --git a/client/src/contexts/CallProvider.tsx b/client/src/contexts/CallProvider.tsx
index f54b75f..8db38e0 100644
--- a/client/src/contexts/CallProvider.tsx
+++ b/client/src/contexts/CallProvider.tsx
@@ -335,8 +335,8 @@
}, [webSocket, contactUri, conversationId, quitCall]);
useEffect(() => {
- if (iceConnectionState === 'disconnected') {
- console.info('ICE connection disconnected');
+ if (iceConnectionState === 'disconnected' || iceConnectionState === 'failed') {
+ console.info('ICE connection disconnected or failed, ending call');
endCall();
}
}, [iceConnectionState, callStatus, setVideoStatus, isVideoOn, endCall]);