WebSocket drops causing audio lag in Cognigy-Genesys integration

Hey folks,

We’re seeing some weird behavior with our AppFoundry integration. The bot flows are triggering fine, but the WebSocket connection between Genesys Cloud and our Cognigy instance keeps dropping after about 45 seconds of audio playback. This causes a noticeable glitch in the IVR experience.

We’re using the standard WebSocket endpoint for the bot integration. The connection handshake is successful, and we get the initial sessionStarted event. But then the audio stream stalls, and we see a 4001: Internal server error close code in the browser console (and our server logs).

Here’s a snippet of the WebSocket config we’re passing in the Architect flow:

{
 "url": "wss://api.mypurecloud.com/api/v2/filters/events/stream",
 "eventTypes": ["conversation.audio"],
 "reconnect": true
}

We’ve tried the following:

  • Increased the timeout on our Node.js ws client to 60s.
  • Verified the Cognigy webhook timeout is set to 30s.
  • Checked the Genesys Cloud audit log for any filter errors.

The drop happens consistently during longer TTS responses. Is there a specific header or keep-alive ping we need to send to keep the connection alive? Or is this a limit on the event stream subscription?