"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 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 |
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
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. |
|
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.
|
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
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.
[root@localhost ~]# fwconsole unlock ppnr8l1vle32s3q8b79s4n1sp7 Please wait... session unlocked! [root@localhost ~]# |
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.
This command provides information about User Manager
Run synchronization for external authentication engines
[root@freepbxdev1 userman]# fwconsole userman sync Starting Sync... |
Get verbose details about synchronization status
[root@freepbxdev1 userman]# fwconsole userman sync --verbose Starting Sync... |
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.
[root@freepbxdev1 paging]# fwconsole util cleanplaybackcache Starting Cache cleanup Finished cleaning up cache |
Used to check all signatures on the system. Does not return any output
[root@freepbxdev1 paging]# fwconsole util signaturecheck [root@freepbxdev1 paging]# |
Runs a repair against the SQL Databases
[root@freepbxdev1 paging]# fwconsole util tablefix Attempting to repair MySQL Tables this may take a while MySQL Tables Repaired |
Repair Asterisk Database (AstDB)
[root@58448910 modules]# fwconsole util resetastdb |
Clear Unused Devices : This will clear all the unused devices created by Webrtc, Zulu modules.
[root@58448910 modules]# fwconsole util clearunuseddevices |
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
|
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
[root@xxxxxx ~]# fwconsole ma checkdepends core All dependencies met for module core |
Disable a module
[root@freepbxdev1 faxpro]# fwconsole ma disable asterisk-cli Module asterisk-cli successfully disabled Updating Hooks...Done |
Download a Module
[root@xxxxxx ~]# fwconsole ma download core No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded |
[root@xxxxxx ~]# fwconsole ma download <url> No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded |
Download a specific module
[root@xxxxxx ~]# fwconsole ma download core --tag 1.2.3 No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded |
Download and install a Module
[root@xxxxxx ~]# fwconsole ma downloadinstall core No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded Checking if directdids need migrating..already done updating zap callgroup, pickupgroup..not needed checking for delay_answer field ..already exists checking for reversal field ..already exists checking for pricid field ..already exists Migrating pickup groups to named pickup groups Migrating call groups to named call groups Checking if trunk table migration required..not needed Checking if privacy manager options exists..already exists Checking for noanswer_cid field..already exists Checking for busy_cid field..already exists Checking for chanunavail_cid field..already exists Checking for noanswer_dest field..already exists Checking for busy_dest field..already exists Checking for chanunavail_dest field..already exists Unable to add index to extensions field in users Checking for General Setting migrations..not needed Deleting unused globals..done Converting IAX notransfer to transfer if needed..updated 0000 records deleting obsoleted record_in and record_out entries..ok checking for dest field in outbound_routes..already exists checking for continue field in trunks..already exists upgrading any zap trunks to dahdi if found..ok Checking for possibly invalid emergency caller id fields..none found Generating CSS...Done Module core successfully installed Updating Hooks...Done |
[root@xxxxxx ~]# fwconsole ma downloadinstall <url> No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded Checking if directdids need migrating..already done updating zap callgroup, pickupgroup..not needed checking for delay_answer field ..already exists checking for reversal field ..already exists checking for pricid field ..already exists Migrating pickup groups to named pickup groups Migrating call groups to named call groups Checking if trunk table migration required..not needed Checking if privacy manager options exists..already exists Checking for noanswer_cid field..already exists Checking for busy_cid field..already exists Checking for chanunavail_cid field..already exists Checking for noanswer_dest field..already exists Checking for busy_dest field..already exists Checking for chanunavail_dest field..already exists Unable to add index to extensions field in users Checking for General Setting migrations..not needed Deleting unused globals..done Converting IAX notransfer to transfer if needed..updated 0000 records deleting obsoleted record_in and record_out entries..ok checking for dest field in outbound_routes..already exists checking for continue field in trunks..already exists upgrading any zap trunks to dahdi if found..ok Checking for possibly invalid emergency caller id fields..none found Generating CSS...Done Module core successfully installed Updating Hooks...Done |
|
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:
|
|
Add Mapping to Extension Mapping
# fwconsole epm addmapping 4101 --brand=sangoma --mac=005058500002 --template=sangomatest --model=S700 --account=account1 Extension 4101 added successfully. |
List Extensions
# fwconsole epm listextensions ALL +-----------+-------------+--------------+------------------+----------+----------+-------------+---------+---------------------+ | Extension | Brand | MAC | Template | Model | Account | Expansion 1 | Rebuild | VPN | +-----------+-------------+--------------+------------------+----------+----------+-------------+---------+---------------------+ | 1012 | Grandstream | 000B82800001 | grandstream-test | GXP-2170 | account1 | | 1 | | | 4101 | sangoma | 005058500003 | sangomatest | | account1 | | | | | 4102 | Yealink | 001565211111 | yealink-base | SIP-T26P | account1 | EXP38-1 | 1 | | | 4103 | Sangoma | 005058500001 | sangomatest | S500 | account1 | EXP100-1 | 1 | 4103 - 4103 (ID: 4) | | 4104 | Sangoma | 005058500002 | sangomatest | S700 | account1 | | 1 | | +-----------+-------------+--------------+------------------+----------+----------+-------------+---------+---------------------+ # fwconsole epm listextensions ALL --detail +-----------+-------------+--------------+------------------+----------+----------+-----------+-------------+-------------+-------------+-------------+-------------+-------------+------------------+-----------+---------+---------------------+------------+------------+------------+-----------+ | Extension | Brand | MAC | Template | Model | Account | Accessory | Expansion 1 | Expansion 2 | Expansion 3 | Expansion 4 | Expansion 5 | Expansion 6 | BLF Substitution | BLF Label | Rebuild | VPN | Repeater 1 | Repeater 2 | Repeater 3 | Multicell | +-----------+-------------+--------------+------------------+----------+----------+-----------+-------------+-------------+-------------+-------------+-------------+-------------+------------------+-----------+---------+---------------------+------------+------------+------------+-----------+ | 1012 | Grandstream | 000B82800001 | grandstream-test | GXP-2170 | account1 | | | | | | | | | | 1 | | | | | | | 4101 | sangoma | 005058500003 | sangomatest | | account1 | | | | | | | | | | | | | | | | | 4102 | Yealink | 001565211111 | yealink-base | SIP-T26P | account1 | | EXP38-1 | | | | | | None | | 1 | | | | | | | 4103 | Sangoma | 005058500001 | sangomatest | S500 | account1 | | EXP100-1 | EXP100-2 | EXP100-3 | EXP100-4 | EXP100-5 | EXP100-6 | None | | 1 | 4103 - 4103 (ID: 4) | | | | | | 4104 | Sangoma | 005058500002 | sangomatest | S700 | account1 | | | | | | | | | | 1 | | | | | | +-----------+-------------+--------------+------------------+----------+----------+-----------+-------------+-------------+-------------+-------------+-------------+-------------+------------------+-----------+---------+---------------------+------------+------------+------------+-----------+ |
List Templates
# fwconsole epm listtemplates +-------------+----------------------+-------------+-----------+----------------+-------------------+--------------------+----------+------------------+------------------+ | Brand | Template Name | Destination | Time Zone | Provision Type | Provision Address | Background | Firmware | Internal Default | External Default | +-------------+----------------------+-------------+-----------+----------------+-------------------+--------------------+----------+------------------+------------------+ | grandstream | grandstream-test | 10.100.0.3 | -06:00 | TFTP | 10.100.0.3 | digit-on-phone.png | 1.14 | | | | sangoma | sangomatest | 10.100.0.3 | -06:00 | HTTP | 10.100.0.3 | digit-on-phone.png | 1.23 | | | | yealink | yealink-base | 10.100.0.3 | -06:00 | TFTP | 10.100.0.3 | sangomapad.png | 1.16 | Yes | Yes | +-------------+----------------------+-------------+-----------+----------------+-------------------+--------------------+----------+------------------+------------------+ |
Reboot Devices
# fwconsole epm reboot 4103 Only works for Sangoma phones Extension 4103 sent reboot command. # fwconsole epm reboot sangomatest Only works for Sangoma phones Extension 4103 sent reboot command Extension 4104 sent reboot command Extension 4101 sent reboot command |
Rebuild Configuration Files
# fwconsole epm rebuild 4103 Extension 4103 rebuilt # fwconsole epm rebuild sangomatest Extension 4103 rebuilt Extension 4104 rebuilt Extension 4101 rebuilt |
Rebuild and Update Devices
# fwconsole epm rebuildupdate 4103 Extension 4103 rebuilt Update command sent to 4103 # fwconsole epm rebuildupdate sangomatest Extension 4103 rebuilt Extension 4104 rebuilt Extension 4101 rebuilt Update command sent to 4103 Update command sent to 4104 Update command sent to 4101 |
Remove Devices
# fwconsole epm remove 4103 4103 removed succesfully |
Update Devices
# fwconsole epm update 4103 Update command sent to 4103 # fwconsole epm update sangomatest Update command sent to 4103 Update command sent to 4104 Update command sent to 4101 |
Logout device (hotdesking) - Endpoint ver. 15.0.27.39+
# fwconsole endpoint logout 6013 success << device reboots >> # fwconsole epm logout 6013 Extension 6013-1 is already in logged out mode |
|
List Notifications
[root@freepbxdev1 faxpro]# fwconsole notification --list +---------------+-------------------------+----------------------------------------------------------+ | Module | ID | Text | +---------------+-------------------------+----------------------------------------------------------+ | freepbx | FW_UNSIGNED | You have 95 unsigned modules | | freepbx | NEWUPDATES | There are 3 modules available for online upgrades | | cron_manager | EXECFAIL | Cronmanager encountered 1 Errors | | dahdiconfig | etcdahdimodules | File /etc/dahdi/modules is not owned by asterisk | | dahdiconfig | etcdahdisystem.conf | File /etc/dahdi/system.conf is not owned by asterisk | | dahdiconfig | etcmodprobe.ddahdi.conf | File /etc/modprobe.d/dahdi.conf is not owned by asterisk | | freepbx | modules_disabled | You have 10 disabled modules | | cidlookup | noauth | OpenCNAM Requires Authentication | | fax | invalid_email | Invalid Email for Inbound Fax | | freepbx | NEWMODS | 1 New modules are available | | retrieve_conf | SYMLINKNOTICE | Symlink Conflict Resolved | | sipstationdid | ss7149223196 | SIPSTATION DID routed | +---------------+-------------------------+----------------------------------------------------------+ |
[root@freepbxdev1 faxpro]# fwconsole notification --list --json [["freepbx","FW_UNSIGNED","You have 95 unsigned modules"],["freepbx","NEWUPDATES","There are 3 modules available for online upgrades"],["cron_manager","EXECFAIL","Cronmanager encountered 1 Errors"],["dahdiconfig","etcdahdimodules","File \/etc\/dahdi\/modules is not owned by asterisk"],["dahdiconfig","etcdahdisystem.conf","File \/etc\/dahdi\/system.conf is not owned by asterisk"],["dahdiconfig","etcmodprobe.ddahdi.conf","File \/etc\/modprobe.d\/dahdi.conf is not owned by asterisk"],["freepbx","modules_disabled","You have 10 disabled modules"],["cidlookup","noauth","OpenCNAM Requires Authentication"],["fax","invalid_email","Invalid Email for Inbound Fax"],["freepbx","NEWMODS","1 New modules are available"],["retrieve_conf","SYMLINKNOTICE","Symlink Conflict Resolved"],["sipstationdid","ss7149223196","SIPSTATION DID routed"]] |
Delete notification (by ID)
[root@freepbxdev1 faxpro]# fwconsole notification --delete dahdiconfig etcdahdimodules Deleting notification Notification Deleted [root@freepbxdev1 faxpro]# fwconsole notification --list +---------------+-------------------------+----------------------------------------------------------+ | Module | ID | Text | +---------------+-------------------------+----------------------------------------------------------+ | freepbx | FW_UNSIGNED | You have 95 unsigned modules | | freepbx | NEWUPDATES | There are 3 modules available for online upgrades | | cron_manager | EXECFAIL | Cronmanager encountered 1 Errors | | dahdiconfig | etcdahdisystem.conf | File /etc/dahdi/system.conf is not owned by asterisk | | dahdiconfig | etcmodprobe.ddahdi.conf | File /etc/modprobe.d/dahdi.conf is not owned by asterisk | | freepbx | modules_disabled | You have 10 disabled modules | | cidlookup | noauth | OpenCNAM Requires Authentication | | fax | invalid_email | Invalid Email for Inbound Fax | | freepbx | NEWMODS | 1 New modules are available | | retrieve_conf | SYMLINKNOTICE | Symlink Conflict Resolved | | sipstationdid | ss7149223196 | SIPSTATION DID routed | +---------------+-------------------------+----------------------------------------------------------+ |
|
List Settings
|
Change a setting
|
Feature added in 14+
Feature added in 14+
Running fwconsole qxact will display help text:
|
To re-import all the existing rotated queue_log files run:
|
|
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 data
[root@freepbxdev1 framework]# fwconsole pagingpro --clean --verbose Found scheduled page for ID 500 occuring at 1466527800 |
List active scheduled pages
[root@freepbxdev1 framework]# fwconsole pagingpro --list +---------+------------+-------------+ | Page ID | Time | Cron Exists | +---------+------------+-------------+ | 500 | 1466527800 | Yes | +---------+------------+-------------+ |
List specific scheduled page by id
[root@freepbxdev1 framework]# fwconsole pagingpro --list 500 +---------+------------+-------------+ | Page ID | Time | Cron Exists | +---------+------------+-------------+ | 500 | 1466527800 | Yes | +---------+------------+-------------+ |
Execute a scheduled page immediately (for testing) using the paging pro page scheduler processes
[root@freepbxdev1 framework]# fwconsole pagingpro --execute 500 [root@freepbxdev1 framework]# <phones should be ringing> |
|
Get statuses of BLF lights for extension
[root@freepbxdev1 restapps]# fwconsole phoneapps blf 12000 +-----------------+------------+ | ID | BLF Status | +-----------------+------------+ | Call Forward | Inactive | | Conference | Inactive | | DND | Inactive | | Follow Me | Active | | Parking | Inactive | | Queues | Inactive | | Queue Agent | Active | | Time Conditions | Inactive | | Voicemail | Active | | Call Flow | Inactive | +-----------------+------------+ |
Get status of BLF lights for single Application
[root@freepbxdev1 restapps]# fwconsole phoneapps blf 12000 "Parking" +---------+------------+ | ID | BLF Status | +---------+------------+ | Parking | Inactive | +---------+------------+ |
Get more information about said hint by adding "--verbose"
[root@freepbxdev1 restapps]# fwconsole phoneapps blf 12000 "Call Flow" --verbose +-----------+------------+------------------+ | ID | BLF Status | Hint | +-----------+------------+------------------+ | Call Flow | Inactive | Custom:DAYNIGHT0 | +-----------+------------+------------------+ |
Used to manage background/long running processes
|
List Processes
[root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+--------+----------+---------------------+-----+----------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+--------+----------+---------------------+-----+----------+ | xmpp | 8495 | online | 0 | 6 hours, 29 minutes | 0% | 218.13MB | | restapps | 8665 | online | 0 | 6 hours, 29 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 29 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 28 minutes | 0% | 73.53MB | | qcallback | 16218 | online | 30 | 5 hours, 54 minutes | 0% | 29.59MB | +--------------+-------+--------+----------+---------------------+-----+----------+ |
Stop Process
[root@freepbxdev1 ~]# fwconsole pm2 --stop xmpp Process Stopped [root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+---------+----------+---------------------+-----+---------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+---------+----------+---------------------+-----+---------+ | xmpp | 0 | stopped | 0 | 0 | 0% | 0.00B | | restapps | 8665 | online | 0 | 6 hours, 30 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 30 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 29 minutes | 0% | 73.54MB | | qcallback | 16218 | online | 30 | 5 hours, 55 minutes | 0% | 29.59MB | +--------------+-------+---------+----------+---------------------+-----+---------+ |
Restart Process
[root@freepbxdev1 ~]# fwconsole pm2 --restart xmpp Process Restarted [root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+--------+----------+---------------------+------+----------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+--------+----------+---------------------+------+----------+ | xmpp | 8299 | online | 0 | 4 seconds | 102% | 117.13MB | | restapps | 8665 | online | 0 | 6 hours, 30 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 30 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 29 minutes | 0% | 73.54MB | | qcallback | 16218 | online | 30 | 5 hours, 56 minutes | 0% | 29.59MB | +--------------+-------+--------+----------+---------------------+------+----------+ |
Delete Process (Only removes and stops it from the Process Management Module, does not remove the module itself)
[root@freepbxdev1 ~]# fwconsole pm2 --delete xmpp Process Stopped and Deleted [root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+--------+----------+---------------------+-----+---------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+--------+----------+---------------------+-----+---------+ | restapps | 8665 | online | 0 | 6 hours, 31 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 31 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 30 minutes | 0% | 73.55MB | | qcallback | 16218 | online | 30 | 5 hours, 56 minutes | 0% | 29.59MB | +--------------+-------+--------+----------+---------------------+-----+---------+ |
Tail log (Used to tail logs for an application/process)
[root@freepbxdev1 ~]# fwconsole pm2 --log restapps --lines 20 OUT > ==> /var/log/asterisk/restapps_err.log <== ==> /var/log/asterisk/restapps_out.log <== 2017-04-12 01:34 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 01:34 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-presencestate] Setting button linekeys:14 to IN_USE 2017-04-12 01:48 -04:00: [8665][1001-parking] Setting button linekeys:13 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-findmefollow] Setting button linekeys:11 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-donotdisturb] Setting button linekeys:10 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-presencestate] Setting button linekeys:14 to IN_USE 2017-04-12 02:02 -04:00: [8665][1001-parking] Setting button linekeys:13 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-findmefollow] Setting button linekeys:11 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-donotdisturb] Setting button linekeys:10 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-presencestate] Setting button linekeys:14 to IN_USE 2017-04-12 02:17 -04:00: [8665][1001-parking] Setting button linekeys:13 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-findmefollow] Setting button linekeys:11 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-donotdisturb] Setting button linekeys:10 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE |
Update PM2 (Used to update the PM2 binary in memory, this will stop all applications to update the PM2 library!)
[root@freepbxdev1 ~]# fwconsole pm2 --update Be sure to have the latest version by doing `npm install pm2@latest -g` before doing this procedure. [PM2] Saving current process list... [PM2] Stopping PM2... [PM2] Applying action deleteProcessId on app [all](ids: 1,2,3,4) [PM2] [ucpnode](3) ✓ [PM2] [restapps](1) ✓ [PM2] [qcallback](4) ✓ [PM2] [zulu](2) ✓ [PM2] All processes have been stopped and deleted [PM2] PM2 stopped [PM2] Spawning PM2 daemon with pm2_home=/home/asterisk/.pm2 [PM2] Restoring processes located in /home/asterisk/.pm2/dump.pm2 [PM2] Process /usr/src/freepbx/restapps/restapps.php restored [PM2] Process /usr/src/freepbx/zulu/node/index.js restored [PM2] Process /usr/src/freepbx/ucpnode/node/index.js restored [PM2] Process /usr/src/freepbx/vqplus/queue-callback.php restored >>>>>>>>>> PM2 updated ┌───────────┬────┬──────┬──────┬────────┬─────────┬────────┬──────┬───────────┬──────────┐ │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │ ├───────────┼────┼──────┼──────┼────────┼─────────┼────────┼──────┼───────────┼──────────┤ │ qcallback │ 3 │ fork │ 9316 │ online │ 0 │ 0s │ 46% │ 18.5 MB │ disabled │ │ restapps │ 0 │ fork │ 9289 │ online │ 0 │ 0s │ 168% │ 33.4 MB │ disabled │ │ ucpnode │ 2 │ fork │ 9305 │ online │ 0 │ 0s │ 59% │ 15.1 MB │ disabled │ │ zulu │ 1 │ fork │ 9295 │ online │ 0 │ 0s │ 71% │ 17.8 MB │ disabled │ └───────────┴────┴──────┴──────┴────────┴─────────┴────────┴──────┴───────────┴──────────┘ Use `pm2 show <id|name>` to get more details about an app Update PM2 Process |
Reload Log file pointers (used during logrotates)
[root@uc-85436011 ~]# fwconsole pm2 --reload-logs All logs reloaded |
Used to alter Advanced Settings from the bash prompt:
|
|
List Available Packages
[root@Andrew14 soundlang]# fwconsole sound --list +-------+----------------------------------+----------------------------+-----------+ | ID | Language | Author | Installed | +-------+----------------------------------+----------------------------+-----------+ | cs | Czech (cs) | Westany Ltd. | | | en | English (en) | Allison Smith | X | | en_AU | English - Australia (en_AU) | CAMSOWN | | | en_GB | English - United Kingdom (en_GB) | Jay Benham | | | en_NZ | English - New Zealand (en_NZ) | Rover Voice Services | | | es | Spanish (es) | Allison Smith | | | fa | Persian (fa) | SENA | | | fr | French (fr) | June Wallack | | | he | Hebrew (he) | Westany Ltd. | | | it | Italian (it) | Carlo Flora | | | ja | Japanese (ja) | Ryoko SONODA (QLOOG, Inc.) | | | nl | Dutch (nl) | Westany Ltd. | | | no | Norwegian (no) | Westany Ltd. | | | pl | Polish (pl) | Westany Ltd. | | | ru | Russian (ru) | http://www.ivrvoice.ru/ | | | sv | Swedish (sv) | Tove Hjelm | | | tr | Turkish (tr) | Westany Ltd. | | +-------+----------------------------------+----------------------------+-----------+ |
Install
[root@Andrew14 soundlang]# fwconsole sound --install cs <snip> Accept License Agreement? [y/n]y Installing cs...Done |
Uninstall
[root@Andrew14 soundlang]# fwconsole sound --uninstall cs Uninstalling cs...Done |
List Global
[root@Andrew14 soundlang]# fwconsole sound --listglobal +----+---------+---------+ | ID | Name | Default | +----+---------+---------+ | en | English | X | +----+---------+---------+ |
Set Global
[root@Andrew14 soundlang]# fwconsole sound --global en Successfully set default language to en, you will need to reload |
|
Get Activation Information
[root@freepbxdev1 faxpro]# fwconsole sysadmin info Activation Status: Zend ID: M:XXXXX-XXXXX-XXXXX-XXXXX Lic File: Present Deployment: freepbxdev1 |
Update the license file on your installation
[root@freepbxdev1 faxpro]# fwconsole sysadmin update Updating license for freepbxdev1 Done! No changes from original Licence. |
Activate system using your deploymentid
[root@freepbxdev1 faxpro]# fwconsole sysadmin activate <deploymentid> |
Clear https force - if an https force misconfiguration renders the Admin GUI inaccessible, you can clear it with
# fwconsole sysadmin clearforce Disabling HTTPS forced redirection for the administration interface. Done. |
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
All commands can be suffixed with --help to get more information |
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 |
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
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 file (or see details about only ONE 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. |
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.
|
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
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.
[root@localhost ~]# fwconsole unlock ppnr8l1vle32s3q8b79s4n1sp7 Please wait... session unlocked! [root@localhost ~]# |
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.
This command provides information about User Manager
Run synchronization for external authentication engines
[root@freepbxdev1 userman]# fwconsole userman sync Starting Sync... |
Get verbose details about synchronization status
[root@freepbxdev1 userman]# fwconsole userman sync --verbose Starting Sync... |
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.
[root@freepbxdev1 paging]# fwconsole util cleanplaybackcache Starting Cache cleanup Finished cleaning up cache |
Used to check all signatures on the system. Does not return any output
[root@freepbxdev1 paging]# fwconsole util signaturecheck [root@freepbxdev1 paging]# |
Runs a repair against the SQL Databases
[root@freepbxdev1 paging]# fwconsole util tablefix Attempting to repair MySQL Tables this may take a while MySQL Tables Repaired |
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
|
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
[root@xxxxxx ~]# fwconsole ma checkdepends core All dependencies met for module core |
Disable a module
[root@freepbxdev1 faxpro]# fwconsole ma disable asterisk-cli Module asterisk-cli successfully disabled Updating Hooks...Done |
Download a Module
[root@xxxxxx ~]# fwconsole ma download core No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded |
[root@xxxxxx ~]# fwconsole ma download <url> No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded |
Download a specific module
[root@xxxxxx ~]# fwconsole ma download core --tag 1.2.3 No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded |
Download and install a Module
[root@xxxxxx ~]# fwconsole ma downloadinstall core No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded Checking if directdids need migrating..already done updating zap callgroup, pickupgroup..not needed checking for delay_answer field ..already exists checking for reversal field ..already exists checking for pricid field ..already exists Migrating pickup groups to named pickup groups Migrating call groups to named call groups Checking if trunk table migration required..not needed Checking if privacy manager options exists..already exists Checking for noanswer_cid field..already exists Checking for busy_cid field..already exists Checking for chanunavail_cid field..already exists Checking for noanswer_dest field..already exists Checking for busy_dest field..already exists Checking for chanunavail_dest field..already exists Unable to add index to extensions field in users Checking for General Setting migrations..not needed Deleting unused globals..done Converting IAX notransfer to transfer if needed..updated 0000 records deleting obsoleted record_in and record_out entries..ok checking for dest field in outbound_routes..already exists checking for continue field in trunks..already exists upgrading any zap trunks to dahdi if found..ok Checking for possibly invalid emergency caller id fields..none found Generating CSS...Done Module core successfully installed Updating Hooks...Done |
[root@xxxxxx ~]# fwconsole ma downloadinstall <url> No repos specified, using: [standard,commercial] from last GUI settings Starting core download.. Processing core Downloading... 3076094/3076094 [============================] 100% Finished downloading Extracting...Done Module core successfully downloaded Checking if directdids need migrating..already done updating zap callgroup, pickupgroup..not needed checking for delay_answer field ..already exists checking for reversal field ..already exists checking for pricid field ..already exists Migrating pickup groups to named pickup groups Migrating call groups to named call groups Checking if trunk table migration required..not needed Checking if privacy manager options exists..already exists Checking for noanswer_cid field..already exists Checking for busy_cid field..already exists Checking for chanunavail_cid field..already exists Checking for noanswer_dest field..already exists Checking for busy_dest field..already exists Checking for chanunavail_dest field..already exists Unable to add index to extensions field in users Checking for General Setting migrations..not needed Deleting unused globals..done Converting IAX notransfer to transfer if needed..updated 0000 records deleting obsoleted record_in and record_out entries..ok checking for dest field in outbound_routes..already exists checking for continue field in trunks..already exists upgrading any zap trunks to dahdi if found..ok Checking for possibly invalid emergency caller id fields..none found Generating CSS...Done Module core successfully installed Updating Hooks...Done |
|
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:
|
|
Add Mapping to Extension Mapping
# fwconsole epm addmapping 4101 --brand=sangoma --mac=005058500002 --template=sangomatest --model=S700 --account=account1 Extension 4101 added successfully. |
List Extensions
# fwconsole epm listextensions ALL +-----------+-------------+--------------+------------------+----------+----------+-------------+---------+---------------------+ | Extension | Brand | MAC | Template | Model | Account | Expansion 1 | Rebuild | VPN | +-----------+-------------+--------------+------------------+----------+----------+-------------+---------+---------------------+ | 1012 | Grandstream | 000B82800001 | grandstream-test | GXP-2170 | account1 | | 1 | | | 4101 | sangoma | 005058500003 | sangomatest | | account1 | | | | | 4102 | Yealink | 001565211111 | yealink-base | SIP-T26P | account1 | EXP38-1 | 1 | | | 4103 | Sangoma | 005058500001 | sangomatest | S500 | account1 | EXP100-1 | 1 | 4103 - 4103 (ID: 4) | | 4104 | Sangoma | 005058500002 | sangomatest | S700 | account1 | | 1 | | +-----------+-------------+--------------+------------------+----------+----------+-------------+---------+---------------------+ # fwconsole epm listextensions ALL --detail +-----------+-------------+--------------+------------------+----------+----------+-----------+-------------+-------------+-------------+-------------+-------------+-------------+------------------+-----------+---------+---------------------+------------+------------+------------+-----------+ | Extension | Brand | MAC | Template | Model | Account | Accessory | Expansion 1 | Expansion 2 | Expansion 3 | Expansion 4 | Expansion 5 | Expansion 6 | BLF Substitution | BLF Label | Rebuild | VPN | Repeater 1 | Repeater 2 | Repeater 3 | Multicell | +-----------+-------------+--------------+------------------+----------+----------+-----------+-------------+-------------+-------------+-------------+-------------+-------------+------------------+-----------+---------+---------------------+------------+------------+------------+-----------+ | 1012 | Grandstream | 000B82800001 | grandstream-test | GXP-2170 | account1 | | | | | | | | | | 1 | | | | | | | 4101 | sangoma | 005058500003 | sangomatest | | account1 | | | | | | | | | | | | | | | | | 4102 | Yealink | 001565211111 | yealink-base | SIP-T26P | account1 | | EXP38-1 | | | | | | None | | 1 | | | | | | | 4103 | Sangoma | 005058500001 | sangomatest | S500 | account1 | | EXP100-1 | EXP100-2 | EXP100-3 | EXP100-4 | EXP100-5 | EXP100-6 | None | | 1 | 4103 - 4103 (ID: 4) | | | | | | 4104 | Sangoma | 005058500002 | sangomatest | S700 | account1 | | | | | | | | | | 1 | | | | | | +-----------+-------------+--------------+------------------+----------+----------+-----------+-------------+-------------+-------------+-------------+-------------+-------------+------------------+-----------+---------+---------------------+------------+------------+------------+-----------+ |
List Templates
# fwconsole epm listtemplates +-------------+----------------------+-------------+-----------+----------------+-------------------+--------------------+----------+------------------+------------------+ | Brand | Template Name | Destination | Time Zone | Provision Type | Provision Address | Background | Firmware | Internal Default | External Default | +-------------+----------------------+-------------+-----------+----------------+-------------------+--------------------+----------+------------------+------------------+ | grandstream | grandstream-test | 10.100.0.3 | -06:00 | TFTP | 10.100.0.3 | digit-on-phone.png | 1.14 | | | | sangoma | sangomatest | 10.100.0.3 | -06:00 | HTTP | 10.100.0.3 | digit-on-phone.png | 1.23 | | | | yealink | yealink-base | 10.100.0.3 | -06:00 | TFTP | 10.100.0.3 | sangomapad.png | 1.16 | Yes | Yes | +-------------+----------------------+-------------+-----------+----------------+-------------------+--------------------+----------+------------------+------------------+ |
Reboot Devices
# fwconsole epm reboot 4103 Only works for Sangoma phones Extension 4103 sent reboot command. # fwconsole epm reboot sangomatest Only works for Sangoma phones Extension 4103 sent reboot command Extension 4104 sent reboot command Extension 4101 sent reboot command |
Rebuild Configuration Files
# fwconsole epm rebuild 4103 Extension 4103 rebuilt # fwconsole epm rebuild sangomatest Extension 4103 rebuilt Extension 4104 rebuilt Extension 4101 rebuilt |
Rebuild and Update Devices
# fwconsole epm rebuildupdate 4103 Extension 4103 rebuilt Update command sent to 4103 # fwconsole epm rebuildupdate sangomatest Extension 4103 rebuilt Extension 4104 rebuilt Extension 4101 rebuilt Update command sent to 4103 Update command sent to 4104 Update command sent to 4101 |
Remove Devices
# fwconsole epm remove 4103 4103 removed succesfully |
Update Devices
# fwconsole epm update 4103 Update command sent to 4103 # fwconsole epm update sangomatest Update command sent to 4103 Update command sent to 4104 Update command sent to 4101 |
|
List Notifications
[root@freepbxdev1 faxpro]# fwconsole notification --list +---------------+-------------------------+----------------------------------------------------------+ | Module | ID | Text | +---------------+-------------------------+----------------------------------------------------------+ | freepbx | FW_UNSIGNED | You have 95 unsigned modules | | freepbx | NEWUPDATES | There are 3 modules available for online upgrades | | cron_manager | EXECFAIL | Cronmanager encountered 1 Errors | | dahdiconfig | etcdahdimodules | File /etc/dahdi/modules is not owned by asterisk | | dahdiconfig | etcdahdisystem.conf | File /etc/dahdi/system.conf is not owned by asterisk | | dahdiconfig | etcmodprobe.ddahdi.conf | File /etc/modprobe.d/dahdi.conf is not owned by asterisk | | freepbx | modules_disabled | You have 10 disabled modules | | cidlookup | noauth | OpenCNAM Requires Authentication | | fax | invalid_email | Invalid Email for Inbound Fax | | freepbx | NEWMODS | 1 New modules are available | | retrieve_conf | SYMLINKNOTICE | Symlink Conflict Resolved | | sipstationdid | ss7149223196 | SIPSTATION DID routed | +---------------+-------------------------+----------------------------------------------------------+ |
[root@freepbxdev1 faxpro]# fwconsole notification --list --json [["freepbx","FW_UNSIGNED","You have 95 unsigned modules"],["freepbx","NEWUPDATES","There are 3 modules available for online upgrades"],["cron_manager","EXECFAIL","Cronmanager encountered 1 Errors"],["dahdiconfig","etcdahdimodules","File \/etc\/dahdi\/modules is not owned by asterisk"],["dahdiconfig","etcdahdisystem.conf","File \/etc\/dahdi\/system.conf is not owned by asterisk"],["dahdiconfig","etcmodprobe.ddahdi.conf","File \/etc\/modprobe.d\/dahdi.conf is not owned by asterisk"],["freepbx","modules_disabled","You have 10 disabled modules"],["cidlookup","noauth","OpenCNAM Requires Authentication"],["fax","invalid_email","Invalid Email for Inbound Fax"],["freepbx","NEWMODS","1 New modules are available"],["retrieve_conf","SYMLINKNOTICE","Symlink Conflict Resolved"],["sipstationdid","ss7149223196","SIPSTATION DID routed"]] |
Delete notification (by ID)
[root@freepbxdev1 faxpro]# fwconsole notification --delete dahdiconfig etcdahdimodules Deleting notification Notification Deleted [root@freepbxdev1 faxpro]# fwconsole notification --list +---------------+-------------------------+----------------------------------------------------------+ | Module | ID | Text | +---------------+-------------------------+----------------------------------------------------------+ | freepbx | FW_UNSIGNED | You have 95 unsigned modules | | freepbx | NEWUPDATES | There are 3 modules available for online upgrades | | cron_manager | EXECFAIL | Cronmanager encountered 1 Errors | | dahdiconfig | etcdahdisystem.conf | File /etc/dahdi/system.conf is not owned by asterisk | | dahdiconfig | etcmodprobe.ddahdi.conf | File /etc/modprobe.d/dahdi.conf is not owned by asterisk | | freepbx | modules_disabled | You have 10 disabled modules | | cidlookup | noauth | OpenCNAM Requires Authentication | | fax | invalid_email | Invalid Email for Inbound Fax | | freepbx | NEWMODS | 1 New modules are available | | retrieve_conf | SYMLINKNOTICE | Symlink Conflict Resolved | | sipstationdid | ss7149223196 | SIPSTATION DID routed | +---------------+-------------------------+----------------------------------------------------------+ |
|
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 data
[root@freepbxdev1 framework]# fwconsole pagingpro --clean --verbose Found scheduled page for ID 500 occuring at 1466527800 |
List active scheduled pages
[root@freepbxdev1 framework]# fwconsole pagingpro --list +---------+------------+-------------+ | Page ID | Time | Cron Exists | +---------+------------+-------------+ | 500 | 1466527800 | Yes | +---------+------------+-------------+ |
List specific scheduled page by id
[root@freepbxdev1 framework]# fwconsole pagingpro --list 500 +---------+------------+-------------+ | Page ID | Time | Cron Exists | +---------+------------+-------------+ | 500 | 1466527800 | Yes | +---------+------------+-------------+ |
Execute a scheduled page immediately (for testing) using the paging pro page scheduler processes
[root@freepbxdev1 framework]# fwconsole pagingpro --execute 500 [root@freepbxdev1 framework]# <phones should be ringing> |
|
Get statuses of BLF lights for extension
[root@freepbxdev1 restapps]# fwconsole phoneapps blf 12000 +-----------------+------------+ | ID | BLF Status | +-----------------+------------+ | Call Forward | Inactive | | Conference | Inactive | | DND | Inactive | | Follow Me | Active | | Parking | Inactive | | Queues | Inactive | | Queue Agent | Active | | Time Conditions | Inactive | | Voicemail | Active | | Call Flow | Inactive | +-----------------+------------+ |
Get status of BLF lights for single Application
[root@freepbxdev1 restapps]# fwconsole phoneapps blf 12000 "Parking" +---------+------------+ | ID | BLF Status | +---------+------------+ | Parking | Inactive | +---------+------------+ |
Get more information about said hint by adding "--verbose"
[root@freepbxdev1 restapps]# fwconsole phoneapps blf 12000 "Call Flow" --verbose +-----------+------------+------------------+ | ID | BLF Status | Hint | +-----------+------------+------------------+ | Call Flow | Inactive | Custom:DAYNIGHT0 | +-----------+------------+------------------+ |
Used to manage background/long running processes
|
List Processes
[root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+--------+----------+---------------------+-----+----------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+--------+----------+---------------------+-----+----------+ | xmpp | 8495 | online | 0 | 6 hours, 29 minutes | 0% | 218.13MB | | restapps | 8665 | online | 0 | 6 hours, 29 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 29 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 28 minutes | 0% | 73.53MB | | qcallback | 16218 | online | 30 | 5 hours, 54 minutes | 0% | 29.59MB | +--------------+-------+--------+----------+---------------------+-----+----------+ |
Stop Process
[root@freepbxdev1 ~]# fwconsole pm2 --stop xmpp Process Stopped [root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+---------+----------+---------------------+-----+---------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+---------+----------+---------------------+-----+---------+ | xmpp | 0 | stopped | 0 | 0 | 0% | 0.00B | | restapps | 8665 | online | 0 | 6 hours, 30 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 30 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 29 minutes | 0% | 73.54MB | | qcallback | 16218 | online | 30 | 5 hours, 55 minutes | 0% | 29.59MB | +--------------+-------+---------+----------+---------------------+-----+---------+ |
Restart Process
[root@freepbxdev1 ~]# fwconsole pm2 --restart xmpp Process Restarted [root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+--------+----------+---------------------+------+----------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+--------+----------+---------------------+------+----------+ | xmpp | 8299 | online | 0 | 4 seconds | 102% | 117.13MB | | restapps | 8665 | online | 0 | 6 hours, 30 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 30 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 29 minutes | 0% | 73.54MB | | qcallback | 16218 | online | 30 | 5 hours, 56 minutes | 0% | 29.59MB | +--------------+-------+--------+----------+---------------------+------+----------+ |
Delete Process (Only removes and stops it from the Process Management Module, does not remove the module itself)
[root@freepbxdev1 ~]# fwconsole pm2 --delete xmpp Process Stopped and Deleted [root@freepbxdev1 ~]# fwconsole pm2 --list +--------------+-------+--------+----------+---------------------+-----+---------+ | Process Name | PID | Status | Restarts | Uptime | CPU | Mem | +--------------+-------+--------+----------+---------------------+-----+---------+ | restapps | 8665 | online | 0 | 6 hours, 31 minutes | 0% | 47.63MB | | zulu | 8825 | online | 0 | 6 hours, 31 minutes | 0% | 94.29MB | | ucpnode | 10048 | online | 0 | 6 hours, 30 minutes | 0% | 73.55MB | | qcallback | 16218 | online | 30 | 5 hours, 56 minutes | 0% | 29.59MB | +--------------+-------+--------+----------+---------------------+-----+---------+ |
Tail log (Used to tail logs for an application/process)
[root@freepbxdev1 ~]# fwconsole pm2 --log restapps --lines 20 OUT > ==> /var/log/asterisk/restapps_err.log <== ==> /var/log/asterisk/restapps_out.log <== 2017-04-12 01:34 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 01:34 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-presencestate] Setting button linekeys:14 to IN_USE 2017-04-12 01:48 -04:00: [8665][1001-parking] Setting button linekeys:13 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-findmefollow] Setting button linekeys:11 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-donotdisturb] Setting button linekeys:10 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 01:48 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-presencestate] Setting button linekeys:14 to IN_USE 2017-04-12 02:02 -04:00: [8665][1001-parking] Setting button linekeys:13 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-findmefollow] Setting button linekeys:11 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-donotdisturb] Setting button linekeys:10 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 02:02 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-presencestate] Setting button linekeys:14 to IN_USE 2017-04-12 02:17 -04:00: [8665][1001-parking] Setting button linekeys:13 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-findmefollow] Setting button linekeys:11 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-donotdisturb] Setting button linekeys:10 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-conferences] Setting button linekeys:8 to NOT_INUSE 2017-04-12 02:17 -04:00: [8665][1001-callforward] Setting button linekeys:7 to NOT_INUSE |
Update PM2 (Used to update the PM2 binary in memory, this will stop all applications to update the PM2 library!)
[root@freepbxdev1 ~]# fwconsole pm2 --update Be sure to have the latest version by doing `npm install pm2@latest -g` before doing this procedure. [PM2] Saving current process list... [PM2] Stopping PM2... [PM2] Applying action deleteProcessId on app [all](ids: 1,2,3,4) [PM2] [ucpnode](3) ✓ [PM2] [restapps](1) ✓ [PM2] [qcallback](4) ✓ [PM2] [zulu](2) ✓ [PM2] All processes have been stopped and deleted [PM2] PM2 stopped [PM2] Spawning PM2 daemon with pm2_home=/home/asterisk/.pm2 [PM2] Restoring processes located in /home/asterisk/.pm2/dump.pm2 [PM2] Process /usr/src/freepbx/restapps/restapps.php restored [PM2] Process /usr/src/freepbx/zulu/node/index.js restored [PM2] Process /usr/src/freepbx/ucpnode/node/index.js restored [PM2] Process /usr/src/freepbx/vqplus/queue-callback.php restored >>>>>>>>>> PM2 updated ┌───────────┬────┬──────┬──────┬────────┬─────────┬────────┬──────┬───────────┬──────────┐ │ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │ ├───────────┼────┼──────┼──────┼────────┼─────────┼────────┼──────┼───────────┼──────────┤ │ qcallback │ 3 │ fork │ 9316 │ online │ 0 │ 0s │ 46% │ 18.5 MB │ disabled │ │ restapps │ 0 │ fork │ 9289 │ online │ 0 │ 0s │ 168% │ 33.4 MB │ disabled │ │ ucpnode │ 2 │ fork │ 9305 │ online │ 0 │ 0s │ 59% │ 15.1 MB │ disabled │ │ zulu │ 1 │ fork │ 9295 │ online │ 0 │ 0s │ 71% │ 17.8 MB │ disabled │ └───────────┴────┴──────┴──────┴────────┴─────────┴────────┴──────┴───────────┴──────────┘ Use `pm2 show <id|name>` to get more details about an app Update PM2 Process |
Reload Log file pointers (used during logrotates)
[root@uc-85436011 ~]# fwconsole pm2 --reload-logs All logs reloaded |
Used to alter Advanced Settings from the bash prompt:
|
|
Get Activation Information
[root@freepbxdev1 faxpro]# fwconsole sysadmin info Activation Status: Zend ID: M:XXXXX-XXXXX-XXXXX-XXXXX Lic File: Present Deployment: freepbxdev1 |
Update the license file on your installation
[root@freepbxdev1 faxpro]# fwconsole sysadmin update Updating license for freepbxdev1 Done! No changes from original Licence. |
Activate system using your deploymentid
[root@freepbxdev1 faxpro]# fwconsole sysadmin activate <deploymentid> |
interactive toggle
[root@pbx ~]# fwconsole trunks Choose an ID to enable/disable +----+-------+---------------------+----------+ | ID | TECH | Channel ID | Disabled | +----+-------+---------------------+----------+ | 1 | pjsip | flowroute | off | | 2 | sip | fpbx-1-QWm3eNC4UIDn | on | | 3 | sip | fpbx-2-QWm3eNC4UIDn | off | | 4 | pjsip | Telnyx | off | +----+-------+---------------------+----------+ [1] 1 [2] 2 [3] 3 [4] 4 > |
specifying a trunk to enable or disable
[root@pbx ~]# fwconsole trunks --enable 2 Enabling Trunk 2 Run fwconsole reload [root@pbx ~]# fwconsole trunks --disable 2 Disabling Trunk 2 Run fwconsole reload |
After enabling/disabling trunks, a reload is required for changes to be applied to the system.
This script will check your system to the best of it's ability |
Running Validate
[root@localhost freepbx-validate]# fwconsole validate Downloading... ============================ ============================ This script will check your system to the best of it's ability It should not be relied upon for complete validation Every hack is different. This just tries to discover and clean them up as best as possible Continue with this action?yes Scanning All files... [============================] 6 secs Found /var/www/html/admin/modules/cxpanel/main.log that shouldn't be there? System must be cleaned up before proceeding to the next step |
Cleaning your system:
[root@localhost freepbx-validate]# fwconsole validate --clean Downloading... ============================ ============================ This script will check your system to the best of it's ability It should not be relied upon for complete validation Every hack is different. This just tries to discover and clean them up as best as possible Continue with this action?yes Scanning All files... [============================] 6 secs Found /var/www/html/admin/modules/cxpanel/main.log that shouldn't be there? Purged File |
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.
Requests to weblate are limited to 100/day, without setting --authroization. See https://weblate.sangoma.com/accounts/profile/#api for more information. You will need to login to https://weblate.sangoma.com/accounts/profile/#api to get this token |
|
List Local Localizations
[root@Andrews15 voicemail]# fwconsole localization --list +---------------------------------------+----------------------+----------------------------------------------------------------------------------------------------------------+ | Module | Rawname | Languages | +---------------------------------------+----------------------+----------------------------------------------------------------------------------------------------------------+ | Framework | framework | bg_BG,cs,de_DE,es_ES,fa_IR,fr_FR,he_IL,hu_HU,it_IT,ja_JP,nl_NL,pt_BR,pt_PT,ro_RO,ru_RU,sv_SE,uk_UA,vi,zh_CN | | Preserve Accountcode | accountcodepreserve | | | Altaworx Skin | altaworxskin | en_US | | AMD | amd | es_ES | | Announcements | announcement | bg_BG,cs,de_DE,es_ES,fa_IR,fr_FR,he_IL,hu_HU,it_IT,ja_JP,nb_NO,nl_NL,pl,pt_BR,pt_PT,ru_RU,sv_SE,uk_UA,vi,zh_CN | | PBX API | api | es_ES | | Appointment Reminder | areminder | de_DE,es_ES,fa_IR,ja_JP | | Asterisk REST Interface Users | arimanager | bg_BG,de_DE,es_ES,fa_IR,fr_FR,he_IL,pl,pt_BR,pt_PT,ru_RU,vi,zh_CN | |
Update All Localizations
[root@freepbx ~]# fwconsole localization --update Processing framework framework[bg_BG] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[zh_CN] is already up to date framework[cs] is already up to date framework[nl_NL] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[fr_FR] will be updated (2017-03-13T18:33:00Z < 2018-05-07T18:33:00Z) framework[de_DE] will be updated (2018-10-22T20:01:00Z < 2018-10-24T20:01:00Z) framework[he_IL] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[hu_HU] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[it_IT] will be updated (2008-11-09T19:43:00Z < 2018-06-11T19:43:00Z) framework[ja_JP] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[fa_IR] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[pt_BR] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[pt_PT] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[ro_RO] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[ru_RU] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[es_ES] will be updated (2018-07-18T19:15:00Z < 2018-07-26T19:15:00Z) framework[sv_SE] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[uk_UA] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[vi] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) Finished Processing framework |
Update Localizations by Module
[root@freepbx ~]# fwconsole localization --update --module framework Processing framework framework[bg_BG] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[zh_CN] is already up to date framework[cs] is already up to date framework[nl_NL] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[fr_FR] will be updated (2017-03-13T18:33:00Z < 2018-05-07T18:33:00Z) framework[de_DE] is already up to date framework[he_IL] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[hu_HU] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[it_IT] will be updated (2008-11-09T19:43:00Z < 2018-06-11T19:43:00Z) framework[ja_JP] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[fa_IR] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[pt_BR] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[pt_PT] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[ro_RO] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[ru_RU] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[es_ES] will be updated (2018-07-18T19:15:00Z < 2018-07-26T19:15:00Z) framework[sv_SE] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[uk_UA] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) framework[vi] last change date unknown unable to determine last change. Skipping (Use --ignorechange to force) Finished Processing framework |
Update Localizations by Language
[root@freepbx ~]# fwconsole localization --update --language it_IT Processing framework framework[it_IT] will be updated (2008-11-09T19:43:00Z < 2018-06-11T19:43:00Z) Finished Processing framework |
Update Localizations by Module & Language
[root@freepbx ~]# fwconsole localization --update --module framework --language it_IT Processing framework framework[it_IT] will be updated (2008-11-09T19:43:00Z < 2018-06-11T19:43:00Z) Finished Processing framework |
# 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)
[root@58448910 modules]# fwconsole util resetastdb |