fwconsole commands (13+)
- 1 Command List
- 2 Stop/Start/Restart
- 3 Chown
- 4 Certificate Management
- 5 Doctrine
- 6 Reload
- 7 Unlock
- 8 Userman
- 9 Util
- 10 Database
- 11 Module Administration
- 12 Bulk Import
- 13 EPM
- 14 Notification
- 15 Module System Manager
- 16 Qxact Reports
- 17 Paging Pro
- 18 Phone Apps
- 19 pm2
- 20 Setting
- 21 Sound Languages
- 22 System Admin
- 23 Trunks
- 24 Command List
- 25 Stop/Start/Restart
- 26 Chown
- 27 Doctrine
- 27.1 Reload
- 28 Unlock
- 29 Userman
- 30 Util
- 31 Database
- 32 Module Administration
- 33 Bulk Import
- 34 EPM
- 35 Notification
- 36 Paging Pro
- 37 Phone Apps
- 38 pm2
- 39 Setting
- 40 System Admin
- 41 Trunks
- 42 Validate
- 43 Localization
"fwconsole" is the Linux command that controls FreePBX 13+ from the Linux command prompt.
To access the command prompt, log-in to the machine where you installed FreePBX/Asterisk using your "root" username and password. You can do so by accessing the keyboard of the machine where you installed FreePBX, or remotely using an SSH client such as Putty.
Then type one of the following "fwconsole" commands below
All commands can be suffixed with --help to get more information
Some new commands have been added starting with FreePBX 15. See fwconsole commands (15+) for further information
Command List
Command Title | Command | Alias(es) | Description |
---|---|---|---|
bulkimport | bi | This command is used to import extensions and dids | |
certificates |
| Certificate Management | |
chown |
| Change ownership of files | |
Context | context | cx | Shows the specified context from the dialplan |
doctrine |
| Specific database documentation (for Development) | |
Debug | dbug | debug | Stream log files for debugging |
epm | endpoint | Endpoint Manager | |
External IP | extip | externalip | Get External IP |
firewall |
| Firewall functions | |
help | help |
| Displays help for a command |
list | list |
| Lists commands |
localization |
| Localization Utilities | |
mysql |
| Runs MySQL Client using freepbx credentials | |
moduleadmin | ma | Module Administration | |
notification |
| Manage notifications | |
modulesystemmanager | msm | View and change Update/Notification Manager Settings | |
qxact |
|
| |
reload | r | Reload Configs and Asterisk | |
pagingpro |
| Paging Pro Interface | |
|
| Debug Phone App Problems (For XML Style BLFs) | |
pm2 |
| Process Management | |
setting | set |
| |
sound |
| Sound Languages Management | |
sysadmin | sa | System Admin Functions | |
System Update | systemupdate | sysup,sys |
|
trunks |
| Enable and disable trunks from the command line | |
unlock | un | Unlock Session | |
userman |
| User Manager | |
util |
| Common Utilities | |
validate |
| Validate the PBX against hacks | |
vqplus | vqplus |
| VQPlus functions |
zulu | zulu |
| Zulu functions |
Stop/Start/Restart
This is how FreePBX starts asterisk and any other processes it need. You should always start and restart asterisk with the amportal command not the service asterisk or /etc/init.d/asterisk commands
fwconsole stop
fwconsole start
fwconsole restart
Chown
fwconsole chown - This will change ownership of all files and directories that FreePBX needs to be owned by the apache user.
See verbose details about chown operations (ownership and permissions per file)
[root@freepbxdev1 userman]# fwconsole chown --verbose Setting /var/lib/asterisk/ucp/out.log owner to: asterisk:asterisk, with permissions of: 644 Setting /var/lib/asterisk/ucp/err.log owner to: asterisk:asterisk, with permissions of: 644 Setting /var/lib/asterisk/ucp/ucp.log owner to: asterisk:asterisk, with permissions of: 644 Setting /var/lib/asterisk/ucp/config.json owner to: asterisk:asterisk, with permissions of: 644
Chown a specific module
[root@Andrews15 framework]# fwconsole chown --module asteriskinfo --verbose Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf Setting Permissions... Setting specific permissions... Setting /var/www/html/admin/modules/asteriskinfo to permissions of: 755 Setting /var/www/html/admin/modules/asteriskinfo/i18n to permissions of: 755 Setting /var/www/html/admin/modules/asteriskinfo/i18n/bg_BG to permissions of: 755 Setting /var/www/html/admin/modules/asteriskinfo/i18n/bg_BG/LC_MESSAGES to permissions of: 755 Setting /var/www/html/admin/modules/asteriskinfo/i18n/bg_BG/LC_MESSAGES/asteriskinfo.mo to permissions of: 644 Setting /var/www/html/admin/modules/asteriskinfo/i18n/bg_BG/LC_MESSAGES/asteriskinfo.po to permissions of: 644 [...] Finished setting permissions
Chown a specific file/directory
[root@localhost ~]# fwconsole chown --verbose --file=/var/www/html/admin/modules/timeconditions/bin/schedtc.php Taking too long? Customize the chown command, See http://wiki.freepbx.org/display/FOP/FreePBX+Chown+Conf Setting Permissions... Collecting Files...Done Setting /var/www/html/admin/modules/timeconditions/bin/schedtc.php owner to: asterisk:asterisk, with permissions of: 644 Setting /var/www/html/admin/modules/timeconditions/bin/schedtc.php owner to: asterisk:asterisk, with permissions of: 755 Finished setting permissions
In the example above you will see two permissions set for one file. This is completely normal. The first one is the generic setting and the second one is the setting from the module itself.
Certificate Management
Doctrine
This command is used to export out table information to be used in FreePBX table creation for module installations
Two formats are supported. XML and PHP.
The XML should be used in the module.xml file
The PHP code should be used inside install.php or the module's class.
Reload
fwconsole reload - This will perform a reload of all the dialplan in Asterisk and all the modules in asterisk. This is the same as pressing the "Apply Changes" button in the GUI of FreePBX
Unlock
fwconsole unlock xxxxxxxxxxxxxxxx- The fwconsole unlock command will unlock the GUI login of FreePBX to let you into the FreePBX GUI without the username and password. This is handy if you lost or misplaced your FreePBX GUI username or password and need to get into the GUI to change or setup a new user. You need to replace the xxxxxxx with your PHP session ID. Follow the steps below.
Bring up the main login page to FreePBX in your browser. Such as http://192.168.0.2/admin
Do a "ctrl a" to highlight the whole page and look to the left center of the screen for some text. This is your unique php session ID. Copy this into your clipboard.
Go into the linux CLI and type the following command replacing the session ID below with your own.
Go refresh your browser page and it will log you in this one time automatically for you based on that php session ID. Now you can go add or change the FreePBX admin users.
Userman
This command provides information about User Manager
Run synchronization for external authentication engines
Get verbose details about synchronization status
Util
General Utility functions for FreePBX
Clean up playback cache. This is normally run through a cron job. It removes any cached media (browser playback, moh/recording temp files,) that is over 60 days old.
Used to check all signatures on the system. Does not return any output
Runs a repair against the SQL Databases
Repair Asterisk Database (AstDB)
Clear Unused Devices : This will clear all the unused devices created by Webrtc, Zulu modules.
Database
fwconsole m This will connect you to the mysql database as the FreePBX user automatically based on the username and password for MySQL in /etc/freepbx.conf
Module Administration
Command line utility for controlling FreePBX Module installation.
Edge modules:
In Framework 13.0.69 we added the ability to install edge modules. To upgrade to a module in the edge track pass the --edge flag
Check Module Dependencies
Disable a module
Download a Module
Download a specific module
Download and install a Module
Bulk Import
If the Bulk Handler module is installed, you can use the command line to import a csv file as follows:
You must specify the import type and the file name to a valid csv file for import.
CLI Examples:
EPM
Add Mapping to Extension Mapping
List Extensions
List Templates
Reboot Devices
Rebuild Configuration Files
Rebuild and Update Devices
Remove Devices
Update Devices
Logout device (hotdesking) - Endpoint ver. 15.0.27.39+
Notification
List Notifications
Delete notification (by ID)
Module System Manager
List Settings
Change a setting
Qxact Reports
Running fwconsole qxact will display help text:
To re-import all the existing rotated queue_log files run:
Paging Pro
Cleanup stale pages and add needed pages (This is also run as a cron in crontab every minute. There it's called: */1 * * * * /var/lib/asterisk/bin/pagepro-scheduler.php 2>&1 >/dev/null)
Run command with --verbose to get detailed dataList active scheduled pages
List specific scheduled page by id
Execute a scheduled page immediately (for testing) using the paging pro page scheduler processes
Phone Apps
Get statuses of BLF lights for extension
Get status of BLF lights for single Application
Get more information about said hint by adding "--verbose"
pm2
Used to manage background/long running processes
List Processes
Stop Process
Restart Process
Delete Process (Only removes and stops it from the Process Management Module, does not remove the module itself)
Tail log (Used to tail logs for an application/process)
Update PM2 (Used to update the PM2 binary in memory, this will stop all applications to update the PM2 library!)
Reload Log file pointers (used during logrotates)
Setting
Used to alter Advanced Settings from the bash prompt:
Sound Languages
List Available Packages
Install
Uninstall
List Global
Set Global
System Admin
Get Activation Information
Update the license file on your installation
Activate system using your deploymentid
Clear https force - if an https force misconfiguration renders the Admin GUI inaccessible, you can clear it with
Trunks
Interactive toggle
List Trunks
Specifying a trunk to enable or disable
"fwconsole" is the Linux command that controls FreePBX 13+ from the Linux command prompt.
To access the command prompt, log-in to the machine where you installed FreePBX/Asterisk using your "root" username and password. You can do so by accessing the keyboard of the machine where you installed FreePBX, or remotely using an SSH client such as Putty.
Then type one of the following "fwconsole" commands below
Command List
Command | Short | Description |
---|---|---|
bi | This command is used to import extensions and dids | |
certificates |
| Certificate Management |
| Change ownership of files | |
context | cx | Shows the specified context from the dialplan |
| Specific database documentation (for Development) | |
debug | dbug | Stream log files for debugging |
| Endpoint Manager | |
externalip | extip | Get External IP |
| Firewall functions | |
help |
| Displays help for a command |
list |
| Lists commands |
m | Runs MySQL Client using freepbx credentials | |
ma | Module Administration | |
| Manage notifications | |
r | Reload Configs and Asterisk | |
restart |
| Start Asterisk and run other needed FreePBX commands |
| Paging Pro Interface | |
| Debug Phone App Problems (For XML Style BLFs) | |
| Process Management | |
set |
| |
sa | System Admin Functions | |
| Enable and disable trunks from the command line | |
un | Unlock Session | |
| User Manager | |
| Common Utilities | |
vqplus |
| VQPlus functions |
Stop/Start/Restart
This is how FreePBX starts asterisk and any other processes it need. You should always start and restart asterisk with the amportal command not the service asterisk or /etc/init.d/asterisk commands
fwconsole stop
fwconsole start
fwconsole restart
Chown
fwconsole chown - This will change ownership of all files and directories that FreePBX needs to be owned by the apache user.
See verbose details about chown operations (ownership and permissions per file)
Chown a specific file (or see details about only ONE file/directory)
Doctrine
This command is used to export out table information to be used in FreePBX table creation for module installations
Two formats are supported. XML and PHP.
The XML should be used in the module.xml file
The PHP code should be used inside install.php or the module's class.
Reload
fwconsole reload - This will perform a reload of all the dialplan in Asterisk and all the modules in asterisk. This is the same as pressing the "Apply Changes" button in the GUI of FreePBX
Unlock
fwconsole unlock xxxxxxxxxxxxxxxx- The fwconsole unlock command will unlock the GUI login of FreePBX to let you into the FreePBX GUI without the username and password. This is handy if you lost or misplaced your FreePBX GUI username or password and need to get into the GUI to change or setup a new user. You need to replace the xxxxxxx with your PHP session ID. Follow the steps below.
Bring up the main login page to FreePBX in your browser. Such as http://192.168.0.2/admin
Do a "ctrl a" to highlight the whole page and look to the left center of the screen for some text. This is your unique php session ID. Copy this into your clipboard.
Go into the linux CLI and type the following command replacing the session ID below with your own.
Go refresh your browser page and it will log you in this one time automatically for you based on that php session ID. Now you can go add or change the FreePBX admin users.
Userman
This command provides information about User Manager
Run synchronization for external authentication engines
Get verbose details about synchronization status
Util
General Utility functions for FreePBX
Clean up playback cache. This is normally run through a cron job. It removes any cached media (browser playback, moh/recording temp files,) that is over 60 days old.
Used to check all signatures on the system. Does not return any output
Runs a repair against the SQL Databases
Database
fwconsole m This will connect you to the mysql database as the FreePBX user automatically based on the username and password for MySQL in /etc/freepbx.conf
Module Administration
Command line utility for controlling FreePBX Module installation.
Edge modules:
In Framework 13.0.69 we added the ability to install edge modules. To upgrade to a module in the edge track pass the --edge flag
Check Module Dependencies
Disable a module
Download a Module
Download a specific module
Download and install a Module
Bulk Import
If the Bulk Handler module is installed, you can use the command line to import a csv file as follows:
You must specify the import type and the file name to a valid csv file for import.
CLI Examples:
EPM
Add Mapping to Extension Mapping
List Extensions
List Templates
Reboot Devices
Rebuild Configuration Files
Rebuild and Update Devices
Remove Devices
Update Devices
Notification
List Notifications
Delete notification (by ID)
Paging Pro
Cleanup stale pages and add needed pages (This is also run as a cron in crontab every minute. There it's called: */1 * * * * /var/lib/asterisk/bin/pagepro-scheduler.php 2>&1 >/dev/null)
Run command with --verbose to get detailed dataList active scheduled pages
List specific scheduled page by id
Execute a scheduled page immediately (for testing) using the paging pro page scheduler processes
Phone Apps
Get statuses of BLF lights for extension
Get status of BLF lights for single Application
Get more information about said hint by adding "--verbose"
pm2
Used to manage background/long running processes
List Processes
Stop Process
Restart Process
Delete Process (Only removes and stops it from the Process Management Module, does not remove the module itself)
Tail log (Used to tail logs for an application/process)
Update PM2 (Used to update the PM2 binary in memory, this will stop all applications to update the PM2 library!)
Reload Log file pointers (used during logrotates)
Setting
Used to alter Advanced Settings from the bash prompt:
System Admin
Get Activation Information
Update the license file on your installation
Activate system using your deploymentid
Trunks
interactive toggle
specifying a trunk to enable or disable
After enabling/disabling trunks, a reload is required for changes to be applied to the system.
Validate
Running Validate
Cleaning your system:
Localization
This uses https://weblate.sangoma.com to download and apply localization updates for modules. Normally when modules are published they update from weblate automatically however if you go through weblate and make changes and want to see them in your system you will need to use this utility.
List Local Localizations
Update All Localizations
Update Localizations by Module
Update Localizations by Language
Update Localizations by Module & Language
# fwconsole sysadmin --help______ ______ ______ __ __| ___| | ___ \| ___ \\ \ / /| |_ _ __ ___ ___ | |_/ /| |_/ / \ V /| _| | '__| / _ \ / _ \| __/ | ___ \ / \| | | | | __/| __/| | | |_/ // /^\ \\_| |_| \___| \___|\_| \____/ \/ \/
Usage: sysadmin [options] [--] [<args>]... sa
Arguments: args
Options: -s, --set=SET We are setting F flag -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Help: Usage: fwconsole sysadmin action [arg arg...] info : Display Activation info activate : Activate system with provided Deployment ID deactivate : Deactivate system with provided Deployment ID update : Refresh Activation information updatecert : Make sure the Apache SSL Certificate is up to date ports : Display internal HTTP/HTTPS port mappings clearforce : Disabling HTTPS forced redirection for the administration interface, e.g: fwconsole sa cf. showSSLProtocol : Show SSL Protocol for Apache, e.g: fwconsole sa ssp writeSSLProtocol : Write SSL Protocol for Apache, e.g: fwconsole sa wsp --set='all -SSLv3 -TLSv1 -TLSv1.1' resetSSLProtocol : Reset to Default changes settings to (SSLProtocol all -SSLv3), e.g: fwconsole sa rsp installHttpsCert : Install Https Certificate for Apache, e.g: fwconsole sa ihc --set='your.base.name' or fwconsole sa ihc default
Repair Asterisk Database (AstDB)