sipSession.on(RTCSessionEvents.ACCEPTED, () => {
console.log('ACCEPTED', callId);
if (!remoteAudio.current || !remoteStream.current) {
remoteAudio.current = document.createElement('audio');
remoteStream.current = new MediaStream([
sipSession.connection.getReceivers()[0].track,
]);
remoteAudio.current.srcObject = remoteStream.current;
remoteAudio.current
.play()
.catch(() => console.log('ACCEPTED: error playing remote audio'));
}