awslabs / amazon-kinesis-video-streams-webrtc-sdk-android

Android SDK for interfacing with Amazon Kinesis Video Streams Signaling Service.
Apache License 2.0
58 stars 37 forks source link

How to extend the signaling channel connection duration limit - 1 hour (hard) #52

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello team,

I want the master to be able to wait for call connection from the viewer all the time.

Related to the #51 and #97(from JS-SDK), 10 minutes after the viewer logout, client.isOpen() of the master go into false. (client: private static volatile SignalingServiceWebSocketClient client;)

In order to avoid this symptom, as a result of calling the function of initwsConnection() when client.isOpen() of the master went into false (about every 10 minutes), the master could connect with the viewer for the next 10 minutes.

However, just 1 hour later, when initwsConnection() was called, the following error occurred.

com.amazonaws.AmazonClientException: Failed to get credentials from Cognito Identity

I changed the token expiration date from 1 hour to 1 day on the AWS console, but the same symptom occurred.

Is my approach correct? And, how do I extend my connection duration to 2 hours (120 minutes) or more?

disa6302 commented 3 years ago

@aki-yama-no-uchi ,

Can you detail what the use case is and why you need a signaling connection duration of more than 1 hour?

disa6302 commented 3 years ago

@aki-yama-no-uchi ,

I gather your use case is to make the android master wait for SDP offer for any amount of time. The signaling connection duration should not matter. The ideal design would be to track if signaling connection is open (using client.isOpen()) and once it is closed, re-establish the connection. From your description, it looks like that is what you are attempting to do. With this design, the hard limit should not matter. About Cognito Identity, it might be a good question to ask the Cognito team. It looks like the getCredentials() call is failing with the exception. Not sure if it is an authorization issue. Does your log contain a warning message: "getCredentials: Failed to getCredentials from Cognito Identity" along with this exception?

ghost commented 3 years ago

@disa6302 ,

Thank you for your reply.

The ideal design would be to track if signaling connection is open (using client.isOpen()) and once it is closed, re-establish the connection. From your description, it looks like that is what you are attempting to do.

Yes, I attempted with that design.

Does your log contain a warning message: "getCredentials: Failed to getCredentials from Cognito Identity" along with this exception?

No, it doesn't. It just occurred crash and fatal exception like my log.

disa6302 commented 3 years ago

I am closing this since it is a Cognito issue and needs reaching out to them. @aki-yama-no-uchi , feel free to re-open or create a new issue if you have any more questions.