asterisk-rs-ami
Async Rust client for the Asterisk Manager Interface (AMI). Monitor calls, originate channels, manage queues, and react to real-time events over TCP.
Example
use ;
use StatusAction;
async
Capabilities
- Typed events and actions covering the full Asterisk 23 AMI surface
- Filtered subscriptions -- receive only events you care about
- Event-collecting actions --
send_collecting()gathers multi-event responses - MD5 challenge-response and plaintext authentication
- Automatic reconnection with re-authentication on every reconnect
- Command output capture for
Response: Followsresponses - Channel variable extraction --
ChanVariable(name)headers parsed into a dedicated map - Keep-alive ping loop -- configurable periodic heartbeat to detect dead connections
- Domain types for hangup causes, channel states, device states, and more
#[non_exhaustive]enums -- new variants won't break your code- Configurable timeouts, backoff, ping interval, and event buffer size
Documentation
Part of asterisk-rs. MSRV 1.83. MIT/Apache-2.0.