amazon-chime-sdk-js icon indicating copy to clipboard operation
amazon-chime-sdk-js copied to clipboard

Catch error when attendees are unable to connect to signalling channel.

Open ReneS1991 opened this issue 4 years ago • 5 comments

What are you trying to do?

Several times we had the problem that an attendee wasn't able to connect to the websocket signalling channel due to for example being on a VPN that doesn't allow the attendee to connect. We want at that moment to be able to communicate to the attendee that the connection cannot be established and therefore redirect the user. However, we do not see a way of catching the error and responding to it as it happens before the audioVideoDidStop and also before the meetingSession.audioVideo.realtimeSubscribeToFatalError. We also tried wrapping the audioVideo.start() in a try-catch but without success.

If anyone knows a way to capture this error that would be awesome 😄

What documentation have you looked at so far?

We searched for a way to catch the error occurring when trying to connect to the meeting, or even before that. As mentioned above, the following options have been tried & looked at but without success:

  • meetingSession.audioVideo.realtimeSubscribeToFatalError() https://aws.github.io/amazon-chime-sdk-js/classes/defaultaudiovideofacade.html#realtimesubscribetofatalerror
  • Wrapping the meetingSession.audioVideo.start() in a try-catch https://aws.github.io/amazon-chime-sdk-js/classes/defaultaudiovideofacade.html#start
  • Getting the MeetingSessionStatus in the audioVideoDidStop observer. https://aws.github.io/amazon-chime-sdk-js/interfaces/audiovideoobserver.html#audiovideodidstop

Screenshot of the console-error

image

ReneS1991 avatar Sep 04 '20 14:09 ReneS1991

Unfortunately, currently we do not provide a way to catch these errors. I will bring it back to our team and put it to our feature enhancement list.

ltrung avatar Sep 14 '20 21:09 ltrung

Hello, I have 2 questions regarding to 'audioVideoDidStop'.

  1. Can I use it marked as a meeting session ended no matter what MeetingSessionStatusCode I get?
Screenshot 2020-09-16 at 12 00 46

What is the definition of 'No audio connections' here? If in one meeting there is only one attendee having no audio input, no video input, but audio output, does he count for 'no audio connections' and 'audioVideoDidStop' will invoke after 5mins?

Thanks!

HbZh avatar Sep 16 '20 04:09 HbZh

@HbZh

  1. It depends on what you define a meeting end but usually no. AudioVideoDidStop just mean the current meeting session stops for the attendee. They can still rejoin the same meeting unless it was deleted by the application using DeleteMeeting API or the meeting auto-end based on the policies in the comment of the code you pasted.
  2. No audio connection just means no attendee joins with an audio device.

ltrung avatar Sep 17 '20 01:09 ltrung

Hi @ReneS1991, I'm facing the same problem than you, without any solution for now ...

I tried a workaround by stopping the connection after a certain time (3000 ms for instance) :

audioVideoObserver = {
    audioVideoDidStartConnecting(reconnecting) {
        console.log('RLE audioVideoDidStartConnecting', {reconnecting})
        setTimeout(() => {
            if (!this.audioVideoStarted) {
                audioVideo.stop()
            }
        }, 3000)
    },
    audioVideoDidStart() {
        console.log('RLE audioVideoDidStart')
        this.audioVideoStarted = true
    },
    audioVideoDidStop(sessionStatus: MeetingSessionStatus) {
        console.log('RLE audioVideoDidStop', {
            sessionStatus,
            statusCode: sessionStatus?.statusCode(),
        })
    },
}
audioVideo.addObserver(audioVideoObserver)

Unfortunately, amazon-chime-sdk-js keeps trying to connect to the Chime Meeting, event if I called explicitly audioVideo.stop().

Capture d’écran 2020-09-22 à 16 07 34

rlebosse avatar Sep 22 '20 14:09 rlebosse

@ltrung it takes 2 minutes to get the audioVideoDidStop event with statusCode = TaskFailed.

Is there a way to tell amazon-chime-sdk-js how much time we are ok to wait for audioVideoDidStart before sending audioVideoDidStop and stop trying to connect to the Chime Meeting please ?

If not, do you plan on working on this kind of feature ?

Thanks in advance !

rlebosse avatar Sep 22 '20 15:09 rlebosse