Module telephony

Module telephony 

Source
Expand description

§Telephony — answer the phone with a governed session

The public phone network speaks G.711 at 8 kHz; the Live API speaks PCM16 at 16/24 kHz. Between them sits exactly the plumbing voice::pump was built to carry — this module adds the telephone-side dialect:

  • g711 — μ-law and A-law codecs (pure functions, ITU-T G.711).
  • bridge — the vendor-neutral duties every connector shares: one session-state vocabulary for DTMF and call identity, and a latency-masking filler. A new transport (a platform’s gRPC virtual-agent slot, a proprietary media stream) composes these instead of re-inventing them.
  • twilio — the Twilio Media Streams protocol and TwilioCall: attach a live phone call to a session over any WebSocket server, with barge-in mapped to Twilio’s clear and DTMF digits landing in session state.

examples/telephony is the runnable end: an axum server exposing the TwiML webhook and the Media Streams WebSocket, one governed session per call.

Re-exports§

pub use twilio::Inbound;
pub use twilio::StartMeta;
pub use twilio::TWILIO_HZ;
pub use twilio::TwilioCall;
pub use twilio::TwilioError;

Modules§

bridge
Vendor-neutral call-bridge components.
g711
G.711 μ-law and A-law codecs — the audio dialect of the public phone network.
rtp
RTP (RFC 3550) — the media framing of every SIP call.
sdp
Minimal SDP (RFC 8866) offer/answer for G.711 audio calls.
sip
In-process SIP — answer raw SIP calls with no carrier service in the path.
twilio
Twilio Media Streams — a phone call as two channels of JSON text frames.