Freeswitch is an open-source communications platform often compared to Asterisk. Like Asterisk, it has a powerful CLI (Command-Line Interface) that allows system administrators to manage, configure, and troubleshoot the system. Here are the top 30 most frequently used FreeSWITCH CLI commands, along with explanations:
- help
Description: Displays a list of available commands in FreeSWITCH, similar to Asterisk’s core show help.
- version
Description: Displays the version of FreeSWITCH currently running. This is useful for verifying the software version in use.
- status
Description: Provides an overview of the system’s current state, including the number of active calls, uptime, and memory usage.
- show channels
Description: Displays a list of all active channels (calls) in the system. This is useful for monitoring calls and seeing what’s happening on the system in real time.
- show calls
Description: Lists all current calls, including details such as caller and callee information, start time, and call duration.
- show registrations
Description: Displays a list of all registered users (SIP endpoints). This is useful for monitoring SIP client registration status.
- show codecs
Description: Lists all available audio and video codecs that FreeSWITCH supports. This command is helpful for troubleshooting codec-related issues.
- sofia status
Description: Displays the status of the SIP profiles managed by FreeSWITCH, including the status of endpoints and their bindings.
- sofia status profile [profile_name]
Description: Provides detailed information about a specific SIP profile, such as the number of active calls, registered users, and more.
- sofia profile [profile_name] rescan
Description: Forces FreeSWITCH to rescan the specified SIP profile for new or updated registrations.
- sofia profile [profile_name] restart
Description: Restarts the specified SIP profile. Useful when you make changes to SIP configuration and need to apply them without restarting FreeSWITCH.
- reloadxml
Description: Reloads the XML configuration files (typically freeswitch.xml or dialplan.xml). This allows you to apply configuration changes without restarting the entire system.
- reload mod_sofia
Description: Reloads the SIP (mod_sofia) module. This is particularly useful after making changes to the SIP configuration without restarting the entire system.
- fsctl shutdown
Description: Shuts down FreeSWITCH cleanly, allowing it to terminate any ongoing calls gracefully.
- fsctl restart
Description: Restarts the FreeSWITCH service without killing the underlying process. This helps apply system-wide configuration changes.
- uuid_kill [uuid]
Description: Terminates a specific call by its unique identifier (UUID). This is useful for manually killing problematic or stuck calls.
- uuid_transfer [uuid] [destination]
Description: Transfers a specific call (identified by UUID) to another destination, such as another extension or phone number.
- uuid_park [uuid]
Description: Parks a specific call, allowing the user to resume it later. Parking is often used in call centers and shared phone environments.
- uuid_dump [uuid]
Description: Provides detailed information about a specific call, including all parameters and variables associated with it. Useful for troubleshooting individual call issues.
- show alias
Description: Lists all command aliases that have been defined. Aliases are shortcuts for commands, helping to streamline common operations.
- show modules
Description: Displays a list of all loaded modules. FreeSWITCH is modular, so this command is useful for verifying which modules are currently active.
- load [module_name]
Description: Loads a specific module into FreeSWITCH. Modules add functionality such as specific codecs, protocols, or features like call routing.
- unload [module_name]
Description: Unloads a specific module, effectively disabling its functionality. This is useful for troubleshooting or removing unused features.
- reload [module_name]
Description: Reloads a specific module, applying any changes made to its configuration without restarting FreeSWITCH.
- show core
Description: Provides core system information, such as the maximum number of sessions, memory usage, and CPU load.
- show channels count
Description: Displays the total number of active channels (calls) in the system, useful for high-level monitoring in busy environments.
- show endpoints
Description: Lists all endpoints currently registered with FreeSWITCH, including their protocol, IP address, and registration status.
- sofia loglevel all 9
Description: Sets the log level for SIP messages to the highest level of verbosity. This is invaluable for debugging SIP-related issues.
- sofia profile [profile_name] flush_inbound_reg
Description: Clears all inbound SIP registrations for the specified profile. This is useful for forcing SIP clients to re-register.
- originate [destination] &park()
Description: Places a call to a destination (SIP endpoint, extension, or phone number) and parks the call. This is often used in IVR systems or call centers.
Bonus Commands:
- uuid_hold [uuid]: Places a specific call on hold.
- uuid_record [uuid] start [file_path]: Starts recording a specific call and saves the recording to a file.
- uuid_record [uuid] stop: Stops recording a specific call.
- sofia profile [profile_name] register [user]: Registers a specific SIP user manually.
- sofia profile [profile_name] unregister [user]: Unregisters a specific SIP user manually.
- show calls count: Displays the total number of active calls in the system, similar to show channels count.
These commands help in managing a FreeSWITCH instance, monitoring calls, handling SIP registrations, troubleshooting, and controlling active sessions. Regularly using these commands ensures efficient management of a FreeSWITCH system and can help resolve issues more quickly.