Versions in this module Expand all Collapse all v0 v0.2.0 Jul 22, 2026 v0.1.0 Jul 22, 2026 Changes in this version + func ComputeSignature(authToken, rawURL string, params url.Values) string + func DefaultHandleStream(ctx context.Context, conn *websocket.Conn, start Frame) error + func EncodeClear(streamSID string) ([]byte, error) + func EncodeConnected() ([]byte, error) + func EncodeDTMF(streamSID, digit string) ([]byte, error) + func EncodeMark(streamSID, name string) ([]byte, error) + func EncodeMedia(streamSID string, payload []byte) ([]byte, error) + func EncodeMediaWithMetadata(streamSID string, payload []byte, chunk, seqNum int) ([]byte, error) + func EncodeStart(streamSID, callSID, accountSID string, seqNum int) ([]byte, error) + func EncodeStop(streamSID, callSID, accountSID string, seqNum int) ([]byte, error) + func HandleStreamWithOpts(ctx context.Context, conn *websocket.Conn, start Frame, ...) error + func ValidateSignature(authToken, rawURL string, params url.Values, signature string) bool + type Demux struct + Control TwilioControlPlaneInput + Data TwilioDataPlaneInput + func NewDemux() *Demux + func NewDemuxWithPlanes(data TwilioDataPlaneInput, control TwilioControlPlaneInput) *Demux + func (d *Demux) CloseData() + func (d *Demux) Route(ctx context.Context, raw []byte) error + func (d *Demux) RouteFrame(ctx context.Context, f Frame) error + type EventType string + const EventClear + const EventConnected + const EventMark + const EventMedia + const EventStart + const EventStop + type Frame struct + CallSID string + Chunk int + Event EventType + MarkName string + Payload []byte + StreamSID string + Timestamp string + func DecodeFrame(raw []byte) (Frame, error) + type InboundSMS struct + Body string + From string + MessageSID string + To string + type SMSHandler func(ctx context.Context, msg InboundSMS) + type Server struct + AuthToken string + HandleSMS SMSHandler + HandleStream StreamHandler + StreamScheme string + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) ServeSMS(w http.ResponseWriter, r *http.Request) + func (s *Server) ServeStreams(w http.ResponseWriter, r *http.Request) + type StreamHandler func(ctx context.Context, conn *websocket.Conn, start Frame) error + type Tap struct + func NewTap(dir, streamSID, callSID, label string, startedAt time.Time) *Tap + func (t *Tap) Close() + func (t *Tap) DrainOut() + func (t *Tap) WriteIn(payload []byte) + func (t *Tap) WriteOut(payload []byte) + type TeardownSignaler interface + Teardown func() <-chan struct{} + type TwilioControlPlaneInput = telephony.ServiceInput[Frame] + func NewControlPlane(depth int) TwilioControlPlaneInput + type TwilioControlPlaneOutput = telephony.ServiceOutput[telephony.ControlOutMessage] + func NewControlPlaneOutput(conn *websocket.Conn, streamSID string) TwilioControlPlaneOutput + type TwilioDataPlaneInput = telephony.ServiceInput[Frame] + func NewDataPlane(depth int) TwilioDataPlaneInput + type TwilioDataPlaneOutput = telephony.ServiceOutput[[]byte] + func NewDataPlaneOutput(conn *websocket.Conn, streamSID string, tap *Tap) TwilioDataPlaneOutput