Flex on Citrix VDI gives customers using Virtual Desktop Infrastructure (VDI) environments the ability to run Flex.
Flex UI 2.5.0 and later improves audio quality by supporting Citrix HDX WebRTC devices. When a voice call initiates, signaling occurs between the agent's browser/Citrix Workspace App and the Twilio Voice JS SDK. The call connects directly from the agent's machine to Twilio Programmable Voice.
Flex on Citrix VDI applies only to voice calls.
The following are system requirements for the Citrix server and remote device.
Citrix VDI version that supports Citrix HDX 2.0.3 and above
Flex UI version 2.5.0 or later (Flex-hosted or self-hosted)
The system that VDI is running on must support Citrix HDX
Server operating system:
Up-to-date version of Google Chrome Enterprise browser or Microsoft Edge with the ability to enforce policies
One of the following operating systems:
The latest version of one of the following browsers:
To set up Flex on Citrix VDI, complete the following steps:
Changes to the Citrix VDI environment require a user with Administrative privileges.
Note: If you are unable to change the registry value or are facing permission issues, contact your Citrix administrator.
By default, Citrix HDX is not enabled for Chrome. Complete the following steps to enable the Chrome browser to access the underlying Citrix HDX framework:
Add the application binary name, chrome.exe, to an allowlist registry in Windows Registry Editor:
Key Path | HKLM\Software\WOW6432Node\Citrix\WebSocketService |
---|---|
Key Name | ProcessWhitelist |
Key Type | MULTISZ |
Key Value | chrome.exe |
Restart CtxHdxWebSocketService to enable Citrix HDX support for Chrome. To do this, open Task Manager, right-click CtxHdxWebSocketService, and select Restart.
(Optional) Some versions of Citrix have issues with HDX content redirection with Chrome browser 105 and later. As a workaround, disable the Chrome Browser Chrome Root Store certificate verifier on VDI using one of the methods specified on the Citrix support page.
You can verify that you've disabled the Chrome Browser Chrome Root Store certificate by following the steps in the Chrome Root Store and Certificate Verifier.
The issue is fixed on the following Citrix versions:
Versions after CVAD 2212
CVAD 1912 CU7
CVAD 2203 CU2
To use Flex on Citrix VDI, you must enable it:
Open the following ports on the Citrix machine:
Protocol | Port | Reason |
---|---|---|
TCP,UDP | 1494 | Access to applications and virtual desktops by ICA/HDX. EDT protocol requires port 1494 to be open for UDP. |
TCP,UDP | 2598 | Access to applications and virtual desktops by ICA/HDX with Session Reliability. EDT protocol requires port 2598 to be open for UDP. |
TCP,UDP | 443 | Access to applications and virtual desktops by ICA/HDX over TLS/DTLS. |
UDP | 16500..16509 | ICA/HDX audio over UDP Real-time Transport. |
Upgrade the Flex library to a version that supports Citrix VDI:
npm install flex-ui@2.5.0
If you are using @twilio/voice-sdk, upgrade to version 2.5 or later for support with the Citrix HDX-compatible webRTC APIs.
npm install @twilio/voice-sdk@2.5
Follow these steps to validate your setup and ensure that Flex will automatically detect if you're running in a VDI environment:
Log in to your VDI environment.
Open the Chrome browser within the VDI environment.
Open Flex and log in to your Flex instance.
Open the Chrome developer tools and switch to the Console tab in the developer tools.
Wait until the log messages slow down in the console.
Paste the following code snippet into the console, then press Enter.
1const citrixSocket = new WebSocket("wss://127.0.0.1:9002");2citrixSocket.onopen = (event) => {3citrixSocket.send(4JSON.stringify({5v: "webrtc",6hdr: {7version: 1,8msg_type: "req",9modifier: false,10destroy: false,11proc: { iid: 0, methodid: 2 }12},13objref: { oid: 0 },14params: [[]]15})16);17};18citrixSocket.onmessage = (event) => {19const msg = JSON.parse(event.data);20if ( msg.command === "feature-support" ) {21console.log("Success : We are in Citrix with webrtc support");22alert("Success : We are in Citrix with webrtc support");23citrixSocket.close();24}25};26citrixSocket.onclose = ()=> console.log("Socket successfully closed")27citrixSocket.onerror = ()=> {28console.log("Failure : Error opening socket");29alert("Failure : Error opening socket");30}31
Check your configurations and ensure that your environment meets the system requirements, then try again. If you still run into issues, contact Twilio support.
If you have additional plugins or business logic that use the Twilio Voice JavaScript SDK, you must upgrade them to use the latest Citrix HDX-compatible APIs. To use Citrix HDX, you must update the voice setup function. On the audio event of Twilio Voice JavaScript SDK, you need to map the Citrix devices to connection. The following examples demonstrate how to update these calls:
The Twilio Voice JavaScript SDK needs three new arguments for the Twilio Voice JavaScriptJS SDK setup function: RTCPeerConnection
, getUserMedia
, and enumerateDevices
.
1setup(data, {2...options,3...{4RTCPeerConnection: window.CitrixWebRTC.CitrixPeerConnection.bind(window.CitrixWebRTC),5getUserMedia: (...args: any[]) => window.CitrixWebRTC.getUserMedia(...args),6enumerateDevices: window.CitrixWebRTC.enumerateDevices.bind(window.CitrixWebRTC),7},8});9
Map the Citrix audio element to the voice connection by specifying the following:
1connection.on("audio", function(remoteAudio) {2....3window.CitrixWebRTC.mapAudioElement(remoteAudio);4....5})6
Voice Over Internet Protocol (VoIP) call quality is influenced by environmental factors, such as:
It's important you review our deployment best practices and connectivity requirements documentation before taking your app to production. Browsers that support DSCP are able to tag call media packets sent by the voice client. Your router or network element can then use these tags to prioritize call media packets over other traffic on the network.
Follow these steps to verify that Flex HDX is working correctly in Chrome:
Open a new tab on the machine connected to the Citrix environment.
Navigate to chrome://webrtc-internals/. The page should look similar to this:
Log in to your Citrix account and open Flex inside Chrome from your Citrix instance.
Start a call.
The Chrome WebRTC-internals page that you opened in step 1 refreshes with a new tab on the page, representing the call that you started.
Capture your Citrix instance logs using one of the following methods:
Citrix and Twilio jointly support the delivery of Flex on Citrix HDX VDI.
If you experience an issue with Flex on Citrix VDI, open a support ticket with the vendor whose product you suspect to be causing the issue. In other words, if the problem seems like a Flex issue, open a support ticket with Twilio. If you suspect it's a Citrix HDX issue, open a support ticket with Citrix. You must have an active Citrix license to receive support from Citrix.
When Citrix or Twilio receives the ticket, they will triage the issue and escalate it as appropriate. If they determine that the problem is caused by the other company's product, they will advise you to create a support ticket with the other company.