百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

voiceblender

> AI 编程
开源

可编程语音平台: SIP 和 WebRTC 通话控制、多方混音、录音、TTS/STT 以及可插入的 AI 代理 (ElevenLabs、VAPI、Pipecat、Deepgram)

99 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

可编程语音平台: SIP 和 WebRTC 通话控制、多方混音、录音、TTS/STT 以及可插入的 AI 代理 (ElevenLabs、VAPI、Pipecat、Deepgram)

VoiceBlender

A Go service that bridges SIP and WebRTC voice calls with multi-party audio mixing, a REST API, and real-time webhooks.

Features

  • SIP inbound & outbound -- receive and originate SIP calls with codec negotiation (PCMU, PCMA, G.722, Opus, AMR-WB, AMR-NB), digest auth, session timers (RFC 4028)
  • SIP over TLS -- optional TLS transport on a second port alongside UDP, reusable by classic SIP trunks and required by WhatsApp
  • Early media -- SIP 183 Session Progress with SDP for pre-answer audio (custom ringback, IVR)
  • Hold/unhold -- SIP re-INVITE with sendonly/sendrecv direction
  • WebRTC -- browser-based voice via SDP offer/answer with trickle ICE
  • WhatsApp Business Calling -- inbound and outbound calls over SIP-TLS + ICE/DTLS-SRTP + Opus
  • WebSocket legs -- inbound (HTTP upgrade) and outbound (dial) PCM-over-WebSocket legs with binary or json_base64 framing, configurable sample rate (8/16/24/48 kHz), bidirectional text, and caller-supplied X-/P- headers — designed to also back a future generic Agent API
  • MoQ legs (experimental, PoC) -- inbound Media-over-QUIC legs over WebTransport/HTTP/3 with Opus framed one frame per MoQ Object (LOC-style). Tracks mengelbart/moqtransport (IETF draft-11); browser interop with draft-16 clients (moqtail, moq.dev) is not expected to work out of the box. Disabled by default; enable with MOQ_ENABLED=true + MOQ_TLS_CERT_FILE / MOQ_TLS_KEY_FILE
  • Multi-party rooms -- mix N participants with mixed-minus-self audio at a configurable sample rate (8 kHz, 16 kHz, or 48 kHz per room; default 16 kHz)
  • Room bridging -- join two rooms' mixers (same sample rate) with live-configurable direction (bidirectional, one-way each way, or parked); echo-free via mixed-minus-self
  • Audio routing matrix -- per-room role-based routing for asymmetric audio (barge-in / whisper / supervisor monitor). Tag legs with a free-form role and declare a matrix of who-hears-whom by role. Applied atomically at leg-join time so a supervisor cannot momentarily bleed into the customer's audio. See API.md.
  • Multi-stream SIP calls -- several m=audio sections in one dialog (RFC 3264), each with its own RTP port, direction, language and mixer room; built for live translation, where the original audio and a translated feed are mixed separately. Follows the SIPREC (RFC 7866) wire profile for interoperability. See API.md.
  • SIPREC session recording server (RFC 7865 / RFC 7866) -- accept recording sessions forked from an SBC or PBX: multipart SDP + rs-metadata INVITEs are answered receive-only on every m=audio section, and each section is bound to the participant the metadata names. The received audio is an ordinary set of leg streams, so it can be recorded to file and attached to rooms for live STT/agents. Disabled by default; enable with SIPREC_ENABLED=true (needs SIP_TCP_ENABLED=true). The metadata is checked against the SDP it arrived with, so a client that binds a participant to the wrong a=label -- a document that is otherwise valid and would silently attribute audio to the wrong party -- is reported in warnings on GET /v1/legs/{id}/siprec instead of being recorded as if it were correct. VoiceBlender can also act as the recording client, forking a room's participants to an external recording server one stream each (POST /v1/rooms/{id}/siprec, SIPREC_SRC_ENABLED=true). See API.md.
  • WebSocket room access -- join rooms from any client over a WebSocket with base64 PCM frames
  • DTMF -- send and receive RFC 4733 telephone-events
  • Real-Time Text (RTT) -- ITU-T T.140 over RTP per RFC 4103 with RFC 2198 redundancy;
  • Recording -- stereo WAV recording per-leg or per-room, multi-channel per-participant tracks, pause/resume (writes silence to preserve timeline while sensitive data is exchanged), optional S3 or Google Cloud Storage upload
  • Playback -- stream WAV/MP3 audio or built-in telephone tones into legs or rooms
  • TTS -- text-to-speech into legs or rooms (ElevenLabs, Google Cloud, AWS Polly, Deepgram, Azure), with optional preflight staging: synthesize a speculative reply off the critical path, then commit it for instant playback or discard it
  • STT -- real-time speech-to-text with partial transcripts (ElevenLabs, Deepgram, Deepgram Flux, Azure, Speechmatics). Deepgram Flux adds conversational turn detection (stt.turn), including eager end-of-turn signals for speculative generation; Speechmatics reports end-of-turn from server-side silence detection and supports mid-stream finalize
  • AI Agent -- attach a conversational AI agent to a leg or room (ElevenLabs, VAPI, Pipecat, Deepgram) with mid-session context injection
  • Answering Machine Detection (AMD) -- per-call analysis of outbound call audio to classify the answerer as human, machine, no-speech, or not-sure; optional voicemail beep detection via Goertzel frequency analysis
  • Webhooks -- real-time event delivery with HMAC-SHA256 signing and retry; a stable per-event event_id (also sent as X-Event-Id) for receiver-side deduplication; typed event data with CDR-style leg.disconnected (disposition, timing, quality)
  • WebSocket event stream (VSI) -- GET /v1/vsi streams all events and accepts commands (mute, hold, DTMF, room management) over a single persistent WebSocket; filter by app_id regex for multi-tenant isolation
  • Prometheus metrics -- operational metrics exposed at GET /metrics (active legs/rooms, call durations, disconnect reasons, event-egress drop/delivery counters, Go runtime). See API.md for the full metric reference. Profiling via go tool pprof is available at /debug/pprof/ when built with -tags pprof.

Quick Start

bash
# Build and run
go build -o voiceblender ./cmd/voiceblender
./voiceblender

# Or run directly
go run ./cmd/voiceblender

The REST API listens on :8080 and SIP on 127.0.0.1:5060 by default.

Multi-instance cluster

docker/docker-compose.cluster.yml brings up two VoiceBlender containers (dialer on host port 8080, peer on 8081) sharing the same voiceblender.env. Useful for end-to-end testing of inter-instance calls, REFER transfers, and webhook delivery between peers. Bring it up with:

bash
docker compose -f docker/docker-compose.cluster.yml up --build

Configuration

All configuration is via environment variables. The full reference — every variable, its default and behaviour, plus the S3 bucket preflight rules — lives in CONFIGURATION.md.

A ready-to-edit file with every variable is committed as voiceblender.env.example.

Online documentation:

Links

  • Website: voiceblender.org
  • Documentation: voiceblender.org/docs

API Overview

Full reference: API.md

API authentication. The HTTP surface — REST, the /v1/vsi event WebSocket, /v1/legs/websocket, the /v1/legs/moq WebTransport endpoint, /metrics, and pprof — has no built-in credential authentication (no API key, bearer token, or session). Access is gated solely by the ALLOWED_IPS allowlist and your network placement. Do not expose it to untrusted networks; front it with a reverse proxy or gateway that enforces auth if you need per-caller credentials. This is distinct from SIP-layer auth (digest challenge of inbound INVITE/REGISTER) and outbound webhook signing (WEBHOOK_SECRET), which are covered separately below.

Legs

…

Rooms

…

Events

GET    /v1/vsi                              # VoiceBlender Streaming Interface (VSI)

WebRTC

POST   /v1/webrtc/offer                    # SDP offer/answer exchange
POST   /v1/legs/{id}/ice-candidates        # Add trickle ICE candidate
GET    /v1/legs/{id}/ice-candidates        # Get gathered ICE candidates

SIP Registrations

…

Inbound INVITE and REGISTER are handled symmetrically: every inbound request is surfaced to the client (an INVITE via leg.ringing, a REGISTER via sip.registration_attempt), which may challenge it (e.g. based on its source address). VoiceBlender replies 401 with a digest WWW-Authenticate and verifies the credentialed retry itself against the supplied password/ha1. INVITE challenges target the ringing leg by id; REGISTER attempts are challenged/accepted/rejected by attempt_id.

If the client does not decide, the two differ: an unchallenged INVITE simply keeps ringing and remains answerable (nothing is auto-answered), while an undecided REGISTER falls back to SIP_INBOUND_REGISTER_DEFAULT after the consult window — reject (403) by default (fail-closed), or accept to bind it.

SIP Trunks (outbound REGISTER)

VoiceBlender can REGISTER itself to an upstream SIP registrar/PBX as a UAC, refresh the binding before expiry, place outbound calls under the registered identity, and accept inbound INVITEs the registrar delivers. Only the sip_register trunk type is implemented today; ip_ip is reserved.

POST   /v1/sip/trunks                      # Create a trunk; 202 Accepted, REGISTER runs async
GET    /v1/sip/trunks                      # List configured trunks
GET    /v1/sip/trunks/{id}                 # Trunk status snapshot (never returns password)
DELETE /v1/sip/trunks/{id}                 # Unregister + remove (202 Accepted, async)

Outbound calls placed with POST /v1/legs whose from matches a registered trunk's AOR (or AOR user-part) automatically attach the trunk's digest credentials and traverse the trunk's upstream via a Route header — the trunk's outbound_proxy when one is configured, otherwise its registrar_uri. Such calls also send From and P-Asserted-Identity in the trunk's AOR realm rather than SIP_DOMAIN, so the call claims the identity the registrar actually authenticated. An AOR port, if configured, is not carried into the From — sip:[email protected]:5070 yields a From host of pbx.example.com.

Changed outcome. This can flip how an upstream responds to calls that previously went out under SIP_DOMAIN. A registrar that accepted them un-challenged may now challenge them — which resolves on its own for a correctly provisioned trunk, since the digest credentials are already attached, but surfaces as a 401/407 failure for one with stale credentials. It can flip the other way too: a registrar that rejected an unknown From domain may now accept the call. There is no toggle. The only way to keep SIP_DOMAIN on the From is to use a from that matches no trunk AOR and no trunk AOR user-part, which also drops the trunk's credentials and Route.

Routing through an outbound proxy

By default a trunk talks straight to its registrar_uri. Set sip_register.outbound_proxy to put an SBC or edge proxy in front:

json
{
  "type": "sip_register",
  "sip_register": {
    "registrar_uri": "sip:pbx.example.com:5060",
    "outbound_proxy": "sip:edge.acme.net:5060;transport=tcp",
    "aor": "sip:[email protected]",
    "password": "s3cret"
  }
}

Every INVITE placed from that AOR then carries Route: . The REGISTER is sent to the same hop but without a pre-loaded Route — a proxy that does not recognise the Route URI as one of its own forwards the REGISTER back at itself instead of popping the header, and the registration fails with no response at all. Either way the Request-URI still names the registrar, and digest authentication still computes against it — only the next hop changes. The field defaults to SIP_OUTBOUND_PROXY and is resolved when the trunk is created, so GET /v1/sip/trunks/{id} reports the hop actually in effect.

A single call can override this with outbound_proxy on POST /v1/legs, which also wo

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goai-agentsapiasraudio-processing

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.