Skip to main content

Crate freeswitch_types

Crate freeswitch_types 

Source
Expand description

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 crate which re-exports everything from this crate.

§SIP header types

General-purpose SIP header parsing is provided by the sip-header crate, re-exported here for convenience. Types like SipHeaderAddr, SipCallInfo, HistoryInfo, and SipGeolocation are available from the crate root.

Re-exports§

pub use channel::AnswerState;
pub use channel::CallDirection;
pub use channel::CallState;
pub use channel::ChannelState;
pub use channel::ChannelTimetable;
pub use channel::HangupCause;
pub use channel::ParseAnswerStateError;
pub use channel::ParseCallDirectionError;
pub use channel::ParseCallStateError;
pub use channel::ParseChannelStateError;
pub use channel::ParseHangupCauseError;
pub use channel::ParseTimetableError;
pub use channel::TimetablePrefix;
pub use commands::Application;
pub use commands::BridgeDialString;
pub use commands::DialString;
pub use commands::DialplanType;
pub use commands::Endpoint;
pub use commands::GroupCallOrder;
pub use commands::Originate;
pub use commands::OriginateError;
pub use commands::OriginateTarget;
pub use commands::ParseDialplanTypeError;
pub use commands::ParseGroupCallOrderError;
pub use commands::UuidAnswer;
pub use commands::UuidBridge;
pub use commands::UuidDeflect;
pub use commands::UuidGetVar;
pub use commands::UuidHold;
pub use commands::UuidKill;
pub use commands::UuidSendDtmf;
pub use commands::UuidSetVar;
pub use commands::UuidTransfer;
pub use commands::Variables;
pub use commands::VariablesType;
pub use event::EslEvent;
pub use event::EslEventPriority;
pub use event::EslEventType;
pub use event::EventFormat;
pub use event::EventSubscription;
pub use event::EventSubscriptionError;
pub use event::ParseEventFormatError;
pub use event::ParseEventTypeError;
pub use event::ParsePriorityError;
pub use headers::normalize_header_key;
pub use headers::EventHeader;
pub use headers::ParseEventHeaderError;
pub use lookup::HeaderLookup;
pub use variables::ChannelVariable;
pub use variables::EslArray;
pub use variables::MultipartBody;
pub use variables::MultipartItem;
pub use variables::ParseChannelVariableError;
pub use variables::VariableName;
pub use sip_header;
pub use sip_header::sip_uri;

Modules§

channel
Channel-related data types extracted from ESL event headers.
commands
Command string builders for api() and bgapi().
event
ESL event types and structures
headers
Typed event header names for FreeSWITCH ESL events.
lookup
Shared trait for typed header lookups from any key-value store.
prelude
Convenience re-exports for common types and traits.
variables
Channel variable types: format parsers (ARRAY::, SIP multipart) and typed variable name enums.

Macros§

define_header_enum
Generates a non-exhaustive enum mapping Rust variants to canonical protocol strings.

Structs§

HistoryInfo
Parsed History-Info header value (RFC 7044).
HistoryInfoEntry
A single entry from a History-Info header (RFC 7044).
HistoryInfoReason
Parsed RFC 3326 Reason header value extracted from a History-Info URI.
ParseSipHeaderAddrError
Error returned when parsing a SIP header address value fails.
ParseSipHeaderError
Error returned when parsing an unrecognized SIP header name.
SipCallInfo
Parsed SIP Call-Info header value. Contains zero or more entries.
SipCallInfoEntry
One entry from a SIP Call-Info header: <uri>;key=value;key=value.
SipGeolocation
Parsed SIP Geolocation header value (RFC 6442).
SipHeaderAddr
Parsed SIP name-addr (RFC 3261 §25.1) with header-level parameters.

Enums§

HistoryInfoError
Errors from parsing a History-Info header value (RFC 7044).
SipCallInfoError
Errors from parsing a SIP Call-Info header value.
SipGeolocationRef
A reference extracted from a SIP Geolocation header (RFC 6442).
SipHeader
Standard SIP header names with canonical wire casing.

Constants§

DEFAULT_ESL_PASSWORD
Default FreeSWITCH ESL password (ClueCon).
DEFAULT_ESL_PORT
Default FreeSWITCH ESL port for inbound connections.

Traits§

SipHeaderLookup
Trait for looking up standard SIP headers from any key-value store.

Functions§

extract_header
Extract a header value from a raw SIP message.