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