pub trait DialogApi: Send + Sync {
// Required methods
fn dialog_manager(&self) -> &Arc<DialogManager>;
async fn set_session_coordinator(
&self,
sender: Sender<SessionCoordinationEvent>,
) -> ApiResult<()>;
async fn start(&self) -> ApiResult<()>;
async fn stop(&self) -> ApiResult<()>;
async fn get_stats(&self) -> DialogStats;
}
Expand description
Shared trait for all dialog APIs
This trait provides common functionality that all dialog API implementations should support, including lifecycle management, session coordination, and basic statistics.
Required Methods§
Sourcefn dialog_manager(&self) -> &Arc<DialogManager>
fn dialog_manager(&self) -> &Arc<DialogManager>
Get access to the underlying dialog manager
Provides access to the core DialogManager for advanced operations that aren’t available through the high-level API.
Sourceasync fn set_session_coordinator(
&self,
sender: Sender<SessionCoordinationEvent>,
) -> ApiResult<()>
async fn set_session_coordinator( &self, sender: Sender<SessionCoordinationEvent>, ) -> ApiResult<()>
Set session coordinator for communication with session-core
Establishes the communication channel for session management events. This is essential for proper integration with session-core.
Sourceasync fn start(&self) -> ApiResult<()>
async fn start(&self) -> ApiResult<()>
Start the dialog API
Initializes the API for processing SIP messages and events.
Sourceasync fn stop(&self) -> ApiResult<()>
async fn stop(&self) -> ApiResult<()>
Stop the dialog API
Gracefully shuts down the API and terminates all active dialogs.
Sourceasync fn get_stats(&self) -> DialogStats
async fn get_stats(&self) -> DialogStats
Get statistics for this API instance
Returns metrics about dialog counts, call success rates, and performance.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl DialogApi for DialogClient
impl DialogApi for DialogServer
Implementation of DialogApi trait