FreeSWITCH provides two primary command-line interfaces: the interactive console that runs in the foreground alongside the process, andDocumentation 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.
fs_cli, a standalone client that connects to a running FreeSWITCH instance over the Event Socket Layer (ESL). Both give you access to the same set of API commands — the console is ideal for development and direct server access, while fs_cli is the standard tool for remote or scripted administration.
Starting FreeSWITCH
Thefreeswitch binary accepts a number of flags that control how the process starts, where it looks for configuration, and what privileges it runs under. All flags are optional; running freeswitch without arguments starts it in interactive console mode.
Run Mode Flags
-c
-nc
-ncwait
-nc, but the parent process waits until FreeSWITCH finishes startup before exiting. Useful in init scripts.-nf
Control Flags
| Flag | Description |
|---|---|
-h | Show inline help and exit. |
-version | Print the version string and exit immediately. |
-stop | Send a stop signal to a running background instance. |
-reincarnate | Automatically restart the process after an uncontrolled exit. |
-reincarnate-reexec | Like -reincarnate, but re-executes the binary via execv on restart. |
Directory Override Flags
These flags let you run multiple FreeSWITCH instances or relocate specific data directories without editing configuration files.| Flag | Description |
|---|---|
-base <dir> | Set the base prefix directory for all paths. |
-cfgname <file> | Set the pathname to the main configuration file. |
-conf <dir> | Directory for configuration files (default: /etc/freeswitch). |
-log <dir> | Directory for log files. |
-run <dir> | Directory for temporary runtime files (PID file, etc.). |
-db <dir> | Directory for internal database files. |
-mod <dir> | Directory where runtime modules are loaded from. |
-htdocs <dir> | Directory for htdocs (HTTP server). |
-scripts <dir> | Directory for call-control scripts. |
-temp <dir> | Directory for temporary files. |
-grammar <dir> | Directory for grammar files. |
-recordings <dir> | Directory for call recordings. |
-storage <dir> | Directory for voicemail storage. |
-sounds <dir> | Directory for sound/prompt files. |
Privilege and Performance Flags
| Flag | Description |
|---|---|
-u <user> | Call setuid after startup to drop root privileges to the given user. |
-g <group> | Call setgid after startup to drop root privileges to the given group. |
-rp | Enable realtime scheduling priority for the main process threads. |
-lp | Enable low scheduling priority. |
-np | Enable normal scheduling priority (explicit default). |
-vg | Run the switch process under Valgrind for memory debugging. |
-nonat | Disable the NAT detection checks performed at startup. |
-nonatmap | Disable automatic NAT port mapping. |
-nocal | Disable the system clock calibration performed at startup. |
-nort | Disable use of CLOCK_REALTIME. |
-heavy-timer | Use a more expensive but potentially more accurate system timer. |
-nosql | Disable internal SQL usage (may limit functionality). |
-core | Enable core dump generation on crash (also requires appropriate ulimit settings). |
Example: Starting in Daemon Mode
fs_cli
fs_cli is a separate binary that connects to a running FreeSWITCH instance over the Event Socket Layer on TCP port 8021. It provides the same interactive console experience — including tab completion and command history — without requiring direct access to the server process.
Connection Flags
| Flag | Description |
|---|---|
-H <host> | Hostname or IP address to connect to (default: 127.0.0.1). |
-P <port> | ESL port to connect on (default: 8021). |
-p <password> | ESL password (default: ClueCon — change this in production). |
-x <cmd> | Execute a single command non-interactively and exit. |
-q | Quiet mode — suppress banner output. |
-t <ms> | Timeout in milliseconds for ESL connection. |
Connecting to a Local Instance
Running a Single Command Non-Interactively
Essential Console Commands
The following commands work identically whether you type them at the interactive console or pass them viafs_cli -x "...".
Status and Monitoring
status — Show uptime and session counts
status — Show uptime and session counts
show channels — List active calls
show channels — List active calls
show registrations — SIP endpoint registrations
show registrations — SIP endpoint registrations
show calls — Active bridged call pairs
show calls — Active bridged call pairs
Sofia SIP Management
sofia status — SIP profile overview
sofia status — SIP profile overview
sofia status profile internal — Detailed profile info
sofia status profile internal — Detailed profile info
sofia profile internal reload — Reload a SIP profile
sofia profile internal reload — Reload a SIP profile
sofia global siptrace on — Enable SIP message tracing
sofia global siptrace on — Enable SIP message tracing
Configuration Reloading
reloadxml — Reload all XML configuration
reloadxml — Reload all XML configuration
reload command.reload <module> — Reload a specific module
reload <module> — Reload a specific module
load / unload — Load or unload a module at runtime
load / unload — Load or unload a module at runtime
modules.conf.xml to make them permanent.Call Control
originate — Create a new outbound call
originate — Create a new outbound call
uuid_kill — Hang up a call by UUID
uuid_kill — Hang up a call by UUID
show channels to find the UUID.uuid_bridge — Bridge two existing channels
uuid_bridge — Bridge two existing channels
System Control
log <level> — Set console log verbosity
log <level> — Set console log verbosity
0 silences all output; level 7 shows INFO and below; level 8 shows DEBUG.fsctl pause / fsctl resume — Pause call processing
fsctl pause / fsctl resume — Pause call processing
fsctl resume to resume.bgapi — Run a command in the background
bgapi — Run a command in the background
version — Print FreeSWITCH version
version — Print FreeSWITCH version
Console Keybindings
The defaultswitch.conf.xml defines F-key bindings available in the interactive console:
| Key | Command |
|---|---|
| F1 | help |
| F2 | status |
| F3 | show channels |
| F4 | show calls |
| F5 | sofia status |
| F6 | reloadxml |
| F7 | console loglevel 0 (silence) |
| F8 | console loglevel 7 (INFO) |
| F9 | sofia status profile internal |
| F10 | sofia profile internal siptrace on |
| F11 | sofia profile internal siptrace off |
| F12 | version |
<cli-keybindings> section of conf/autoload_configs/switch.conf.xml.