Expand description
Async Rust client for the Asterisk Manager Interface (AMI).
AMI is a TCP-based protocol for monitoring and controlling Asterisk PBX. This crate provides a fully async client with typed actions, events, automatic reconnection, and MD5 challenge-response authentication.
§Quick Start
use asterisk_rs_ami::AmiClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = AmiClient::builder()
.host("127.0.0.1")
.port(5038)
.credentials("admin", "secret")
.build()
.await?;
let response = client.ping().await?;
println!("pong: {:?}", response);
Ok(())
}Re-exports§
pub use client::AmiClient;pub use client::AmiClientBuilder;pub use codec::AmiCodec;pub use codec::RawAmiMessage;pub use error::AmiError;pub use event::AmiEvent;pub use response::AmiResponse;pub use response::EventListResponse;pub use response::MAX_EVENT_LIST_EVENTS;pub use tracker::CallTracker;pub use tracker::CompletedCall;