Skip to main content

freeswitch_types/
lib.rs

1//! FreeSWITCH protocol types: channel state, events, headers, commands, and variables.
2//!
3//! This crate provides the domain types for FreeSWITCH's Event Socket Library (ESL)
4//! protocol without any async runtime dependency. Use it standalone for CDR parsing,
5//! config generation, command building, or channel variable validation.
6//!
7//! For async ESL transport (connecting to FreeSWITCH, sending commands, receiving events),
8//! see the [`freeswitch-esl-tokio`](https://docs.rs/freeswitch-esl-tokio) crate which
9//! re-exports everything from this crate.
10
11#[macro_use]
12mod macros;
13
14pub mod channel;
15pub mod commands;
16pub mod event;
17pub mod headers;
18pub mod lookup;
19pub mod prelude;
20pub mod variables;
21
22/// Default FreeSWITCH ESL port for inbound connections.
23pub const DEFAULT_ESL_PORT: u16 = 8021;
24
25/// Default FreeSWITCH ESL password (`ClueCon`).
26pub const DEFAULT_ESL_PASSWORD: &str = "ClueCon";
27
28pub use channel::{
29    AnswerState, CallDirection, CallState, ChannelState, ChannelTimetable, HangupCause,
30    ParseAnswerStateError, ParseCallDirectionError, ParseCallStateError, ParseChannelStateError,
31    ParseHangupCauseError, ParseTimetableError, TimetablePrefix,
32};
33pub use commands::{
34    Application, BridgeDialString, DialString, DialplanType, Endpoint, GroupCallOrder, Originate,
35    OriginateError, OriginateTarget, ParseDialplanTypeError, ParseGroupCallOrderError, UuidAnswer,
36    UuidBridge, UuidDeflect, UuidGetVar, UuidHold, UuidKill, UuidSendDtmf, UuidSetVar,
37    UuidTransfer, Variables, VariablesType,
38};
39pub use event::{
40    EslEvent, EslEventPriority, EslEventType, EventFormat, ParseEventFormatError,
41    ParseEventTypeError, ParsePriorityError,
42};
43pub use headers::{normalize_header_key, EventHeader, ParseEventHeaderError};
44pub use lookup::HeaderLookup;
45pub use variables::{
46    ChannelVariable, EslArray, MultipartBody, MultipartItem, ParseChannelVariableError,
47    SipCallInfo, SipCallInfoEntry, SipCallInfoError, SipGeolocation, SipGeolocationRef,
48    VariableName,
49};