pub struct SipFlow { /* private fields */ }Expand description
Cloneable handle to the signaling recorder. Implements
MessageInspector, recording every message and passing it through to
the next inspector in the chain unmodified.
Implementations§
Source§impl SipFlow
impl SipFlow
pub fn new( config: SipFlowConfig, local_addr: String, next: Option<Box<dyn MessageInspector>>, ) -> Self
Sourcepub fn local_addr(&self) -> &str
pub fn local_addr(&self) -> &str
The local address recorded as the near end of each flow.
Sourcepub fn set_next(&self, next: Option<Box<dyn MessageInspector>>)
pub fn set_next(&self, next: Option<Box<dyn MessageInspector>>)
Chains the next inspector behind this recorder (used by
AppStateBuilder when this recorder is injected instead of built
from config, where the rest of the inspector chain only exists at
build time).
Sourcepub fn dropped_count(&self) -> u64
pub fn dropped_count(&self) -> u64
Total messages dropped due to the per-Call-ID cap.
Sourcepub fn tracked_calls(&self) -> usize
pub fn tracked_calls(&self) -> usize
Number of Call-IDs currently tracked.
Sourcepub fn associate(&self, session_id: &str, call_id: &str)
pub fn associate(&self, session_id: &str, call_id: &str)
Associates a SIP Call-ID with a session so the callrecord hook can merge all of a session’s dialogs (REFER transfers included) into one JSONL. Called at dialog creation points: incoming INVITE accept and every outgoing INVITE (bridge leg, transfer leg, dial-out).
Sourcepub fn get_session_call_ids(&self, session_id: &str) -> Vec<String>
pub fn get_session_call_ids(&self, session_id: &str) -> Vec<String>
All Call-IDs associated with a session (may be empty when capture is disabled or the session never had a SIP dialog).
Sourcepub fn query_flow(
&self,
call_id: &str,
start_us: u64,
end_us: u64,
) -> Vec<SipFlowItem>
pub fn query_flow( &self, call_id: &str, start_us: u64, end_us: u64, ) -> Vec<SipFlowItem>
Captured items for one Call-ID within [start_us, end_us] (unix
microseconds, inclusive bounds like the time window slack).
Sourcepub fn evict(&self, session_id: &str, call_ids: &[String])
pub fn evict(&self, session_id: &str, call_ids: &[String])
Drops the flows and associations of a finished session (called by the upload hook after export/upload so memory does not grow unbounded).
Sourcepub fn export_jsonl(items: &[SipFlowItem]) -> String
pub fn export_jsonl(items: &[SipFlowItem]) -> String
Serializes items as JSONL (one JSON object per line), the wire format
uploaded at call end. Items are expected pre-sorted by
(timestamp, seq).
Trait Implementations§
Source§impl MessageInspector for SipFlow
impl MessageInspector for SipFlow
fn before_send(&self, msg: SipMessage, dest: Option<&SipAddr>) -> SipMessage
fn after_received(&self, msg: SipMessage, from: Option<&SipAddr>) -> SipMessage
Auto Trait Implementations§
impl Freeze for SipFlow
impl RefUnwindSafe for SipFlow
impl Send for SipFlow
impl Sync for SipFlow
impl Unpin for SipFlow
impl UnsafeUnpin for SipFlow
impl UnwindSafe for SipFlow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more