Skip to main content
Community-maintained integration. This service is built and maintained by siphon-project. Pipecat does not test or officially support it. Please report issues and request changes on the source repository. Learn more about community integrations.

Overview

SiphonFrameSerializer converts audio and control messages between Pipecat frames and the media WebSocket of the SIPhon RTP engine (siphon-rtp), an open source, self-hosted RTP engine. The engine anchors a SIP call’s RTP and dials your bot’s WebSocket once per call, so the bot is a server built on FastAPIWebsocketTransport and never handles SIP or RTP itself.

Source Repository

Source code, the README, and issues for the SIPhon integration

Example

A complete phone bot in one file, with a compose demo that places a real SIP call into it

PyPI Package

The pipecat-siphon package on PyPI

SIPhon RTP Engine

The engine, its offer profiles, and the bridge protocol

SIPhon SIP Engine

SIP proxy and B2BUA, scripted in Python, that hands calls to the RTP engine

SIPhon PBX

Extensions, queues, and call flows whose voice blocks hand calls to your bot

Installation

This is a community-maintained package distributed separately from pipecat-ai:

Prerequisites

There is no account or API key. You run the SIPhon RTP engine yourself, next to a SIP server that sends it calls, such as the SIPhon SIP engine (siphon-sip). The engine bridges a call to your bot when the call’s offer profile names a WebSocket URI:
ws_sample_rate is the rate the bot receives and sends, any multiple of 1000 Hz from 8000 to 48000, independent of the codec on the call. ws_vad has the engine report the caller’s speech, and ws_barge_in has it drop queued bot audio the moment the caller talks over it.

Configuration

SiphonFrameSerializer

str | None
default:"None"
Stream id to address control messages to before the engine’s start message arrives. Normally not needed: start is the first message on the socket and carries the id the engine assigned.
str | None
default:"None"
SIP call correlation id, for the same reason as stream_id.
SiphonFrameSerializer.InputParams | None
default:"None"
Serializer configuration. None uses SiphonFrameSerializer.InputParams(). See InputParams.

InputParams

Usage

Serve Calls from the Engine

Each WebSocket the engine opens is one call. Build a serializer and transport per connection, at the wire rate the offer profile asks for:
See the example for the full pipeline, with Whisper, an Ollama model, and Kokoro.

Hang Up the Call

Push an EndFrame (or end the worker) when the bot is done. The serializer sends stop, the engine reports the bridge ended with server_stopped, and your SIP server’s routing hangs up the call with a BYE. The README shows the routing script for the SIPhon SIP engine.

Frames

From the engine, caller audio becomes InputAudioRawFrame, speech reports become the frames speech_frames selects, and DTMF becomes InputDTMFFrame.

Notes

  • Wire rate: The engine’s start message decides the wire rate, so wire_sample_rate only covers the moment before it arrives. A rate change mid-call is followed in both directions.
  • No local VAD: With ws_vad on and speech_frames="vad", the engine detects the caller’s turns, so the pipeline needs no VAD analyzer.
  • DTMF: Digits 0 to 9, *, and # become InputDTMFFrame. A to D have no KeypadEntry, so they are logged and dropped.
  • SIPhon PBX: When a PBX flow hands the call to the bot, the package’s VoiceSession fetches a per-call brief (instructions, who is calling, where the bot may transfer them) and reports the outcome back. See the README.

Compatibility

Tested with pipecat-ai 1.17 and supported from 1.16. Check the changelog for the latest tested version.