#[non_exhaustive]pub struct SessionState {Show 20 fields
pub channel_name: Option<String>,
pub channel_state: Option<ChannelState>,
pub call_state: Option<CallState>,
pub initial_context: Option<String>,
pub initial_destination: Option<String>,
pub initial_caller_number: Option<String>,
pub initial_caller_name: Option<String>,
pub dialplan_context: Option<String>,
pub dialplan_from: Option<String>,
pub dialplan_to: Option<String>,
pub call_direction: Option<CallDirection>,
pub caller_id_number: Option<String>,
pub caller_id_name: Option<String>,
pub destination_number: Option<String>,
pub hangup_cause: Option<HangupCause>,
pub answered_at: Option<String>,
pub other_leg_uuid: Option<String>,
pub conference: Option<ConferenceMembership>,
pub media: SessionMedia,
pub variables: HashMap<String, String>,
/* private fields */
}Expand description
Mutable per-UUID state accumulator, updated as entries are processed.
Fields are None until the corresponding data is first seen in the stream.
Variables accumulate from CHANNEL_DATA dumps, set()/export() executions,
SET/EXPORT log lines, and inline variable_* lines.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.channel_name: Option<String>None until a Channel-Name field is encountered.
channel_state: Option<ChannelState>None until a State Change line or a Channel-State field is seen.
call_state: Option<CallState>None until a Callstate Change line is seen. A distinct vocabulary from
channel_state; neither displaces the other.
initial_context: Option<String>First dialplan context seen; set once and never overwritten.
initial_destination: Option<String>Destination of the first Processing line = the dialed number at ingress;
set once and never overwritten (unlike last-wins dialplan_to).
initial_caller_number: Option<String>Number half of the first Processing line’s caller side, the caller
profile’s caller_id_number at ingress. Set once, and first seen: a
window starting mid-call pins whatever line arrived first in it.
initial_caller_name: Option<String>Name half of the first Processing line’s caller side. Set once on the
same terms as initial_caller_number, and
a rendering rather than the bytes — the line is session-bound, so the
prefix stage paired off its apostrophes and consumed its backslashes.
dialplan_context: Option<String>Current dialplan context; updated on each transfer/continue.
dialplan_from: Option<String>Caller side of the last Processing line — a number, or a display name
and number. None until one is seen.
dialplan_to: Option<String>Dialed destination of the last Processing line. None until one is seen.
call_direction: Option<CallDirection>Call direction from Call-Direction CHANNEL_DATA field; None until seen.
caller_id_number: Option<String>Caller ID number from Caller-Caller-ID-Number CHANNEL_DATA field; None until seen.
caller_id_name: Option<String>Caller ID name from Caller-Caller-ID-Name CHANNEL_DATA field; None until seen.
destination_number: Option<String>Destination number from Caller-Destination-Number CHANNEL_DATA field; None until seen.
hangup_cause: Option<HangupCause>Hangup cause extracted from ChannelLifecycle Hangup detail; None until hangup seen.
answered_at: Option<String>Timestamp when “has been answered” lifecycle event was seen; None until answered.
other_leg_uuid: Option<String>Other leg’s UUID; None until bridged. Set from Originate Resulted in Success on A-leg,
and from New Channel on B-leg (back-pointing to A-leg via originate context).
conference: Option<ConferenceMembership>Conference this session is currently a member of; None once it leaves.
media: SessionMediaCodecs negotiated on this leg, by media type and direction.
variables: HashMap<String, String>All variables learned so far, with the variable_ prefix stripped from names.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub fn variable<V: VariableName>(&self, var: V) -> Option<&str>
pub fn variable<V: VariableName>(&self, var: V) -> Option<&str>
Value of a typed channel variable, or None if this session never saw it.
Accepts any of freeswitch-types’ variable-name enums, and spares the
caller from knowing that variables keys are stored
with the variable_ prefix stripped.
Sourcepub fn caller_number(&self) -> Option<&str>
pub fn caller_number(&self) -> Option<&str>
The caller’s number, from the most trustworthy source this session saw:
the dump’s Caller-Caller-ID-Number, then sip_from_user, then the
first Processing line’s number half.
Whether a leg dumps depends on the box’s dialplan and log verbosity, so the lower rungs are what answer for the legs that never do.
Not on SessionSnapshot, which carries no variables and so cannot walk
the middle rung.
Sourcepub fn callee_number(&self) -> Option<&str>
pub fn callee_number(&self) -> Option<&str>
The dialed number, on the same terms as
caller_number: the dump’s
Caller-Destination-Number, then sip_to_user, then the first
Processing line’s destination.