eslrs is a pure Rust implementation of libesl, FreeSWITCH™'s Event Socket Library.
Features
- Async: Built on tokio for high-performance async I/O
- Inbound and Outbound: Support for both ESL connection modes
- Multiple Event Formats: JSON, plain text, and XML event parsing
- Instrumentation: Optional tracing/logging integration
Quick Start
Add eslrs as dependency and enable the json feature if planning to use json events.
= { = "0.1", = ["json"] }
Inbound and Outbound APIs
Inbound
use ;
async
Outbound
use ;
use TcpListener;
async
Logging and Tracing
The main api of the esl connection have been instrumented to feed into either logging or tracing eco-systems. The tracing feature is enabled by default, logging requires manual inclusion.
2025-10-23T14:57:21.225778Z INFO tracing_example: Connecting to FreeSWITCH at 0.0.0.0:8021
2025-10-23T14:57:21.839107Z INFO send_recv{command="auth ClueCon"}: eslrs::connection: return=Reply(RawEvent { headers: {"Content-Type": "command/reply", "Reply-Text": "+OK accepted"}, body: None })
2025-10-23T14:57:21.839399Z INFO recv: eslrs::connection: return=Event(headers={"Content-Type": "auth/request"})