Pass UUI data to Genesys Cloud during SIP transfers
Configure LiveKit SIP transfers to pass User-to-User Information (UUI) data to Genesys Cloud by embedding it in the Refer-To URI.
Last Updated:
When transferring calls to Genesys Cloud using SIP REFER, you may need to pass User-to-User Information (UUI) data. Genesys Cloud expects UUI data to be embedded directly in the Refer-To URI rather than as a separate SIP header.
The problem
When you use the headers parameter in TransferSIPParticipantRequest to add a User-to-User header, the header appears in the SIP REFER request but Genesys Cloud doesn't populate Call.UUIData from it. This is because Genesys expects UUI data embedded as a URI parameter in the Refer-To header itself.
What Genesys expects:
1Refer-To: <sip:+15551234567@genesys-host.com?User-to-User=00FA1B2C%3Bencoding%3Dhex>
What happens with the headers parameter:
1Refer-To: <sip:+15551234567@genesys-host.com>2User-to-User: 00FA1B2C;encoding=hex
The solution
Include the UUI data as a query parameter in the transfer_to field when calling TransferSIPParticipant. LiveKit preserves query parameters in the Refer-To URI.
Important: You must use the
sip:URI format for this to work. LiveKit preserves query parameters when usingsip:URIs. If you use thetel:format with a PSTN carrier, the transfer may fail depending on how the carrier handles UUI data in the URI.
Python
1from livekit import api2from livekit.protocol.sip import TransferSIPParticipantRequest3from urllib.parse import quote45async def transfer_to_genesys_with_uui(6room_name: str,7participant_identity: str,8destination_number: str,9uui_data: str,10) -> None:11"""Transfer a call to Genesys Cloud with UUI data."""1213# URL-encode the UUI parameter value14# The UUI format is: <hex-data>;encoding=hex15uui_param = quote(f"{uui_data};encoding=hex", safe='')1617# Build the SIP URI with UUI as a query parameter18transfer_to = f"sip:{destination_number}@your-genesys-edge.com?User-to-User={uui_param}"1920async with api.LiveKitAPI() as livekit_api:21await livekit_api.sip.transfer_sip_participant(22TransferSIPParticipantRequest(23room_name=room_name,24participant_identity=participant_identity,25transfer_to=transfer_to,26play_dialtone=False,27)28)
Node.js
1import { SipClient } from 'livekit-server-sdk';23async function transferToGenesysWithUUI(4roomName: string,5participantIdentity: string,6destinationNumber: string,7uuiData: string8): Promise<void> {9const sipClient = new SipClient(10process.env.LIVEKIT_URL!,11process.env.LIVEKIT_API_KEY!,12process.env.LIVEKIT_API_SECRET!13);1415// URL-encode the UUI parameter value16const uuiParam = encodeURIComponent(`${uuiData};encoding=hex`);1718// Build the SIP URI with UUI as a query parameter19const transferTo = `sip:${destinationNumber}@your-genesys-edge.com?User-to-User=${uuiParam}`;2021await sipClient.transferSipParticipant(22roomName,23participantIdentity,24transferTo,25{ playDialtone: false }26);27}
UUI data format
Genesys Cloud expects UUI data in hex-encoded format with an encoding indicator:
| Component | Description |
|---|---|
<hex-data> | Your data encoded as hexadecimal (e.g., 00FA1B2C3D) |
;encoding=hex | Indicates the data is hex-encoded |
Example: Encoding a string as UUI
1def string_to_uui_hex(data: str) -> str:2"""Convert a string to hex-encoded UUI data."""3return data.encode('utf-8').hex()45# Example usage6context_data = "intent:billing,account:12345"7uui_hex = string_to_uui_hex(context_data)8# Result: "696e74656e743a62696c6c696e672c6163636f756e743a3132333435"
Verifying the transfer
To confirm UUI data is being passed correctly:
- Capture SIP traffic: Use Wireshark or a similar tool to inspect the outgoing REFER request from LiveKit.
- Check the Refer-To header: Verify the URI includes your
User-to-Userparameter with properly encoded data. - Verify in Genesys: Check that
Call.UUIDatais populated in your Genesys Cloud flow or Architect script.
Expected SIP REFER structure
1REFER sip:caller@... SIP/2.02Refer-To: <sip:+15551234567@your-genesys-edge.com?User-to-User=00FA1B2C%3Bencoding%3Dhex>3...
Genesys Cloud configuration
Ensure your Genesys Cloud Edge or BYOC trunk is configured to accept and process UUI data:
- BYOC Premises: Configure your Edge to extract UUI from the Refer-To URI.
- BYOC Cloud: Check your trunk settings for UUI handling.
- Architect flows: Use the
Call.UUIDatavariable to access the transferred UUI data.
Troubleshooting
UUI not appearing in Genesys
- Verify the
User-to-Userparameter is URL-encoded correctly in thetransfer_toURI. - Check that your Genesys trunk is configured to process UUI data from REFER requests.
- Confirm the hex encoding is valid (even number of hex characters).
Transfer fails with SIP error
- Ensure you're using a
sip:URI, not atel:URI. Thetel:format may not preserve query parameters correctly, especially with PSTN carriers. - Ensure the destination SIP URI is valid and the Genesys Edge is reachable.
- Check that your SIP trunk supports REFER transfers.
- Review Genesys Edge logs for rejection reasons.
Special characters in UUI data
URL-encode the entire UUI parameter value, including the ;encoding=hex suffix. The semicolon and equals sign must be percent-encoded (%3B and %3D).