Overview
AcefoneFrameSerializer converts between Pipecat frames and the
Acefone
bi-directional audio streaming protocol, enabling
real-time voice agents over a websocket. It is designed to be wired into a
FastAPIWebsocketTransport so you can host a Pipecat agent on the Acefone
telephony stack and reach it over an Indian phone number.
It supports both ULAW (8kHz G.711 μ-law, the default) and PCM (16-bit linear
PCM) wire formats, DTMF keypad input, interruptions, and optional automatic call
termination over the same websocket.
Source Repository
Source code, examples, and issues for the Acefone integration
PyPI Package
The
pipecat-acefone package on PyPIAcefone
Learn about Acefone telephony and get a phone number
Protocol Docs
Acefone bi-directional audio streaming message formats
Installation
This is a community-maintained package distributed separately frompipecat-ai:
Prerequisites
To host an agent on the Acefone telephony stack you need:- An Acefone phone number: with bi-directional audio streaming enabled and pointed at your bot’s websocket endpoint.
- A public websocket endpoint: expose your bot’s websocket so Acefone can
connect to it (for example, by tunneling with
ngrokduring development).
end event. The message formats are
documented in the
Acefone bi-directional audio streaming
docs.
Configuration
AcefoneFrameSerializer takes a single, optional params argument:
AcefoneFrameSerializer.InputParams
default:"InputParams()"
Serializer input parameters, including the stream/call identifiers. See
InputParams below.
InputParams
Passed via theparams constructor argument using
AcefoneFrameSerializer.InputParams(...).
See the source repository
for the authoritative, up-to-date list of parameters and message formats.
Usage
Wire the serializer into aFastAPIWebsocketTransport. The stream_sid (and
call_sid, if you enable auto hang-up) is read from the initial websocket start
message Acefone sends when a call connects.
bot.py example, including parsing stream_sid from the initial
websocket messages and running the bot behind an ngrok tunnel.