Release Notes: v0.11.0¶
Release Date: 2026-10-27
Highlights¶
- Audio pipeline mode: the gateway hands raw call audio to your application instead of running STT, LLM, and TTS
- Safer media streams: WebSocket writes are serialized, and events after a session closes no longer panic
New Features¶
Audio Pipeline Mode¶
Set the gateway's mode to omnivoice-core's PipelineModeAudio to run no voice pipeline. The gateway still answers webhooks, connects Media Streams, and tracks the call, but your application decides when to listen and when to speak. Use it for call recording, live transcription, custom pipelines, or an agent that attends a meeting by phone and speaks only when addressed.
import coregateway "github.com/plexusone/omnivoice-core/gateway"
gw, err := gateway.New(gateway.Config{
AccountSID: os.Getenv("TWILIO_ACCOUNT_SID"),
AuthToken: os.Getenv("TWILIO_AUTH_TOKEN"),
PhoneNumber: "+14155550199",
PublicURL: "https://your-server.com",
Mode: coregateway.PipelineModeAudio,
})
sess, err := gw.MakeCallWithOptions(ctx, "+16695550100")
if err != nil {
return err
}
audio := sess.(coregateway.AudioSession)
go func() {
for chunk := range audio.ReceiveAudio() { // mu-law, 8 kHz, mono
recorder.Write(chunk)
}
}()
Sessions of an audio-mode gateway implement coregateway.AudioSession:
| Method | Behavior |
|---|---|
AudioFormat() |
Returns mu-law, 8 kHz, mono |
ReceiveAudio() |
Delivers the caller's audio; closed when the media stream stops |
SendAudio(audio) |
Sends audio to Twilio as a media message |
ClearAudio() |
Sends a clear message to drop audio not played yet |
SendAudio and ClearAudio return ErrAudioNotConnected before the media stream connects and ErrSessionClosed after the call ends. When the media stream stops, the session emits EventSessionEnded and closes. Sessions in text and realtime modes do not implement AudioSession, so the type assertion tells you which mode a gateway runs in.
Bug Fixes¶
- Concurrent WebSocket writes: media, mark, and clear messages could be written to the Media Streams WebSocket from several goroutines at once, which gorilla/websocket does not allow; writes are now serialized
- Events after close: emitting a session event after the session closed could panic with a send on a closed channel; such events are now dropped
Testing¶
- Unit tests that drive the media stream handler with simulated Twilio messages: caller audio reaches
ReceiveAudio,SendAudioandClearAudiowrite media and clear messages, and stopping the stream ends the session - Unit tests for closing an audio-mode session before the stream connects, and for text and realtime sessions not implementing
AudioSession - Tests pass under the race detector
Documentation¶
- Voice Gateway guide: audio mode added to the pipeline modes, with usage and when to use it
Dependencies¶
| Module | From | To |
|---|---|---|
github.com/plexusone/omnivoice-core |
v0.17.0 | v0.18.1 |
Installation¶
go get github.com/plexusone/[email protected]
Migration Guide¶
From v0.10.0¶
No code changes are required. Text and realtime modes are unchanged. To use audio mode, set Config.Mode to coregateway.PipelineModeAudio.
Full Changelog¶
See CHANGELOG.md for the complete list of changes.