Expand description
Vendor-neutral call-bridge components.
Every contact-center connector — Twilio Media Streams, a raw SIP/RTP leg,
a platform’s gRPC virtual-agent slot — reduces to the same duties: move
audio frames both ways through voice::pump, land
caller keypresses and call identity in session state where flow guards
read them, and keep the caller’s ear busy while slow work runs. This
module holds those duties as small, connector-agnostic components, so a
new connector composes them instead of re-inventing them.
Nothing here owns a socket. Connectors own transport; these components own semantics.
Structs§
- Dtmf
Deduper - Deduplicates RFC 4733 end-of-event packets.
- Filler
Config - Configuration for
spawn_latency_filler.
Constants§
- KEY_
CALLER - State key holding the caller identity the transport presented
(SIP
From, a platform’s ANI field, …). - KEY_
CALL_ SID - State key holding the transport’s call identifier once known.
- KEY_
DTMF - State key holding the most recent DTMF digit pressed by the caller.
- KEY_
DTMF_ HISTORY - State key holding every DTMF digit pressed so far, concatenated in order.
- KEY_
STREAM_ SID - State key holding the transport’s media-stream identifier once known.
Functions§
- record_
dtmf - Record one DTMF keypress into session state under the shared keys.
- spawn_
latency_ filler - Keep the caller’s ear busy while the model is slow: when the caller stops
speaking (
LiveEvent::VadEnd) and no model audio arrives withinconfig.delay, inject the configured clip into the connector’s playback channel. Model audio or an interruption disarms the timer; aPlayback::Flushfrom a barge-in clears any queued filler exactly like any other queued audio.