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:
- Agent clicks ‘Call’ in the custom widget.
- SDK generates SDP offer.
- Request is sent to
/api/v2/communications/offer. - Response returns 504 after approximately 15-20 seconds.
- Call state remains in
pendingand 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?