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