FreeSWITCH is configured entirely through XML files that are assembled by a built-in preprocessor before being parsed. At startup, the preprocessor readsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/signalwire/freeswitch/llms.txt
Use this file to discover all available pages before exploring further.
freeswitch.xml — the root configuration file — resolves all X-PRE-PROCESS directives, expands $$variable references, and inlines every included file into a single, unified XML document. This design lets you split configuration across many small files while keeping the final structure well-defined and predictable.
Directory Layout
The canonical configuration directory is/etc/freeswitch/ on most Linux installations (the path is set at compile time via --sysconfdir). The vanilla configuration tree looks like this:
Root Configuration File
freeswitch.xml is the single entry point that the preprocessor reads. It contains no call-routing logic of its own — its job is to pull in vars.xml and then declare the four top-level sections, each of which includes its own subdirectory of XML files.
Preprocessor Directives
The FreeSWITCH preprocessor runs before the XML parser, expanding directives written either as XML processing instructions (X-PRE-PROCESS tags) or as comment-style commands (<!--#set ...-->). The two syntaxes are equivalent; the tag form is recommended because it is easier to validate.
#set / cmd="set"
Define a preprocessor variable. The value is available everywhere in the configuration as
$${variable_name}.#include / cmd="include"
Inline the contents of another file (or a glob of files) at the current position in the document.
stun-set
Like
set, but resolves the value through a STUN query first — used for NAT public IP discovery.#comment
A preprocessor-level comment. The entire directive is stripped before the XML parser sees the document.
Configuration Sections
The root<document> element contains named <section> elements. Each section corresponds to a subsystem in FreeSWITCH.
| Section | Directory | Purpose |
|---|---|---|
configuration | autoload_configs/ | Module and core configuration — one file per module |
dialplan | dialplan/ | Call-routing logic: contexts, extensions, conditions, actions |
chatplan | chatplan/ | Message-routing logic, structurally identical to dialplan |
directory | directory/ | User accounts, SIP credentials, voicemail settings |
languages | lang/ | Phrase macros, IVR prompts, TTS language packs |
autoload_configs/
Every module that FreeSWITCH loads at startup can optionally have a configuration file inautoload_configs/. The special file modules.conf.xml controls which modules are loaded — every <load module="…"/> line causes FreeSWITCH to load that shared library on start.
<!-- <load module="…"/> -->) are not loaded. To add a module, uncomment the relevant line (or add a new one) and run reloadxml followed by reload <module_name> at the FreeSWITCH console — or restart the process.
At startup, the preprocessor compiles the entire configuration tree into a single file at
$${base_dir}/log/freeswitch.xml.fsxml (typically /var/log/freeswitch/freeswitch.xml.fsxml). This file is memory-mapped by the running process. Do not edit it directly while FreeSWITCH is running. To inspect the fully expanded configuration, read this file or use the xml_locate API from the fs_cli console.