Skip to main content

ringo_agent/
lib.rs

1//! Run a SIP user agent as its own process, driven over a framed stdio protocol
2//! (length-prefixed JSON control frames interleaved with raw PCM audio frames).
3//!
4//! A consumer drives an agent via [`ProcessClient`] (spawned with
5//! [`ProcessClient::spawn`]), which forks a child that re-execs the host
6//! binary's `agent` subcommand — the host wires that subcommand to
7//! [`worker::run`]. Each agent is its own process, with its own SIP socket and
8//! media stack, so several can run side by side without sharing the SIP stack's
9//! process-global state — which a single shared process can't do once incoming
10//! calls must each be routed to the right agent.
11//!
12//! Public surface: [`ProcessClient`] + [`AgentConfig`] to drive an agent,
13//! [`worker::run`] (the worker entry the host re-execs), and [`audio`] (tone
14//! analysis / WAV helpers). The framed wire protocol is an internal detail.
15
16#![warn(missing_docs)]
17
18pub mod audio;
19pub mod worker;
20// The framed wire protocol and the parent-side client are implementation
21// details: consumers drive an agent through the re-exported `ProcessClient`
22// (with `AgentConfig`), never the wire types directly.
23pub(crate) mod client;
24pub(crate) mod proto;
25
26pub use client::{ProcessClient, SavedAudio};
27pub use proto::AgentConfig;
28/// Re-exported so a consumer of [`ProcessClient::start_rx_audio`] can name the
29/// streamed frame type without also depending on `ringo-core`.
30pub use ringo_core::AudioFrame;