Skip to main content

flowcat_core/sip/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2//
3//! Native SIP/RTP: Flowcat speaks SIP directly (no FreeSWITCH).
4//!
5//! This module makes a `flowcat-core` process a SIP user agent on a trunk:
6//! REGISTER (with digest auth + periodic refresh), accept inbound INVITEs, and
7//! originate outbound INVITEs โ€” then carry the call's audio over hand-rolled
8//! RTP, surfaced through the same [`MediaTransport`](crate::transport::MediaTransport)
9//! seam the WS/Plivo path uses. See SIP-DESIGN.md ยง2.
10//!
11//! Split:
12//! - **Signaling** ([`agent`]) is delegated to `rsipstack` (REGISTER/INVITE/ACK/
13//!   BYE transactions + dialogs, digest auth). rsipstack re-exports the `rsip`
14//!   message/header types as `rsipstack::sip`.
15//! - **RTP** ([`rtp`]) and **SDP** ([`sdp`]) are hand-rolled (deterministic,
16//!   fully unit-tested, no extra media dep) over a plain `tokio::net::UdpSocket`.
17//! - [`transport::SipTransport`] bridges RTP โ†” decoded `MediaIn::Audio` for one
18//!   dialog, implementing [`MediaTransport`](crate::transport::MediaTransport).
19
20pub mod agent;
21pub mod rtp;
22pub mod sdp;
23pub mod transport;
24
25pub use agent::{
26    InboundInvite, SipAgent, SipConfig, DEFAULT_RTP_PORT_BASE, DEFAULT_RTP_PORT_TRIES,
27};
28pub use rtp::{depacketize, JitterBuffer, RtpPacket, RtpSender, JITTER_DEPTH};
29pub use sdp::{G711Codec, SdpMedia};
30pub use transport::SipTransport;