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 variables;
20
21/// Default FreeSWITCH ESL port for inbound connections.
22pub const DEFAULT_ESL_PORT: u16 = 8021;
23
24/// Default FreeSWITCH ESL password (`ClueCon`).
25pub const DEFAULT_ESL_PASSWORD: &str = "ClueCon";
26
27pub use channel::{
28    AnswerState, CallDirection, CallState, ChannelState, ChannelTimetable, HangupCause,
29    ParseAnswerStateError, ParseCallDirectionError, ParseCallStateError, ParseChannelStateError,
30    ParseHangupCauseError, ParseTimetableError, TimetablePrefix,
31};
32pub use commands::{
33    Application, BridgeDialString, DialString, DialplanType, Endpoint, GroupCallOrder, Originate,
34    OriginateError, OriginateTarget, ParseDialplanTypeError, ParseGroupCallOrderError, UuidAnswer,
35    UuidBridge, UuidDeflect, UuidGetVar, UuidHold, UuidKill, UuidSendDtmf, UuidSetVar,
36    UuidTransfer, Variables, VariablesType,
37};
38pub use event::{
39    EslEvent, EslEventPriority, EslEventType, EventFormat, ParseEventFormatError,
40    ParseEventTypeError, ParsePriorityError,
41};
42pub use headers::{EventHeader, ParseEventHeaderError};
43pub use lookup::HeaderLookup;
44pub use variables::{
45    ChannelVariable, EslArray, MultipartBody, MultipartItem, ParseChannelVariableError,
46    SipCallInfo, SipCallInfoEntry, SipCallInfoError, SipGeolocation, SipGeolocationRef,
47    VariableName,
48};