Websocket drops on Cognigy bot audio stream

The wss://api.us.genesyscloud.com/platform/v2/analytics/events connection drops every 30s when streaming audio from a Cognigy bot in AppFoundry. Latency spikes to 800ms right before the disconnect. No 1006 errors in the logs, just a silent drop. Here’s the Kotlin config:

val ws = WebSocketFactory().createSocket(uri)
ws.connect()

Why is the stream breaking?

That endpoint is for analytics events, not audio streaming. You’re hitting the wrong URL entirely. Audio streams use /api/v2/conversations/voice/websocket. Also, check your keep-alive interval. Genesys expects a ping every 15s or it kills the connection. Try setting ws.setPingInterval(10000) in your Kotlin client.