FreeSWITCH CLI (fs_cli)
The FreeSWITCH Command Line Interface (fs_cli) is a powerful tool for interacting with and managing your FreeSWITCH instance. It allows administrators and developers to execute commands, monitor system status, and troubleshoot issues related to SIP communication, call handling, and overall FreeSWITCH functionality.
Manage SIP Registrations with fs_cli
fs_cli is essential for managing SIP endpoints. You can verify user registrations, check the status of SIP profiles, and even enable or disable them as needed for maintenance or troubleshooting.
# List all registered SIP endpoints for a specific profile
fs_cli -x "sofia status profile <profile_name> reg"
# List all active SIP profiles
fs_cli -x "sofia status"
# Disable a specific SIP profile
fs_cli -x "sofia profile <profile_name> shutdown"
# Enable a specific SIP profile
fs_cli -x "sofia profile <profile_name> start"
Control and Monitor SIP Calls
Beyond registration, fs_cli provides capabilities to monitor active calls and manage them directly. This is crucial for real-time call management and diagnostics.
# Show active SIP calls
fs_cli -x "show calls"
# Hang up a specific SIP call using its UUID
fs_cli -x "uuid_kill <call_uuid>"
Advanced SIP Troubleshooting with fs_cli
For in-depth analysis of SIP communication, fs_cli allows you to initiate SIP tracing and reload configurations without interrupting service.
# Start a SIP trace for a specific profile with detailed logging
fs_cli -x "sofia tracelevel <profile_name> 9"
# Reload SIP configurations without restarting FreeSWITCH
fs_cli -x "reload mod_sofia"
Starting FreeSWITCH and Interacting with the Console
You can start FreeSWITCH with specific configurations and then connect to its console for interactive command execution.
# Start FreeSWITCH with a custom configuration directory
freeswitch -conf /path/to/configuration
# Connect to the FreeSWITCH console for interactive commands
fs_cli
The FreeSWITCH CLI is an indispensable tool for anyone managing or developing with FreeSWITCH, offering granular control over SIP and call functionalities.