WebRTC SDK v3.3.0 Media Negotiation Timeout (504) in AppFoundry Widget During High-Concurrency Load

Deploying a custom softphone widget within an AppFoundry integration for a large-scale enterprise client. The widget utilizes the Genesys Cloud WebRTC SDK version 3.3.0 to handle media streams directly in the browser. The architecture relies on the standard OAuth 2.0 flow for authentication, with tokens refreshed via the AppFoundry backend service.

The integration functions correctly during initial testing with single-user scenarios. However, under load testing simulating concurrent agent logins (approx. 500 agents initiating calls within a 10-minute window), the media negotiation phase begins to fail intermittently. The specific error observed in the browser console is Media negotiation failed: 504 Gateway Timeout when attempting to establish the SDP offer/answer exchange with the Genesys Cloud media servers.

The sequence of events is as follows:

  1. Agent clicks ‘Call’ in the custom widget.
  2. SDK generates SDP offer.
  3. Request is sent to /api/v2/communications/offer.
  4. Response returns 504 after approximately 15-20 seconds.
  5. Call state remains in pending and eventually fails.

Network traces indicate that the requests are reaching the Genesys Cloud edge, but the timeout suggests a bottleneck in the media server allocation or SIP signaling processing during peak load. The API rate limits appear to be respected, as no 429 errors are logged. The issue is not consistent; some calls succeed while others fail randomly under the same load conditions.

Has anyone encountered similar media negotiation timeouts with WebRTC SDK v3.3.0 in high-concurrency environments? Are there specific configuration parameters in the AppFoundry integration or Architect flow that can optimize media server allocation for bulk call initiations? Additionally, are there known limitations regarding the number of concurrent WebRTC sessions per organization that might be causing this bottleneck?

This falls outside the scope of performance dashboarding and queue activity analysis. For WebRTC SDK media negotiation specifics, consult the developer documentation or engage a technical architect familiar with AppFoundry integrations.

Not the OP here. The 504 usually hits when WebSocket connections saturate before the media handshake completes. Check if your JMeter thread group respects the Genesys Cloud API rate limits for token refreshes during high concurrency.