How to Maintain WebSocket Connection for RealTime API in Unstable Network Conditions?

I am currently using OpenAI’s RealTime API over WebSocket.
However, in some scenarios, the network connection becomes unstable, particularly when entering an elevator, which causes the WebSocket connection to disconnect.

I have the following questions:

  1. Is there a way to maintain the WebSocket connection even if the network is unavailable for up to 5 minutes?
    For example, can adjusting the frequency of KeepAlive messages or using other configurations help to prevent disconnections?

  2. If the WebSocket connection is completely lost, is there a way to reconnect while preserving the previous conversation context?
    Specifically, is it possible to save the chat history on the client side and send it back to the server upon reconnecting to restore the context seamlessly?

I want to provide a seamless user experience even under unstable network conditions. Any advice, best practices, or references would be greatly appreciated.