Install adds a small cfs command to the PBX (at /usr/sbin/cfs, alongside fwconsole and asterisk). Run it as root. Day to day, cfs upgrade is the one you’ll use; the rest are for rare situations.
cfs: command not found? The shortcut wasn’t created on your box. Run the same commands as sudo php /usr/local/lib/cfstudio/bin/cfs <command> instead. Everything below works identically. On an older install, run the installer again to get the cfs command.
cfs upgrade
Upgrades Call Flow Studio in place to the current release. It shows the current and latest version and asks before changing anything; your settings, views, and license are preserved. If you’re already up to date it does nothing. This is the normal way to stay current.
sudo cfs upgrade
It installs a release only after checking its signature, and never installs a version older than the one you have.
| Option | What it does |
|---|---|
--check | Says whether a newer release is available. Changes nothing. |
--force | No confirmation prompt, and reinstalls even when you’re already on the latest version. |
--source <folder> | For a PBX without internet access. Takes the release from a folder on the PBX. On a machine that has access, download https://callflowstudio.io/downloads/cfstudio-latest.json and the release file it names, copy both into one folder on the PBX, and give that folder’s full path. The signature is still checked. |
| Exit | Meaning |
|---|---|
| 0 | Upgraded, already up to date, or cancelled |
| 1 | This install can’t check signatures. Reinstall with the installer. |
| 2 | Bad arguments, or not run as root |
| 3 | No release could be verified: it couldn’t be fetched, its signature didn’t check out, or it’s older than what’s installed |
| 4 | The download didn’t match the signed release, or unpacking or the install step failed |
cfs release-license
Only needed when you’re moving a paid license to different hardware. It frees this PBX’s license: it confirms with you, tells the licensing server to unbind this machine, clears the local key, and drops this box to viewer mode. Then activate the same code on the new PBX.
sudo cfs release-license
A trial has nothing to release; this is only for a paid license.
| Exit | Meaning |
|---|---|
| 0 | Released successfully |
| 1 | General error (e.g. network/server) |
| 2 | Bad arguments |
| 3 | No license file, or it’s unreadable |
| 4 | This is a trial, nothing to release |
| 5 | License is revoked |
| 6 | You declined the confirmation |
cfs export
Writes this PBX’s call routing to one JSON file: the call flow of every inbound number, and every IVR, queue, ring group, time condition and extension, including the ones nothing routes to. Use it to keep snapshots, compare them, or give your own scripts and tools an up-to-date picture of the PBX. Available on every license, including free. Works on the FreePBX family and on VitalPBX, where each tenant gets its own file (see below).
sudo cfs export --out /var/backups/pbx-routing.json
It only reads, so run it as often as suits you from your own cron. For example, every night at 2:15 (in root’s crontab, crontab -e):
15 2 * * * /usr/sbin/cfs export --out /var/backups/pbx-routing.json
That keeps one file, replaced on each run. To keep a history instead, put the date in the file name and remove old files yourself, for example after 30 days:
15 2 * * * /usr/sbin/cfs export --out /var/backups/pbx-routing-$(date +\%F).json
45 2 * * * find /var/backups -name 'pbx-routing-*.json' -mtime +30 -delete
In a crontab, % has to be written as \%: cron cuts the command off at a bare %, and the job fails.
An unchanged PBX gives an identical file apart from the time of the export and the registration snapshot, so two snapshots can be compared directly and only real changes show up. Settings a person changes, such as do not disturb, call forward, day/night mode and time condition overrides, are part of the routing, because they change where calls go. Whether each phone was registered when the export ran is recorded in its own section, extension_status.
The file explains its own format at the top (_spec), so a person or an AI assistant can read it without any other documentation. It contains no passwords or PINs. On a large PBX an export can take a minute or two.
On VitalPBX each tenant is its own routing plan, so each tenant is its own file. --out-dir writes one file per tenant, named after the tenant’s name in VitalPBX, and makes the folder if it isn’t there:
sudo cfs export --out-dir /var/backups/pbx-routing
That gives /var/backups/pbx-routing/acme.json for a tenant named acme, and so on. To export one tenant, name it with --tenant:
sudo cfs export --tenant acme --out /var/backups/acme.json
A VitalPBX with a single tenant works with --out alone. With more than one, the export asks for --out-dir or --tenant and lists the tenant names. For a nightly copy of every tenant, use --out-dir in place of --out in the cron line above. Tenants switched off in VitalPBX, and tenants beyond the ones your Call Flow Studio license covers, are not exported. Each tenant’s file uses VitalPBX’s own names for things and explains its format at the top in the same way.
| Option | Meaning |
|---|---|
--out FILE | Write FILE, replacing it in one step so a reader never sees half a file. Without it, the JSON goes to standard output. |
--out-dir DIR | VitalPBX: one file per tenant in DIR, each replaced in one step |
--tenant NAME | VitalPBX: only this tenant, by its name in VitalPBX |
--pretty | Indented JSON |
--verbose | Show progress |
| Exit | Meaning |
|---|---|
| 0 | Written |
| 1 | Error, nothing written |
| 2 | Bad arguments, or a VitalPBX with more than one tenant and neither --out-dir nor --tenant |
| 3 | Written, but some inbound routes could not be read (listed in routes_not_walked). That list also includes catch-all routes and a number’s extra caller ID routes; those alone still exit 0. |
Reset the admin password
Locked out of the admin login? Reset it from the PBX shell:
sudo php /usr/local/lib/cfstudio/api/cfs-reset-password.php
The same command works on FreePBX and VitalPBX. If that file isn’t there, your install is older: run the installer again first.
With no arguments it lists the active admin accounts, so you can see the exact username on each one, then prompts you to pick an account and set a new password. That password must be changed again at next login.
If you already know the username or email address on the account, pass it directly. Add --random to have a temporary password generated instead of typing one:
sudo php /usr/local/lib/cfstudio/api/cfs-reset-password.php admin --random
cfs --help
Lists the available commands.