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.

§Upcoming changes in 0.20

The general-purpose SIP header parsing functionality has been extracted to the standalone sip-header crate. In version 0.20, module paths will change and some types will be re-exported rather than defined locally.

To prepare for 0.20, use the crate-root re-exports rather than module paths:

  • freeswitch_types::SipCallInfo instead of freeswitch_types::variables::SipCallInfo
  • freeswitch_types::SipHeaderAddr instead of freeswitch_types::sip_header_addr::SipHeaderAddr
  • freeswitch_types::HistoryInfo instead of freeswitch_types::variables::HistoryInfo
  • freeswitch_types::SipGeolocation instead of freeswitch_types::variables::SipGeolocation

Code importing these types from crate-root re-exports will continue to work across the 0.19 → 0.20 transition. Code importing from module paths may break when those modules are removed or reorganized.

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 sip_header::ParseSipHeaderError;
pub use sip_header::SipHeader;
pub use sip_header::SipHeaderLookup;
pub use sip_header_addr::ParseSipHeaderAddrError;
pub use sip_header_addr::SipHeaderAddr;
pub use sip_message::extract_header;
pub use variables::ChannelVariable;
pub use variables::EslArray;
pub use variables::HistoryInfo;
pub use variables::HistoryInfoEntry;
pub use variables::HistoryInfoError;
pub use variables::HistoryInfoReason;
pub use variables::MultipartBody;
pub use variables::MultipartItem;
pub use variables::ParseChannelVariableError;
pub use variables::SipCallInfo;
pub use variables::SipCallInfoEntry;
pub use variables::SipCallInfoError;
pub use variables::SipGeolocation;
pub use variables::SipGeolocationRef;
pub use variables::VariableName;
pub use sip_uri;

Modules§

channel
Channel-related data types extracted from ESL event headers.
commands
Command string builders for api() and bgapi().
conference_info
RFC 4575 application/conference-info+xml types and parsing.
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.
sip_header
Standard SIP header names and typed lookup trait (RFC 3261 and extensions).
sip_header_addr
RFC 3261 name-addr parser with header-level parameter support.
sip_message
RFC 3261 SIP message header extraction.
variables
Channel variable types: format parsers (ARRAY::, SIP multipart) and typed variable name enums.

Constants§

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