pipecat-didlogic
DIDLogic WebSocket call support for Pipecat.
DidlogicFrameSerializer converts between Pipecat audio frames and the DIDLogic
voice-stream protocol, so a Pipecat bot can take a call on a DIDLogic number — or
be the agent leg of an outbound call — and speak on it.
Maintained by DIDLogic. We run the platform this talks to.
What it handles
- Audio both ways. PCM16 at 24 kHz in 10 ms frames, base64-encoded inside JSON messages, resampled to and from whatever rate your pipeline runs at.
- Inbound and outbound calls. The serializer reads the
startmessage off the socket, so the call id, the two numbers and the direction do not have to be known before the pipeline is built. - DTMF, delivered to the pipeline as
InputDTMFFrame. - Interruptions, by sending
clearso the platform drops audio it has buffered but not yet played. - Hanging up, by sending
hanguponEndFrameorCancelFrame. No credentials needed — it is one more message on the socket that is already open. answered, surfaced as anInputTransportMessageFrame. On an outbound call the platform answers your leg as soon as it has sentstart, which is before the person has picked up;answeredis what says they are there.
The protocol itself is documented at docs.didlogic.com.
Install
uv add pipecat-didlogic
or:
pip install pipecat-didlogic
Tested with Pipecat 1.12.0.
Use with a Pipecat pipeline
The serializer goes on the WebSocket transport's params. Telephony audio carries
no WAV header, so add_wav_header must be False:
from pipecat.transports.websocket.fastapi import (
FastAPIWebsocketParams,
FastAPIWebsocketTransport,
)
from pipecat_didlogic import DidlogicFrameSerializer
transport = FastAPIWebsocketTransport(
websocket=websocket,
params=FastAPIWebsocketParams(
audio_in_enabled=True,
audio_out_enabled=True,
add_wav_header=False,
vad_analyzer=SileroVADAnalyzer(),
serializer=DidlogicFrameSerializer(),
),
)
That is the whole integration. Everything else in the pipeline — STT, LLM, TTS — is ordinary Pipecat.
Options
DidlogicFrameSerializer(
DidlogicFrameSerializer.InputParams(
didlogic_sample_rate=24000, # what the platform sends and expects
sample_rate=None, # override the pipeline input rate
auto_hang_up=True, # send hangup on EndFrame / CancelFrame
)
)
Pass call_id, from_number, to_number or direction to the constructor if
your server reads start before building the serializer. Leave them unset and
all four are learned from start.
Waiting for an outbound call to be picked up
On an outbound call the platform answers your leg as soon as it has sent start,
which is before the customer's phone has rung. Greeting on connect means talking
to an empty line, so wait for answered:
from pipecat.frames.frames import InputTransportMessageFrame, LLMRunFrame
from pipecat.processors.frame_processor import FrameProcessor
class GreetWhenAnswered(FrameProcessor):
async def process_frame(self, frame, direction):
await super().process_frame(frame, direction)
if (
isinstance(frame, InputTransportMessageFrame)
and frame.message.get("event") == "answered"
):
await self.push_frame(LLMRunFrame())
await self.push_frame(frame, direction)
Put it directly after transport.input(). The outbound example below does this.
Examples
examples/ has two complete bots, each self-contained with its own
dependencies and setup instructions:
examples/inbound/— a bot that answers calls to one of your numbers.examples/outbound/— a bot that places the call through Click2Call and waits foransweredbefore speaking.
Each runs with uv sync && uv run server.py in its own directory. Both need a
public wss:// address, because the platform dials your endpoint rather than the
other way round.
WebSocket destinations and a_type: stream are enabled per account. If the
destination type is absent from the portal, or the API answers
422 a_type_unsupported, ask support to turn on voice streaming for your account.
Development
uv sync --extra dev
uv run pytest
uv run ruff check .
uv run ruff format --check .
License
BSD 2-Clause. See LICENSE.
Metadata
Release files for pipecat-didlogic 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pipecat_didlogic-1.0.1.tar.gz | 12.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pipecat_didlogic-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.5 kB
Release files / pipecat_didlogic-1.0.1.tar.gz
| Download URL | pipecat_didlogic-1.0.1.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
167e0655223cd2afc8bb062c782d43680678e237fa906907c9fae93ee78e2b97
|
|
BLAKE2b-256 checksum How to use checksums |
cb3d2fccb69d6cb0d7fab3e5d7639f26c748477a55bb337af1efafa77f1133c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency logRelease files / pipecat_didlogic-1.0.1-py3-none-any.whl
| Download URL | pipecat_didlogic-1.0.1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b542379b1f139974de382582cffb7c796989574fea7c7a005d8b0b9f370744e8
|
|
BLAKE2b-256 checksum How to use checksums |
13f74d66fdfe7238581363b4942f05efab00f44ef737a63332754c2298ddc880
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.
Transparency log