LinuxCommandLibrary

fs_cli

Connect to a running FreeSWITCH instance

TLDR

Connect to the local FreeSWITCH instance with an interactive session

$ fs_cli
copy

Connect to a remote FreeSWITCH server
$ fs_cli [[-H|--host]] [host] [[-P|--port]] [port] [[-p|--password]] [password]
copy

Execute a single FreeSWITCH command and exit
$ fs_cli [[-x|--execute]] "[command]"
copy

Show FreeSWITCH system status
$ fs_cli [[-x|--execute]] "status"
copy

Reload FreeSWITCH XML configuration
$ fs_cli [[-x|--execute]] "reloadxml"
copy

Check if a module is loaded
$ fs_cli [[-x|--execute]] "module_exists [module_name]"
copy

Show active calls
$ fs_cli [[-x|--execute]] "show calls"
copy

Retry connection on failure
$ fs_cli [[-r|--retry]]
copy

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.

SEE ALSO

freeswitch(8), netcat(1), telnet(1)

Copied to clipboard