simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2022 Savoir-faire Linux Inc. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Affero General Public License as |
| 6 | * published by the Free Software Foundation; either version 3 of the |
| 7 | * License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU Affero General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Affero General Public |
| 15 | * License along with this program. If not, see |
| 16 | * <https://www.gnu.org/licenses/>. |
| 17 | */ |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 18 | import { CallAction, CallBegin, WebSocketMessageType } from 'jami-web-common'; |
Misha Krieger-Raynauld | 20cf1c8 | 2022-11-23 20:26:50 -0500 | [diff] [blame] | 19 | import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'; |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 20 | import { Navigate, useNavigate } from 'react-router-dom'; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 21 | |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 22 | import LoadingPage from '../components/Loading'; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 23 | import { useUrlParams } from '../hooks/useUrlParams'; |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 24 | import CallPermissionDenied from '../pages/CallPermissionDenied'; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 25 | import { CallRouteParams } from '../router'; |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 26 | import { callTimeoutMs } from '../utils/constants'; |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 27 | import { SetState, WithChildren } from '../utils/utils'; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 28 | import { ConversationContext } from './ConversationProvider'; |
Misha Krieger-Raynauld | 20cf1c8 | 2022-11-23 20:26:50 -0500 | [diff] [blame] | 29 | import { WebRtcContext } from './WebRtcProvider'; |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 30 | import { IWebSocketContext, WebSocketContext } from './WebSocketProvider'; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 31 | |
| 32 | export type CallRole = 'caller' | 'receiver'; |
| 33 | |
| 34 | export enum CallStatus { |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 35 | Default, |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 36 | Loading, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 37 | Ringing, |
| 38 | Connecting, |
| 39 | InCall, |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 40 | PermissionsDenied, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | export interface ICallContext { |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 44 | isAudioOn: boolean; |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 45 | setIsAudioOn: SetState<boolean>; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 46 | isVideoOn: boolean; |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 47 | setIsVideoOn: SetState<boolean>; |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 48 | isChatShown: boolean; |
| 49 | setIsChatShown: SetState<boolean>; |
simon | 2a5cf14 | 2022-11-25 15:47:35 -0500 | [diff] [blame] | 50 | isFullscreen: boolean; |
| 51 | setIsFullscreen: SetState<boolean>; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 52 | callRole: CallRole; |
| 53 | callStatus: CallStatus; |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 54 | callStartTime: Date | undefined; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 55 | |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 56 | acceptCall: (withVideoOn: boolean) => void; |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 57 | endCall: () => void; |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | const defaultCallContext: ICallContext = { |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 61 | isAudioOn: false, |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 62 | setIsAudioOn: () => {}, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 63 | isVideoOn: false, |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 64 | setIsVideoOn: () => {}, |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 65 | isChatShown: false, |
| 66 | setIsChatShown: () => {}, |
simon | 2a5cf14 | 2022-11-25 15:47:35 -0500 | [diff] [blame] | 67 | isFullscreen: false, |
| 68 | setIsFullscreen: () => {}, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 69 | callRole: 'caller', |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 70 | callStatus: CallStatus.Default, |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 71 | callStartTime: undefined, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 72 | |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 73 | acceptCall: (_: boolean) => {}, |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 74 | endCall: () => {}, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | export const CallContext = createContext<ICallContext>(defaultCallContext); |
| 78 | |
| 79 | export default ({ children }: WithChildren) => { |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 80 | const webSocket = useContext(WebSocketContext); |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 81 | |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 82 | if (!webSocket) { |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 83 | return <LoadingPage />; |
| 84 | } |
| 85 | |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 86 | return <CallProvider webSocket={webSocket}>{children}</CallProvider>; |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 87 | }; |
| 88 | |
| 89 | const CallProvider = ({ |
| 90 | children, |
| 91 | webSocket, |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 92 | }: WithChildren & { |
| 93 | webSocket: IWebSocketContext; |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 94 | }) => { |
Charlie | b837e8f | 2022-11-28 19:18:46 -0500 | [diff] [blame] | 95 | const { state: routeState } = useUrlParams<CallRouteParams>(); |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 96 | const { localStream, sendWebRtcOffer, iceConnectionState, closeConnection, getUserMedia } = useContext(WebRtcContext); |
Misha Krieger-Raynauld | 20cf1c8 | 2022-11-23 20:26:50 -0500 | [diff] [blame] | 97 | const { conversationId, conversation } = useContext(ConversationContext); |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 98 | const navigate = useNavigate(); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 99 | |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 100 | const [isAudioOn, setIsAudioOn] = useState(false); |
| 101 | const [isVideoOn, setIsVideoOn] = useState(false); |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 102 | const [isChatShown, setIsChatShown] = useState(false); |
simon | 2a5cf14 | 2022-11-25 15:47:35 -0500 | [diff] [blame] | 103 | const [isFullscreen, setIsFullscreen] = useState(false); |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 104 | const [callStatus, setCallStatus] = useState(routeState?.callStatus); |
Charlie | b837e8f | 2022-11-28 19:18:46 -0500 | [diff] [blame] | 105 | const [callRole] = useState(routeState?.role); |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 106 | const [callStartTime, setCallStartTime] = useState<Date | undefined>(undefined); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 107 | |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 108 | // TODO: This logic will have to change to support multiple people in a call. Could we move this logic to the server? |
| 109 | // The client could make a single request with the conversationId, and the server would be tasked with sending |
| 110 | // all the individual requests to the members of the conversation. |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 111 | const contactUri = useMemo(() => conversation.getFirstMember().contact.getUri(), [conversation]); |
| 112 | |
| 113 | useEffect(() => { |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 114 | if (localStream) { |
| 115 | for (const track of localStream.getAudioTracks()) { |
| 116 | track.enabled = isAudioOn; |
| 117 | } |
simon | feaa1db | 2022-11-26 20:13:18 -0500 | [diff] [blame] | 118 | } |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 119 | }, [isAudioOn, localStream]); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 120 | |
| 121 | useEffect(() => { |
simon | f353ef4 | 2022-11-28 23:14:53 -0500 | [diff] [blame] | 122 | if (localStream) { |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 123 | for (const track of localStream.getVideoTracks()) { |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 124 | track.enabled = isVideoOn; |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 125 | } |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 126 | } |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 127 | }, [isVideoOn, localStream]); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 128 | |
| 129 | useEffect(() => { |
simon | 2a5cf14 | 2022-11-25 15:47:35 -0500 | [diff] [blame] | 130 | const onFullscreenChange = () => { |
| 131 | setIsFullscreen(document.fullscreenElement !== null); |
| 132 | }; |
| 133 | |
| 134 | document.addEventListener('fullscreenchange', onFullscreenChange); |
| 135 | return () => { |
| 136 | document.removeEventListener('fullscreenchange', onFullscreenChange); |
| 137 | }; |
| 138 | }, []); |
| 139 | |
| 140 | useEffect(() => { |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 141 | if (callRole === 'caller' && callStatus === CallStatus.Default) { |
| 142 | setCallStatus(CallStatus.Loading); |
| 143 | getUserMedia() |
| 144 | .then(() => { |
| 145 | const callBegin: CallBegin = { |
| 146 | contactId: contactUri, |
| 147 | conversationId, |
| 148 | withVideoOn: routeState?.isVideoOn ?? false, |
| 149 | }; |
| 150 | |
| 151 | setCallStatus(CallStatus.Ringing); |
| 152 | setIsVideoOn(routeState?.isVideoOn ?? false); |
| 153 | console.info('Sending CallBegin', callBegin); |
| 154 | webSocket.send(WebSocketMessageType.CallBegin, callBegin); |
| 155 | }) |
| 156 | .catch((e) => { |
| 157 | console.error(e); |
| 158 | setCallStatus(CallStatus.PermissionsDenied); |
| 159 | }); |
| 160 | } |
| 161 | }, [webSocket, getUserMedia, callRole, callStatus, contactUri, conversationId, routeState]); |
| 162 | |
| 163 | const acceptCall = useCallback( |
| 164 | (withVideoOn: boolean) => { |
| 165 | setCallStatus(CallStatus.Loading); |
| 166 | |
| 167 | getUserMedia() |
| 168 | .then(() => { |
| 169 | const callAccept: CallAction = { |
| 170 | contactId: contactUri, |
| 171 | conversationId, |
| 172 | }; |
| 173 | |
| 174 | setIsVideoOn(withVideoOn); |
| 175 | setCallStatus(CallStatus.Connecting); |
| 176 | console.info('Sending CallAccept', callAccept); |
| 177 | webSocket.send(WebSocketMessageType.CallAccept, callAccept); |
| 178 | }) |
| 179 | .catch((e) => { |
| 180 | console.error(e); |
| 181 | setCallStatus(CallStatus.PermissionsDenied); |
| 182 | }); |
| 183 | }, |
| 184 | [webSocket, getUserMedia, contactUri, conversationId] |
| 185 | ); |
| 186 | |
| 187 | useEffect(() => { |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 188 | if (callRole === 'caller' && callStatus === CallStatus.Ringing) { |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 189 | const callAcceptListener = (data: CallAction) => { |
| 190 | console.info('Received event on CallAccept', data); |
Charlie | c18d640 | 2022-11-27 13:01:04 -0500 | [diff] [blame] | 191 | if (data.conversationId !== conversationId) { |
| 192 | console.warn('Wrong incoming conversationId, ignoring action'); |
| 193 | return; |
| 194 | } |
| 195 | |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 196 | setCallStatus(CallStatus.Connecting); |
| 197 | |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 198 | sendWebRtcOffer(); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 199 | }; |
| 200 | |
| 201 | webSocket.bind(WebSocketMessageType.CallAccept, callAcceptListener); |
| 202 | |
| 203 | return () => { |
| 204 | webSocket.unbind(WebSocketMessageType.CallAccept, callAcceptListener); |
| 205 | }; |
| 206 | } |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 207 | }, [callRole, webSocket, sendWebRtcOffer, callStatus, conversationId]); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 208 | |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 209 | const endCall = useCallback(() => { |
| 210 | const callEnd: CallAction = { |
| 211 | contactId: contactUri, |
| 212 | conversationId, |
| 213 | }; |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 214 | |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 215 | console.info('Sending CallEnd', callEnd); |
| 216 | closeConnection(); |
| 217 | webSocket.send(WebSocketMessageType.CallEnd, callEnd); |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 218 | navigate(`/conversation/${conversationId}`); |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 219 | // TODO: write in chat that the call ended |
| 220 | }, [webSocket, contactUri, conversationId, closeConnection, navigate]); |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 221 | |
| 222 | useEffect(() => { |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 223 | const callEndListener = (data: CallAction) => { |
| 224 | console.info('Received event on CallEnd', data); |
Charlie | c18d640 | 2022-11-27 13:01:04 -0500 | [diff] [blame] | 225 | if (data.conversationId !== conversationId) { |
| 226 | console.warn('Wrong incoming conversationId, ignoring action'); |
| 227 | return; |
| 228 | } |
| 229 | |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 230 | closeConnection(); |
| 231 | navigate(`/conversation/${conversationId}`); |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 232 | // TODO: write in chat that the call ended |
| 233 | }; |
| 234 | |
| 235 | webSocket.bind(WebSocketMessageType.CallEnd, callEndListener); |
| 236 | return () => { |
| 237 | webSocket.unbind(WebSocketMessageType.CallEnd, callEndListener); |
| 238 | }; |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 239 | }, [webSocket, navigate, conversationId, closeConnection]); |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 240 | |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 241 | useEffect(() => { |
Charlie | b837e8f | 2022-11-28 19:18:46 -0500 | [diff] [blame] | 242 | if ( |
| 243 | callStatus === CallStatus.Connecting && |
| 244 | (iceConnectionState === 'connected' || iceConnectionState === 'completed') |
| 245 | ) { |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 246 | console.info('Changing call status to InCall'); |
| 247 | setCallStatus(CallStatus.InCall); |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 248 | setCallStartTime(new Date()); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 249 | } |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 250 | }, [iceConnectionState, callStatus]); |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 251 | |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 252 | useEffect(() => { |
Charlie | 380dc5e | 2022-11-29 16:51:42 -0500 | [diff] [blame] | 253 | if (iceConnectionState === 'disconnected' || iceConnectionState === 'failed') { |
| 254 | console.info('ICE connection disconnected or failed, ending call'); |
Charlie | b837e8f | 2022-11-28 19:18:46 -0500 | [diff] [blame] | 255 | endCall(); |
| 256 | } |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 257 | }, [iceConnectionState, callStatus, isVideoOn, endCall]); |
Charlie | b837e8f | 2022-11-28 19:18:46 -0500 | [diff] [blame] | 258 | |
| 259 | useEffect(() => { |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 260 | const checkStatusTimeout = () => { |
| 261 | if (callStatus !== CallStatus.InCall) { |
| 262 | endCall(); |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 263 | } |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 264 | }; |
| 265 | const timeoutId = setTimeout(checkStatusTimeout, callTimeoutMs); |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 266 | |
MichelleSS | 5516420 | 2022-11-25 18:36:14 -0500 | [diff] [blame] | 267 | return () => { |
| 268 | clearTimeout(timeoutId); |
| 269 | }; |
| 270 | }, [callStatus, endCall]); |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 271 | |
Charlie | b837e8f | 2022-11-28 19:18:46 -0500 | [diff] [blame] | 272 | useEffect(() => { |
| 273 | navigate('.', { |
| 274 | replace: true, |
| 275 | state: {}, |
| 276 | }); |
| 277 | }, [navigate]); |
| 278 | |
simon | ff1cb35 | 2022-11-24 15:15:26 -0500 | [diff] [blame] | 279 | if (!callRole || callStatus === undefined) { |
| 280 | console.error('Invalid route. Redirecting...'); |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 281 | return <Navigate to={'/'} />; |
| 282 | } |
| 283 | |
| 284 | return ( |
| 285 | <CallContext.Provider |
| 286 | value={{ |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 287 | isAudioOn, |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 288 | setIsAudioOn, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 289 | isVideoOn, |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 290 | setIsVideoOn, |
simon | f9d78f2 | 2022-11-25 15:47:15 -0500 | [diff] [blame] | 291 | isChatShown, |
| 292 | setIsChatShown, |
simon | 2a5cf14 | 2022-11-25 15:47:35 -0500 | [diff] [blame] | 293 | isFullscreen, |
| 294 | setIsFullscreen, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 295 | callRole, |
| 296 | callStatus, |
Gabriel Rochon | e382a30 | 2022-11-23 12:37:04 -0500 | [diff] [blame] | 297 | callStartTime, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 298 | acceptCall, |
simon | accd802 | 2022-11-24 15:04:53 -0500 | [diff] [blame] | 299 | endCall, |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 300 | }} |
| 301 | > |
simon | 9076a9a | 2022-11-29 17:13:01 -0500 | [diff] [blame] | 302 | {callStatus === CallStatus.PermissionsDenied ? <CallPermissionDenied /> : children} |
simon | f929a36 | 2022-11-18 16:53:45 -0500 | [diff] [blame] | 303 | </CallContext.Provider> |
| 304 | ); |
| 305 | }; |