Skip to main content

Overview

GenesysAudioHookSerializer enables integration with Genesys Cloud Contact Center via the AudioHook protocol (v2), allowing your Pipecat application to handle contact center interactions with bidirectional audio streaming, DTMF event handling, barge-in support, and Architect flow variable passing.

Genesys Serializer API Reference

Pipecat’s API methods for Genesys AudioHook integration

Genesys AudioHook Documentation

Official Genesys AudioHook protocol reference

Installation

The GenesysAudioHookSerializer does not require any additional dependencies beyond the core Pipecat library:

Prerequisites

Genesys Cloud Setup

Before using GenesysAudioHookSerializer, you need:
  1. Genesys Cloud Organization: Access to a Genesys Cloud org with AudioHook enabled
  2. AudioHook Integration: Configure an AudioHook integration in Genesys Cloud admin
  3. Architect Flow: Create an Architect flow that uses the AudioHook action to connect calls to your Pipecat application
  4. WebSocket Endpoint: A publicly accessible WebSocket endpoint for Genesys to connect to

Key Features

  • Bidirectional Audio: Stream audio between Genesys and Pipecat in PCMU format at 8kHz
  • Protocol Handshake: Automatic handling of open/opened, close/closed, and ping/pong messages
  • DTMF Handling: Process touch-tone events from callers
  • Barge-in Support: Notify Genesys when the user interrupts bot audio
  • Pause/Resume: Handle hold scenarios, and pause or resume the stream from your bot
  • Architect Variables: Pass input/output variables between Architect flows and your bot
  • Stereo Support: Process external (customer) audio, internal (agent) audio, or both channels

Configuration

InputParams
default:"None"
Configuration parameters for audio and protocol behavior. See InputParams below.

InputParams

Usage

Basic Setup

With Language Support

Accessing Call Metadata

After the AudioHook session opens, you can access call metadata from the serializer:

Setting Output Variables

Output variables are passed back to the Genesys Architect flow when the session closes, allowing your bot to influence downstream call routing and logic:

Server-Initiated Disconnect

To disconnect the session from the server side (e.g., when the bot has finished):

Event Handlers

The serializer emits an event for each AudioHook message it receives from Genesys: on_open, on_close, on_ping, on_paused, on_resumed, on_update (participant or configuration changes), on_error, and on_dtmf. Each handler receives the serializer and the Genesys message as a dict:
on_pause is also emitted when Genesys pauses the stream.
event
deprecated
Deprecated since 1.16.0, removed in 2.0.0. Use on_paused instead.

Frames

Sent to the serializer: Pushed by the serializer:

Methods

create_pause_request()

Returns a pause message asking Genesys to pause the audio stream. Genesys answers with paused, which pauses the session. Send it in an OutputTransportMessageUrgentFrame:

create_resume_request()

Returns a resume message asking Genesys to resume the audio stream. Genesys answers with resumed, which resumes the session. Send it in an OutputTransportMessageUrgentFrame, including to start a session opened with start_paused=True:

create_resumed_response()

Deprecated since 1.16.0, removed in 2.0.0. Use create_resume_request() instead.

Protocol Details

AudioHook v2 Protocol

The Genesys AudioHook protocol uses WebSocket connections with two frame types:
  • Text frames: JSON control messages for session lifecycle (open, close, ping, pause, resume, etc.)
  • Binary frames: Raw audio data in PCMU or L16 format

Message Flow

A typical session follows this sequence:
  1. Genesys connects to your WebSocket endpoint
  2. Genesys sends an open message with session metadata
  3. The serializer automatically responds with opened
  4. Bidirectional audio streaming begins via binary frames
  5. Genesys sends periodic ping messages; the serializer responds with pong
  6. When the call ends, Genesys sends close; the serializer responds with closed (including any output variables)

Audio Format

  • Default encoding: PCMU (mu-law) at 8kHz mono
  • Automatic resampling: The serializer converts between the 8kHz Genesys format and your pipeline’s sample rate using Pipecat’s built-in resampling
  • Stereo handling: When channel is set to "both", Genesys sends stereo audio with external (customer) on the left channel and internal (agent) on the right. The serializer extracts the external channel for processing.

Notes

  • Fixed packet size: Set audio_out_10ms_chunks=20 on your transport parameters. This sends outbound audio in 200 ms packets, since Genesys rate-limits incoming messages.
  • No extra dependencies: The serializer uses Pipecat’s built-in G.711 conversion functions (pcm_to_ulaw, ulaw_to_pcm in pipecat.audio.g711) and audio resampler.
  • Pause/resume: When Genesys pauses the stream (e.g., caller placed on hold) it sends paused, and the serializer drops incoming and outgoing audio until Genesys sends resumed. Use create_pause_request() and create_resume_request() to ask Genesys to pause or resume.
  • Output variables: Variables set via set_output_variables() are included in the closed response when Genesys terminates the session. These variables become available in the Architect flow for routing decisions.
  • L16 format: The serializer accepts AudioHookMediaFormat.L16 as a configuration option but drops all audio in both directions with it. Use PCMU (the default).