Skip to main content

Chapter 31: CLI and API Command Reference

FreeSWITCH exposes its entire runtime API through two interfaces that share the same command set: the interactive fs_cli console and the Event Socket. Any command entered at the fs_cli prompt can be sent verbatim over the Event Socket using the api or bgapi method, making this reference applicable to both surfaces.

This chapter covers the operator-facing command set. FreeSWITCH registers over 150 API commands in total; the commands documented here are the ones operators use for daily administration, call control, and configuration management.

Connecting with fs_cli

fs_cli is the standard interactive client for the FreeSWITCH Event Socket interface. It connects to the address and port defined in event_socket.conf.xml. The default listen address is :: (all interfaces), the default port is 8021, and the default password is ClueCon.

Common connection flags:

FlagPurpose
-H <host>Event Socket host (default: localhost)
-P <port>Event Socket port (default: 8021)
-p <password>Event Socket password
-x <command>Execute a single command and exit
-qQuiet mode; suppress log output

Example invocation connecting to a non-default host:

fs_cli -H 192.0.2.10 -P 8021 -p ClueCon

Commands issued at the fs_cli prompt are sent to the FreeSWITCH process as API calls over the Event Socket. The same commands work identically when sent via the Event Socket from an external application using api <command> [args].


Status and Inspection

These commands return runtime state information about the FreeSWITCH process and its active sessions.

CommandPurposeSyntax
statusShow overall system status: uptime, session count, and rate statisticsstatus
versionReport the FreeSWITCH version stringversion [short]
uptimeReport process uptime in a specified unituptime [us|ms|s|m|h|d|microseconds|milliseconds|seconds|minutes|hours|days]
show channelsList active channelsshow channels [count|like <match>]
show callsList active callsshow calls [count]
show detailed_callsList active calls with extended field detailshow detailed_calls
show bridged_callsList calls that are currently bridgedshow bridged_calls
show detailed_bridged_callsList bridged calls with extended field detailshow detailed_bridged_calls
show registrationsList current SIP registrationsshow registrations
show modulesList loaded modulesshow modules
show interfacesList registered interfacesshow interfaces
show interface_typesList registered interface type groupsshow interface_types
show tasksList scheduled tasksshow tasks
show codecList registered codecsshow codec
show endpointList registered endpointsshow endpoint
show applicationList registered dialplan applicationsshow application
show apiList registered API commandsshow api
show limitsShow limit backend usageshow limits
hostnameReturn the system hostnamehostname
switchnameReturn the configured switch nameswitchname
host_lookupResolve a hostname to an IP addresshost_lookup <hostname>
gethostResolve a hostname using gethostbynamegethost <hostname>
uuid_existsCheck whether a channel UUID is currently activeuuid_exists <uuid>
uuid_dumpDump all variables and state for a sessionuuid_dump <uuid> [format]
uuid_buglistList active media bugs on a sessionuuid_buglist <uuid>

The show command accepts the full subject list from source:

codec|endpoint|application|api|dialplan|file|timer|calls [count]|
channels [count|like <match string>]|calls|detailed_calls|bridged_calls|
detailed_bridged_calls|aliases|complete|chat|management|modules|
nat_map|say|interfaces|interface_types|tasks|limits|status

Directory and Interface Lookups

These commands query the XML user directory, check for the existence of modules and files, and resolve interface addresses. They are commonly used from scripts and the dialplan to make routing decisions.

CommandPurposeSyntax
list_usersList users configured in the directory, optionally filtered by group, domain, user, or contextlist_users [group <group>] [domain <domain>] [user <user>] [context <context>]
user_existsTest whether a user matches a directory key/value (returns true/false)user_exists <key> <user> <domain>
user_dataReturn a variable, parameter, or attribute value for a directory useruser_data <user>@<domain> [var|param|attr] <name>
domain_existsTest whether a domain is configured in the directory (returns true/false)domain_exists <domain>
domain_dataReturn a variable, parameter, or attribute value for a directory domaindomain_data <domain> [var|param|attr] <name>
module_existsTest whether a module is loaded (returns true/false)module_exists <module>
file_existsTest whether a file exists on the server filesystem (returns true/false)file_exists <file>
interface_ipReturn the primary IP address of a named network interfaceinterface_ip [auto|ipv4|ipv6] <ifname>

Notes on user_exists:

The <key> argument selects which directory field is matched against <user>, for example id to match on the user ID.

Notes on interface_ip:

ipv4 and ipv6 force the address family; auto returns whichever family is available for the interface named by <ifname>.


Call Control

These commands act on active channels, identified by their UUID. Obtain UUIDs from show channels or show calls.

CommandPurposeSyntax
originateOriginate an outbound call legoriginate <call_url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]
uuid_bridgeBridge two existing channel legs togetheruuid_bridge <uuid> <other_uuid>
uuid_killTerminate a channel, optionally specifying a hangup causeuuid_kill <uuid> [cause]
uuid_transferTransfer a channel to a dialplan extensionuuid_transfer <uuid> [-bleg|-both] <dest-exten> [<dialplan>] [<context>]
uuid_dual_transferTransfer a call and its partner leg simultaneouslyuuid_dual_transfer <uuid> <A-dest-exten>[/<A-dialplan>][/<A-context>] <B-dest-exten>[/<B-dialplan>][/<B-context>]
uuid_holdPlace or release a call hold on a channeluuid_hold [off|toggle] <uuid> [<display>]
uuid_parkPark a channeluuid_park <uuid>
uuid_answerAnswer an unanswered channeluuid_answer <uuid>
uuid_pre_answerPre-answer a channel (183 Session Progress)uuid_pre_answer <uuid>
uuid_ring_readySend ringing to a channeluuid_ring_ready <uuid> [queued]
uuid_setvarSet a channel variable on a sessionuuid_setvar <uuid> <var> [value]
uuid_setvar_multiSet multiple channel variables in one calluuid_setvar_multi <uuid> <var>=<value>;<var>=<value>...
uuid_getvarRetrieve the value of a channel variableuuid_getvar <uuid> <var>
uuid_dumpDump all variables and state for a sessionuuid_dump <uuid> [format]
uuid_broadcastExecute a dialplan application on a channeluuid_broadcast <uuid> <path> [aleg|bleg|holdb|both]
uuid_recordStart, stop, mask, or unmask session audio recordinguuid_record <uuid> [start|stop|mask|unmask] <path> [<limit>] [<recording_vars>]
uuid_displaceInject or remove an audio file on a channeluuid_displace <uuid> [start|stop] <path> [<limit>] [mux]
uuid_audioMute or adjust audio level on a channeluuid_audio <uuid> [start [read|write] [mute|level <level>]|stop]
uuid_pausePause or resume media on a channeluuid_pause <uuid> <on|off>
uuid_breakBreak out of the current application blocking a channeluuid_break <uuid> [all]
breakAlias for uuid_breakbreak <uuid> [all]
uuid_send_dtmfSend DTMF digits to a channeluuid_send_dtmf <uuid> <dtmf_data>
uuid_recv_dtmfInject received DTMF digits into a channeluuid_recv_dtmf <uuid> <dtmf_data>
uuid_flush_dtmfFlush buffered DTMF from a channeluuid_flush_dtmf <uuid>
uuid_mediaReinvite FreeSWITCH in or out of the media pathuuid_media [off] <uuid>
uuid_media_3pReinvite FreeSWITCH in or out of the media path using 3PCC (third-party call control)uuid_media_3p [off] <uuid>
uuid_media_renegTrigger a media renegotiation on a channeluuid_media_reneg <uuid>[ <codec_string>]
uuid_deflectSend a SIP REFER to redirect a calluuid_deflect <uuid> <uri>
uuid_redirectSend a SIP redirect responseuuid_redirect <uuid> <uri>
uuid_displayUpdate the phone display for a registered deviceuuid_display <uuid> <display>
uuid_loglevelSet the log level for a specific sessionuuid_loglevel <uuid> <level>
uuid_jitterbufferEnable or configure the jitter buffer on a channeluuid_jitterbuffer <uuid> [0|<min_msec>[:<max_msec>]]
uuid_session_heartbeatEnable or set a heartbeat interval on a channeluuid_session_heartbeat <uuid> [sched] [0|<seconds>]
uuid_simplifyAttempt to cut FreeSWITCH out of the media pathuuid_simplify <uuid>
uuid_filemanControl file playback on a channeluuid_fileman <uuid> <cmd>:<val>
uuid_send_messageSend a SIP MESSAGE to the endpoint on a channeluuid_send_message <uuid> <message>
uuid_send_infoSend a SIP INFO request to the endpoint on a channeluuid_send_info <uuid> [<mime_type> <mime_subtype>] <message>
uuid_limitApply a usage-limit resource against a channel through a limit backenduuid_limit <uuid> <backend> <realm> <resource> [<max>[/interval]] [number [dialplan [context]]]
uuid_limit_releaseRelease a limit resource previously applied to a channeluuid_limit_release <uuid> <backend> [realm] [resource]
tone_detectStart tone detection on a channel, optionally firing an application on matchtone_detect <uuid> <key> <tone_spec> [<flags> <timeout> <app> <args> <hits>]
hupallHang up all channels, optionally filtered by variable valuehupall <cause> [<var> <value>] [<var2> <value2>]

Notes on originate:

The <call_url> argument is a FreeSWITCH endpoint dial string, for example sofia/internal/1001@192.0.2.1. The second positional argument is either a dialplan extension (<exten>) or an inline application prefixed with &, such as &echo(). The <dialplan> and <context> arguments default to XML and default respectively when omitted.

Notes on uuid_transfer:

-bleg transfers the B-leg of the call; -both transfers both legs simultaneously. Without a flag, the A-leg is transferred.

Notes on uuid_broadcast:

The <path> argument is a sound file path or an inline application invocation in app::args form. The aleg, bleg, holdb, and both flags control which leg receives the broadcast.

Notes on uuid_record:

mask replaces recorded audio with silence; unmask restores normal recording. The optional <recording_vars> argument accepts a semicolon-separated list of channel variables to attach as metadata.

Notes on uuid_displace:

start begins audio injection; stop ends it. The mux flag mixes the injected audio with the existing stream rather than replacing it.


Configuration Control

These commands reload configuration without restarting the FreeSWITCH process.

CommandPurposeSyntax
reloadxmlReload all XML configuration from diskreloadxml
reloadReload a loaded module (unload then load)reload [-f] <mod_name>
loadLoad a module that is not currently loadedload <mod_name>
unloadUnload a loaded moduleunload [-f] <mod_name>
reloadaclReload access control lists from configurationreloadacl
reloadcertReload SSL/TLS certificates without restartreloadcert

The -f flag on reload and unload forces the operation even if the module reports that it cannot be unloaded safely.


System Control

The fsctl command sends control messages to the FreeSWITCH core. All subcommands follow the pattern fsctl <subcommand> [args]. The shutdown command is also available as a standalone alias.

CommandPurposeSyntax
fsctl loglevelSet the global console log levelfsctl loglevel <level>
fsctl debug_levelSet the global debug verbosity levelfsctl debug_level <level>
fsctl pausePause call processing (inbound, outbound, or both)fsctl pause [inbound|outbound]
fsctl resumeResume call processingfsctl resume [inbound|outbound]
fsctl max_sessionsSet the maximum concurrent session limitfsctl max_sessions <num>
fsctl spsSet the sessions-per-second limitfsctl sps <num>
fsctl sps_peak_resetReset the peak sessions-per-second counterfsctl sps_peak_reset
fsctl shutdownInitiate a controlled shutdownfsctl shutdown [cancel|elegant|asap|now|restart]
fsctl recoverRecover sessions from the core recovery databasefsctl recover
fsctl hupallHang up all active sessions via core controlfsctl hupall
fsctl min_dtmf_durationSet the minimum DTMF duration in millisecondsfsctl min_dtmf_duration <num>
fsctl max_dtmf_durationSet the maximum DTMF duration in millisecondsfsctl max_dtmf_duration <num>
fsctl default_dtmf_durationSet the default DTMF duration in millisecondsfsctl default_dtmf_duration <num>
fsctl min_idle_cpuSet the minimum idle CPU percentage before call rejectionfsctl min_idle_cpu <num>
fsctl sync_clockSync the internal clock to the system clock immediatelyfsctl sync_clock
fsctl sync_clock_when_idleSync the internal clock the next time the system is idlefsctl sync_clock_when_idle
fsctl send_sighupSend SIGHUP to the process, triggering log rotationfsctl send_sighup
fsctl uuid_versionSet the UUID generation versionfsctl uuid_version [4|7]
fsctl api_expansionEnable or disable API expansion in dialplanfsctl api_expansion [on|off]
fsctl reclaim_memReclaim unused memory from core memory poolsfsctl reclaim_mem
fsctl mdns_resolveEnable or disable mDNS resolutionfsctl mdns_resolve [enable|disable]
fsctl flush_db_handlesFlush idle core database connection handles from the poolfsctl flush_db_handles
fsctl calibrate_clockRecalibrate the internal monotonic clockfsctl calibrate_clock
fsctl crashForce an immediate process crash (for debugging core dumps)fsctl crash
fsctl verbose_eventsEnable or disable verbose event generation globallyfsctl verbose_events [on|off]
fsctl threaded_system_execToggle whether system/bg_system shell commands run in a dedicated threadfsctl threaded_system_exec [on|off]
fsctl save_historyPersist the CLI command history to diskfsctl save_history
fsctl pause_checkReport whether call processing is paused (returns true/false)fsctl pause_check [inbound|outbound]
fsctl ready_checkReport whether the system is ready (returns true/false)fsctl ready_check
fsctl shutdown_checkReport whether a shutdown is in progress (returns true/false)fsctl shutdown_check
fsctl debug_poolPrint core memory pool debug statisticsfsctl debug_pool
fsctl debug_sqlToggle SQL debug loggingfsctl debug_sql
fsctl sqlStart or stop the core SQL queue threadfsctl sql [start|stop]
fsctl last_spsReport the last sessions-per-second valuefsctl last_sps
shutdownInitiate immediate shutdown (no modifier flags)shutdown

FreeSWITCH log levels, from least to most verbose: console, alert, crit, err, warning, notice, info, debug.

The CTL_SYNTAX usage string published by mod_commands lists the most common subcommands:

fsctl [api_expansion [on|off]|recover|send_sighup|hupall|
pause [inbound|outbound]|resume [inbound|outbound]|
shutdown [cancel|elegant|asap|now|restart]|
uuid_version [4|7]|sps|sps_peak_reset|sync_clock|
sync_clock_when_idle|reclaim_mem|max_sessions|
min_dtmf_duration [num]|max_dtmf_duration [num]|
default_dtmf_duration [num]|min_idle_cpu|
loglevel [level]|debug_level [level]|
mdns_resolve [enable|disable]]

The handler accepts additional subcommands beyond this string, documented in the table above: flush_db_handles, calibrate_clock, crash, verbose_events, threaded_system_exec, save_history, pause_check, ready_check, shutdown_check, debug_pool, debug_sql, sql, and last_sps.

Notes on fsctl shutdown:

cancel aborts a pending shutdown. elegant waits for all active sessions to complete. asap waits only until no sessions are active (does not wait for existing sessions to finish). now terminates immediately. Adding restart to elegant, asap, or now causes a restart after shutdown. The reincarnate now modifier (fsctl shutdown reincarnate now) terminates the process immediately and relaunches it, equivalent to a restart with the watchdog/reincarnate path.

Diagnostic subcommands:

pause_check, ready_check, and shutdown_check return a bare true/false for use in scripts. crash deliberately aborts the process and is intended only for generating a core dump during debugging.


Process and Shell Execution

These commands run external programs from the FreeSWITCH process. They are disabled when the core is started with the command execution restriction (the -nonat/restricted modes or switch.conf.xml <param name="enable-use-system-commands" value="false"/> policy), so confirm they are permitted before relying on them in production.

CommandPurposeSyntax
systemRun a shell command in the foreground and write its output to the streamsystem <command>
bg_systemRun a shell command in the background; returns +OK immediately without capturing outputbg_system <command>
spawnRun an external program directly (no shell) without capturing its outputspawn <command>
bg_spawnRun an external program directly in the background; returns +OK immediatelybg_spawn <command>
spawn_streamRun an external program directly and capture its output to the streamspawn_stream <command>
logWrite a message to the FreeSWITCH log at a given levellog <level> <message>
memoryReport core memory usage statisticsmemory
pool_statsReport core memory pool usage statisticspool_stats
unsched_apiUnschedule a task previously created with sched_api, by task IDunsched_api <task_id>

Notes on system versus spawn:

system and bg_system pass the command to a shell (/bin/sh -c), so shell features such as pipes and redirection work. The spawn family invokes the target program directly without a shell, which avoids shell-injection and quoting issues but does not interpret shell metacharacters. Use spawn_stream when you need the program's standard output returned to the caller.

Notes on log:

<level> accepts any FreeSWITCH log level name (console, alert, crit, err, warning, notice, info, debug); an unrecognized level defaults to debug.


NAT Mapping

The nat_map command manages UPnP/NAT-PMP port mappings on an upstream router when NAT traversal is initialized.

CommandPurposeSyntax
nat_mapInspect or modify NAT port mappingsnat_map [status|republish|reinit] | [add|del] <port> [tcp|udp] [static]

Notes on nat_map:

status prints the current NAT status. republish re-announces existing mappings to the router. reinit re-detects the NAT device and re-publishes. add and del create or remove a single mapping for the given <port>; the protocol defaults to UDP when neither tcp nor udp is given, and static marks the mapping as sticky. The command returns an error if NAT traversal is not initialized.


Variables and Evaluation

These commands read, write, and evaluate FreeSWITCH global variables and expressions.

CommandPurposeSyntax
global_getvarGet a global variable value; with no argument, dumps all global variablesglobal_getvar [<var>]
global_setvarSet a global variable; conditionally if a second value is providedglobal_setvar <var>=<value> [=<value2>]
evalEvaluate a string with variable expansion; no-op if no variables presenteval [uuid:<uuid> ]<expression>
expandExecute an API command after performing variable expansion on its argumentsexpand [uuid:<uuid> ]<cmd> <args>
regexEvaluate a regular expression and optionally apply a substitutionregex <data>|<pattern>[|<subst string>][n|b]
strftime_tzFormat a time value in a named timezonestrftime_tz <timezone_name> [<epoch>|][format string]
url_encodeURL-encode a stringurl_encode <string>
url_decodeURL-decode a stringurl_decode <string>
md5Return the MD5 hash of a stringmd5 <data>
condEvaluate a conditional expressioncond <expr> ? <true val> : <false val>
coalesceReturn the first non-empty value from a listcoalesce [^^<delim>]<value1>,<value2>,...
replaceReplace all occurrences of a substring within a stringreplace <data>|<string1>|<string2>
escapeEscape special characters in a stringescape <data>
toupperConvert a string to upper casetoupper <string>
tolowerConvert a string to lower casetolower <string>
create_uuidGenerate and return a new UUIDcreate_uuid

Notes on global_setvar:

When =<value2> is supplied, the variable is set to <value> only if its current value equals <value2> (conditional set).

Notes on eval:

When a uuid:<uuid> prefix is supplied, expansion resolves channel variables from that session in addition to global variables.

Notes on regex:

The n flag returns the matched group number; b returns a boolean true/false. The delimiter is | within the syntax string, which must be escaped as \| when entered at fs_cli.


Scheduling

These commands schedule API calls or call events at a future time.

CommandPurposeSyntax
sched_apiSchedule an API command to run at an absolute or relative timesched_api [+|@]<time> <group_name> <command_string>[&]
sched_delDelete a scheduled task by task ID or group namesched_del <task_id>|<group_id>
sched_hangupSchedule a running call to hang upsched_hangup [+]<time> <uuid> [<cause>]
sched_broadcastSchedule a broadcast application on a running callsched_broadcast [[+]<time>|@time] <uuid> <path> [aleg|bleg|both]
sched_transferSchedule a transfer for a running callsched_transfer [+]<time> <uuid> <extension> [<dialplan>] [<context>]
show tasksList all currently scheduled tasksshow tasks

Notes on sched_api time argument:

A leading + means relative seconds from now. A leading @ means recurring: the command re-schedules itself every <N> seconds. A plain numeric value is an absolute Unix timestamp. Appending & runs the scheduled command in its own thread.

To cancel a task created with sched_api, use unsched_api <task_id> (documented under Process and Shell Execution); the task ID is the value returned when the task was scheduled. sched_del removes scheduled hangup, transfer, and broadcast tasks by ID or group.


Background Execution

bgapi executes any API command in a background thread and returns a Job-UUID immediately. The result of the command is delivered as a BACKGROUND_JOB event on the Event Socket.

CommandPurposeSyntax
bgapiExecute an API command in a background threadbgapi <command>[ <arg>]

bgapi accepts an optional uuid:<uuid> prefix to assign a specific Job-UUID to the background task:

bgapi uuid:my-job-id status

bgapi is registered as an API command in mod_commands and is available at the fs_cli prompt as well as over the Event Socket. When used over the Event Socket as the ESL bgapi method, the transport layer handles the Background-Job event header directly; the behavior is otherwise identical.


CLI Aliases and ACLs

These commands define shorthand aliases for longer command strings and test IP addresses against named access control lists.

CommandPurposeSyntax
aliasAdd, update, or delete a CLI/API command aliasalias [add|stickyadd] <alias> <command> | del [<alias>|*]
aclTest an IP address against a named ACL (returns true/false)acl <ip> <list_name>

Notes on alias:

add creates an alias that maps <alias> to a full <command> string. stickyadd does the same but persists the alias across reloads. del <alias> removes a single alias; del * removes all aliases.

Notes on acl:

The ACL named by <list_name> is defined in acl.conf.xml. The command returns true when <ip> matches the list and false otherwise, making it useful for dialplan or script-driven access decisions. Reload ACL definitions with reloadacl.


Sofia Command Tree

The sofia command is registered by mod_sofia and controls SIP profile and gateway state. All subcommands follow the pattern sofia <subcommand> [args].

Status Subcommands

CommandPurposeSyntax
sofia statusShow all loaded profiles and gateways with their statesofia status
sofia status profileShow detailed status for a named profile, including bindings and registration countssofia status profile <name>
sofia status profile ... regFilter status output to registrations matching an optional contact stringsofia status profile <name> reg [<contact>]
sofia status profile ... presShow presence data for a profilesofia status profile <name> pres <pres_str>
sofia status profile ... userShow status for a specific user on a profilesofia status profile <name> user <user@domain>
sofia status gatewayShow status of a named gatewaysofia status gateway <name>
sofia xmlstatusSame as sofia status but output in XML formatsofia xmlstatus [profile <name>|gateway <name>]
sofia jsonstatusSame as sofia status but output in JSON formatsofia jsonstatus [profile <name>|gateway <name>]

Profile Management Subcommands

CommandPurposeSyntax
sofia profile ... rescanRe-read profile configuration from XML without a full restart; preserves existing callssofia profile <name> rescan [wait]
sofia profile ... restartFully stop and restart a profilesofia profile <name> restart [wait]
sofia profile ... startStart a stopped profilesofia profile <name> start
sofia profile ... stopStop a running profilesofia profile <name> stop [wait]
sofia profile ... flush_inbound_regFlush inbound registrations, optionally scoped to a call ID or user at domainsofia profile <name> flush_inbound_reg [<call_id>|<user>@<domain>] [reboot]
sofia profile ... check_syncForce re-sync of registrations matching a call IDsofia profile <name> check_sync [<call_id>]
sofia profile ... registerForce registration of a named gateway or all gatewayssofia profile <name> register [<gateway_name>|all]
sofia profile ... unregisterUnregister a named gateway or all gatewayssofia profile <name> unregister [<gateway_name>|all]
sofia profile ... killgwRemove a gateway from a profilesofia profile <name> killgw <gateway_name>
sofia profile ... startgwAdd and start a gateway from the current XML configurationsofia profile <name> startgw <gateway_name>
sofia profile ... gwlistList gateways on a profilesofia profile <name> gwlist [down]
sofia profile ... siptraceEnable or disable SIP trace logging for a profilesofia profile <name> siptrace <on|off>
sofia profile ... captureEnable or disable HEP/HOMER packet capture for a profilesofia profile <name> capture <on|off>
sofia profile ... watchdogEnable or disable the profile watchdogsofia profile <name> watchdog <on|off>
sofia profile ... recoverRecover sessions from the recovery database for a profilesofia profile <name> recover [flush]

Note on sofia profile ... stop and sofia profile ... restart:

A profile must have been running for at least 10 seconds before it can be stopped or restarted. The wait option blocks until the profile finishes its current SIP transactions.

Global Subcommands

CommandPurposeSyntax
sofia global siptraceEnable or disable SIP trace logging across all profilessofia global siptrace <on|off>
sofia global captureEnable or disable HEP/HOMER capture globallysofia global capture <on|off>
sofia global watchdogEnable or disable the profile watchdog globallysofia global watchdog <on|off>
sofia global standbyEnable or disable standby mode globallysofia global standby <on|off>
sofia global debugEnable or disable presence or SLA debuggingsofia global debug [presence|sla|none]
sofia restart allRestart all SIP profiles simultaneouslysofia restart all

Logging Subcommands

CommandPurposeSyntax
sofia loglevelGet or set the sofia-sip library log level for a named componentsofia loglevel <component> [0-9]
sofia tracelevelSet the FreeSWITCH log level at which sofia-sip trace output is emittedsofia tracelevel <console|alert|crit|err|warning|notice|info|debug>

Valid <component> values for sofia loglevel: all, default, tport, iptsec, nea, nta, nth_client, nth_server, nua, soa, sresolv, stun.

Utility API Commands

CommandPurposeSyntax
sofia_contactReturn the contact URI for a registered usersofia_contact [profile/]<user>@<domain>
sofia_count_regReturn the registration count for a usersofia_count_reg [profile/]<user>@<domain>
sofia_gateway_dataRetrieve a variable from a gatewaysofia_gateway_data <gateway_name> [ivar|ovar|var] <name>
sofia_username_ofLook up the username associated with a registrationsofia_username_of [profile/]<user>@<domain>
sofia_digPerform a SIP DNS lookup (NAPTR/SRV)sofia_dig <url>

Example fs_cli Session

The following illustrates a typical operator workflow: checking system state, inspecting an active call, and transferring it.

freeswitch@pbx> status
UP 0 years, 0 days, 2 hours, 14 minutes, 33 seconds, 412 milliseconds, 744 microseconds
FreeSWITCH (Version 1.10.x) is ready
2 session(s) since startup
1 session(s) - peak 1, last 5min 1
0 session(s) per Sec out of max 30, peak 1, last 5min 1
1000 session(s) max
min idle cpu 0.00/99.60
Current Stack Size/Max 240K/8192K

freeswitch@pbx> show channels
uuid,direction,created,created_epoch,name,state,cid_name,cid_num,...
5a3f1c2e-...,inbound,2026-06-02 10:31:00,...

freeswitch@pbx> uuid_transfer 5a3f1c2e-... 2000 XML default
+OK

freeswitch@pbx> sofia status profile internal
=================================
Name internal
...
RUNNING (2)

freeswitch@pbx> fsctl loglevel debug

freeswitch@pbx> reloadxml
+OK [Success]