pub struct AppStateInner {Show 21 fields
pub config_path: Option<Arc<str>>,
pub token: CancellationToken,
pub stream_engine: Arc<StreamEngine>,
pub callrecord_sender: Option<CallRecordSender>,
pub endpoint: Endpoint,
pub registration_handles: Mutex<HashMap<String, CancellationToken>>,
pub alive_users: Arc<RwLock<HashSet<String>>>,
pub dialog_layer: Arc<DialogLayer>,
pub create_invitation_handler: Option<FnCreateInvitationHandler>,
pub invitation: Invitation,
pub routing_state: Arc<RoutingState>,
pub pending_playbooks: Arc<Mutex<HashMap<String, (String, Instant)>>>,
pub sip_flow: Option<Arc<SipFlow>>,
pub learned_public_address: SharedPublicAddress,
pub learned_peers: SharedLearnedPeers,
pub refer_header_resolver: Option<Arc<dyn ReferHeaderResolver>>,
pub active_calls: Arc<Mutex<HashMap<String, ActiveCallRef>>>,
pub total_calls: AtomicU64,
pub total_failed_calls: AtomicU64,
pub uptime: DateTime<Local>,
pub shutting_down: Arc<AtomicBool>,
/* private fields */
}Fields§
§config_path: Option<Arc<str>>Path recorded at startup; used by the reload endpoint and the watcher.
token: CancellationToken§stream_engine: Arc<StreamEngine>§callrecord_sender: Option<CallRecordSender>§endpoint: Endpoint§registration_handles: Mutex<HashMap<String, CancellationToken>>§alive_users: Arc<RwLock<HashSet<String>>>§dialog_layer: Arc<DialogLayer>§create_invitation_handler: Option<FnCreateInvitationHandler>§invitation: Invitation§routing_state: Arc<RoutingState>§pending_playbooks: Arc<Mutex<HashMap<String, (String, Instant)>>>§sip_flow: Option<Arc<SipFlow>>In-process SIP signaling capture (crate::sipflow); None when
the [sipflow] section is absent/disabled.
learned_public_address: SharedPublicAddress§learned_peers: SharedLearnedPeersPeer source addresses learned from call traffic, used by the OPTIONS
ACL ([options_response]).
refer_header_resolver: Option<Arc<dyn ReferHeaderResolver>>Optional hook that rewrites the custom headers an incoming REFER
carries onto the transfer INVITE; None forwards them unchanged.
active_calls: Arc<Mutex<HashMap<String, ActiveCallRef>>>§total_calls: AtomicU64§total_failed_calls: AtomicU64§uptime: DateTime<Local>§shutting_down: Arc<AtomicBool>Implementations§
Source§impl AppStateInner
impl AppStateInner
pub fn auto_learn_public_address_enabled(&self) -> bool
Sourcepub fn options_source_allowed(
&self,
source_ip: Option<IpAddr>,
source_host: &str,
) -> bool
pub fn options_source_allowed( &self, source_ip: Option<IpAddr>, source_host: &str, ) -> bool
Whether an OPTIONS probe from source_ip/source_host (as extracted
from the top Via header) should be answered: the source must match the
static ACL, a registered-server host, or a peer address learned from
call traffic within the configured TTL.
pub fn get_dump_events_file(&self, session_id: &String) -> String
pub fn get_recorder_file(&self, session_id: &String) -> String
pub async fn serve(self: Arc<Self>) -> Result<()>
pub fn stop(&self)
pub async fn graceful_stop(&self, total_timeout_secs: u64) -> Result<()>
pub async fn start_registration(&self) -> Result<usize>
pub fn find_credentials_for_callee( &self, callee: &str, ) -> Option<UserCredential>
pub async fn stop_registration( &self, wait_for_clear: Option<Duration>, ) -> Result<()>
pub async fn register(&self, option: RegisterOption) -> Result<()>
Source§impl AppStateInner
impl AppStateInner
Sourcepub fn config(&self) -> Arc<Config> ⓘ
pub fn config(&self) -> Arc<Config> ⓘ
Current config snapshot. Cheap (Arc clone); call sites that make
several decisions from one consistent view should bind it first.
Sourcepub fn config_path(&self) -> Option<&str>
pub fn config_path(&self) -> Option<&str>
Path of the config file this process was started with, if any.
Sourcepub async fn reload_from_disk(&self) -> Result<ReloadReport, ReloadError>
pub async fn reload_from_disk(&self) -> Result<ReloadReport, ReloadError>
Re-read the config file recorded at startup and apply it.
Sourcepub fn preview_config(&self, proposed: Config) -> ReloadReport
pub fn preview_config(&self, proposed: Config) -> ReloadReport
Validate a proposed snapshot without installing it (mode=check).
Sourcepub fn apply_config(&self, proposed: Config) -> ReloadReport
pub fn apply_config(&self, proposed: Config) -> ReloadReport
Validate and install a new config snapshot.
Applying is atomic: the snapshot is swapped in one store, after which
the module switches and the media cache directory are re-derived. The
report classifies every changed top-level section so the caller can see
which changes are live (applied), which wait for the next call
(deferred) and which need a restart (requires_restart).
Trait Implementations§
Source§impl Drop for AppStateInner
impl Drop for AppStateInner
Auto Trait Implementations§
impl !Freeze for AppStateInner
impl !RefUnwindSafe for AppStateInner
impl !UnwindSafe for AppStateInner
impl Forget for AppStateInner
impl Move for AppStateInner
impl Send for AppStateInner
impl Sync for AppStateInner
impl Unpin for AppStateInner
impl UnsafeUnpin for AppStateInner
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<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