Skip to main content

Crate sipx_transport

Crate sipx_transport 

Source
Expand description

Async SIP transports.

This crate is the driver for the sans-IO core in sipx_sip: it owns sockets, connections and timers, feeds received bytes in as inputs, and performs the outputs the core asks for. It also implements the parts of real networks the RFCs leave to the implementation — received and rport for NAT, connection reuse, target resolution.

The shape of it is one event loop per endpoint, owning everything mutable. Nothing in the signalling path takes a lock, and no transaction is reachable from two tasks.

See docs/specs/sip-transport.md.

§Stability

sipx is pre-1.0, so neither word below means frozen. 1.0.0 is what freezes an API, and its predicates are in docs/roadmap.md. Until then:

  • Supported — meant to be depended on. Breaking changes get a CHANGELOG.md entry saying what to do instead. New enum variants and new struct fields may still appear in a minor release, so a downstream match should carry a _ arm.
  • Experimental — may change shape or be removed without a migration note. Depend on it only if you are prepared to follow it.

Supported. UDP, TCP, TLS and WebSocket are all in the default feature set and all carry a call. respond guarantees the response is on the wire before it returns — see docs/designs/sip-transport.md, which records that as a guarantee rather than an internal detail.

Experimental. QUIC is enabled by default so its feature-off build is continuously checked, but its SIP mapping is a sipx specification rather than an RFC. Its API and wire choices may change if a standard mapping is published; see docs/specs/sip-quic.md.

Re-exports§

pub use capture::CaptureConfig;
pub use capture::Direction;
pub use capture::HepConfig;
pub use counters::CaptureCounts;
pub use counters::Counters;
pub use counters::DiscardCounts;
pub use counters::ShedCounts;
pub use counters::TimeoutCounts;
pub use counters::TransportCounts;
pub use counters::UnsentCounts;
pub use endpoint::CancelInviteOutcome;
pub use endpoint::CancelTransactionOutcome;
pub use endpoint::CleartextTransports;
pub use endpoint::Config;
pub use endpoint::Handle;
pub use endpoint::Incoming;
pub use endpoint::InviteCancellation;
pub use endpoint::Responses;
pub use endpoint::Unmatched;
pub use endpoint::bind;
pub use endpoint::new_branch;
pub use error::Error;
pub use error::Result;
pub use overload::OverloadConfig;
pub use overload::OverloadFeedback;
pub use overload::RequestCategory;
pub use policy::ConnectionId;
pub use policy::ConnectionObservation;
pub use policy::ConnectionState;
pub use policy::EndpointObservation;
pub use policy::MessageDirection;
pub use policy::MessageObservation;
pub use policy::RequestPolicy;
pub use policy::RequestPolicyDecision;
pub use policy::RequestPolicyRef;
pub use policy::SourcePrefix;
pub use policy::TransactionClass;
pub use resolve::Naptr;
pub use resolve::Resolver;
pub use resolve::Srv;
pub use resolve::resolve;
pub use stun::Reply as StunReply;
pub use target::ConnectionKey;
pub use target::Target;
pub use target::TransportKind;
pub use tcp::Pool;
pub use tcp::PoolConfig;

Modules§

capture
Recording the signalling an endpoint exchanged, for attaching to a bug report.
counters
What a running endpoint will say about itself.
dns
A real DNS client behind the RFC 3263 Resolver trait.
endpoint
The endpoint: one event loop driving the sans-IO core.
error
Transport errors.
nat
received and rport — what makes SIP work through a NAT (RFC 3261 §18.2.1, RFC 3581).
overload
Hop-by-hop overload control (RFC 7339 and RFC 7415).
policy
Bounded endpoint observation and the two narrow policy seams.
quic
Experimental SIP-over-QUIC mapping from docs/specs/sip-quic.md.
resolve
RFC 3263: turning a SIP URI into an ordered list of places to try.
stun
A STUN Binding client, only as much of RFC 5389 as a keep-alive needs.
target
Where a message goes, and how a response finds its way back.
tcp
The TCP transport: stream framing and a connection pool.
timers
An earliest-deadline-first timer queue.
tls
SIP over TLS (RFC 3261 §26, RFC 5922).
ws
SIP over WebSocket (RFC 7118).