Skip to content

Releases: Bandwidth/pipecat-bandwidth

v0.1.0

19 May 15:26
9073033

Choose a tag to compare

Initial release of pipecat-bandwidth — a Pipecat FrameSerializer for Bandwidth Programmable Voice bidirectional WebSocket media streams.

Install

pip install pipecat-bandwidth

What's in this release

  • BandwidthFrameSerializer plugs into Pipecat's FastAPIWebsocketTransport and handles Bandwidth's media-stream protocol end to end.
  • Inbound μ-law (8 kHz) decoding into Pipecat audio frames.
  • Outbound encoding for both μ-law (broadest compatibility) and linear PCM at 8/16/24 kHz (higher TTS fidelity).
  • Interruption handling via Bandwidth's clear event so the bot stops talking the moment the caller speaks.
  • Auto hang-up on EndFrame / CancelFrame via the Bandwidth Voice API, authenticated with OAuth 2.0 client credentials.
  • examples/bandwidth-chatbot — a single-file FastAPI bot demonstrating inbound-call webhook handling and a Deepgram → OpenAI → Cartesia pipeline.

Security model

The example pairs HTTP Basic Auth on the inbound voice webhook with a one-time correlation token in the BXML StartStream destination URL. This binds the WebSocket to the trusted callId / accountId from the authenticated webhook body — never from the unauthenticated WebSocket start event. Without this trust chain, any peer that reaches /ws could drive the serializer's auto-hang-up against an arbitrary call ID in your account.

BandwidthFrameSerializer also validates call_id and account_id against the RFC 3986 unreserved character set at construction time, so URL meta-characters can't slip into the auto-hang-up REST URL as query / fragment / path-traversal vectors.

Compatibility

  • Tested with Pipecat v1.1.0.
  • Python 3.11 and 3.12.