asterisk-rs
Async Rust clients for Asterisk AMI, AGI, and ARI.
Overview
asterisk-rs is a Rust workspace providing typed, async clients for the three
Asterisk integration interfaces. Each protocol lives in its own crate with
shared types and error handling in asterisk-rs-core.
Crates
| Crate | Description |
|---|---|
asterisk-rs |
Umbrella crate, re-exports all protocols under feature flags |
asterisk-rs-core |
Shared error types, event bus, reconnection policy |
asterisk-rs-ami |
AMI client: typed actions, events, codec, reconnection |
asterisk-rs-agi |
FastAGI server: handler trait, typed commands |
asterisk-rs-ari |
ARI client: REST + WebSocket, typed events, resource handles |
Quick Start
use AmiClient;
async
Features
- Async/await with tokio
- Typed actions, commands, and events for all three protocols
- Automatic reconnection with exponential backoff and jitter
- MD5 challenge-response authentication (AMI)
- Handle pattern for ARI resources (ChannelHandle, BridgeHandle, etc.)
- Event bus with typed pub/sub
- Structured logging via tracing
- Feature flags for granular dependency control
Protocols
| Protocol | Port | Transport | Crate |
|---|---|---|---|
| AMI | 5038 | TCP | asterisk-rs-ami |
| AGI | 4573 | TCP (FastAGI) | asterisk-rs-agi |
| ARI | 8088 | HTTP + WebSocket | asterisk-rs-ari |
MSRV
1.75
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contributing
See CONTRIBUTING.md for guidelines.