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