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