//! FreeSWITCH protocol types: channel state, events, headers, commands, and variables.
//!
//! This crate provides the domain types for FreeSWITCH's Event Socket Library (ESL)
//! protocol without any async runtime dependency. Use it standalone for CDR parsing,
//! config generation, command building, or channel variable validation.
//!
//! For async ESL transport (connecting to FreeSWITCH, sending commands, receiving events),
//! see the [`freeswitch-esl-tokio`](https://docs.rs/freeswitch-esl-tokio) crate which
//! re-exports everything from this crate.
//!
//! # SIP header types
//!
//! General-purpose SIP header parsing is provided by the
//! [`sip-header`](https://docs.rs/sip-header) crate, re-exported here for convenience.
//! Types like [`SipHeaderAddr`], [`SipCallInfo`], [`HistoryInfo`], and [`SipGeolocation`]
//! are available from the crate root.

pub use sip_header;
pub use sip_header::define_header_enum;
pub use sip_header::sip_uri;

pub mod channel;
#[cfg(feature = "esl")]
pub mod commands;
#[cfg(feature = "esl")]
pub mod event;
pub mod headers;
pub mod lookup;
pub mod prelude;
pub mod sofia;
pub mod variables;

/// Default FreeSWITCH ESL port for inbound connections.
pub const DEFAULT_ESL_PORT: u16 = 8021;

/// Default FreeSWITCH ESL password (`ClueCon`).
pub const DEFAULT_ESL_PASSWORD: &str = "ClueCon";

pub use channel::{
    AnswerState, CallDirection, CallState, ChannelState, ChannelTimetable, HangupCause,
    ParseAnswerStateError, ParseCallDirectionError, ParseCallStateError, ParseChannelStateError,
    ParseHangupCauseError, ParseTimetableError, TimetablePrefix,
};
#[cfg(feature = "esl")]
pub use commands::{
    Application, BridgeDialString, DialString, DialplanType, Endpoint, GroupCallOrder, Originate,
    OriginateError, OriginateTarget, ParseDialplanTypeError, ParseGroupCallOrderError, UuidAnswer,
    UuidBridge, UuidDeflect, UuidGetVar, UuidHold, UuidKill, UuidSendDtmf, UuidSetVar,
    UuidTransfer, Variables, VariablesType,
};
#[cfg(feature = "esl")]
pub use event::{
    EslEvent, EslEventPriority, EslEventType, EventFormat, EventSubscription,
    EventSubscriptionError, ParseEventFormatError, ParseEventTypeError, ParsePriorityError,
};
pub use headers::{normalize_header_key, EventHeader, ParseEventHeaderError};
pub use lookup::HeaderLookup;
pub use sip_header::{
    extract_header, HistoryInfo, HistoryInfoEntry, HistoryInfoError, HistoryInfoReason,
    ParseSipHeaderAddrError, ParseSipHeaderError, SipCallInfo, SipCallInfoEntry, SipCallInfoError,
    SipGeolocation, SipGeolocationRef, SipHeader, SipHeaderAddr, SipHeaderLookup,
};
pub use sofia::{
    GatewayPingStatus, GatewayRegState, ParseGatewayPingStatusError, ParseGatewayRegStateError,
    ParseSipUserPingStatusError, ParseSofiaEventSubclassError, SipUserPingStatus,
    SofiaEventSubclass,
};
pub use variables::{
    ChannelVariable, CoreMediaVariable, EslArray, MultipartBody, MultipartItem,
    ParseChannelVariableError, ParseCoreMediaVariableError, RtpStatUnit, SipHeaderPrefix,
    SipPassthroughHeader, VariableName,
};
