fs_cli
Connect to a running FreeSWITCH instance
TLDR
Connect to the local FreeSWITCH instance with an interactive session
Connect to a remote FreeSWITCH server
Execute a single FreeSWITCH command and exit
Show FreeSWITCH system status
Reload FreeSWITCH XML configuration
Check if a module is loaded
Show active calls
Retry connection on failure
SYNOPSIS
fs_cli [options] [command]
PARAMETERS
-H host, --host=host
Host to connect (default: localhost)
-P port, --port=port
Event socket port (default: 8021)
-u user, --user=user
Auth username (default: freeswitch)
-p pass, --pass=pass
Auth password (default: Cliff)
-x cmd, --execute=cmd
Execute command and exit
-d, --debug
Enable debug output
--help
Show help
--version
Print version
DESCRIPTION
fs_cli provides an interactive or non-interactive command-line interface to a running FreeSWITCH server, an open-source platform for voice, video, messaging, and SIP services.
It connects via the mod_event_socket module's inbound socket (default localhost:8021) using credentials like user 'freeswitch' and password 'Cliff'.
In interactive mode, users enter commands like status, sofia status, or show channels to monitor calls, reload configs, originate calls, or debug issues.
Non-interactive mode executes a single command and exits, ideal for scripts. Debug mode logs socket communication.
Common in VoIP setups for real-time administration without restarting the server. Requires FreeSWITCH running with event_socket enabled in autoload_configs/event_socket.conf.xml.
Enhances ops with live feedback on bridges, variables, API calls, and module stats. Secure it by changing defaults and firewalling the port.
CAVEATS
Requires running FreeSWITCH with mod_event_socket loaded and inbound configured. Default creds insecure; change them. No TLS by default—use firewall. Interactive mode blocks until 'quit'.
COMMON COMMANDS
status: System uptime/channels.
version: FreeSWITCH version.
show calls: Active calls.
reloadxml: Reload config.
INTERACTIVE USAGE
Run fs_cli for shell. Type commands, end with Enter. Use help or ? for list. Exit with quit.
HISTORY
Part of FreeSWITCH since 2006 inception by Anthony Minessale. Evolved with project from 1.0 (2010) for robust CLI over event socket. Key for enterprise PBX management.


