Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This page refers to systems running PBX version 12 and earlier, which are now end of life. Please see this this page for current systems: fwconsole commands (13+), and additionally this page for FreePBX 15+ fwconsole commands (15+)

"amportal" is the Linux command that controls FreePBX from the Linux command prompt.  

...

amportal 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

Code Block
[root@localhost ~]# amportal restart
Please wait...
STOPPING ASTERISK
Waiting for Asterisk to Stop Gracefully...
Asterisk Stopped
SETTING FILE PERMISSIONS
Permissions OK
STARTING ASTERISK
Asterisk Started
[root@localhost ~]#
  
[root@localhost ~]# amportal stop
Please wait...
STOPPING ASTERISK
Waiting for Asterisk to Stop Gracefully...
Asterisk ended with exit status 0
Asterisk shutdown normally.
Asterisk Stopped
[root@localhost ~]#
  
[root@localhost ~]# amportal start
Please wait...
SETTING FILE PERMISSIONS
Permissions OK
STARTING ASTERISK
Asterisk Started
[root@localhost ~]#

Chown

amportal chown- This will change ownership of all files and directories that FreePBX needs to be owned by the apache user.

Code Block
[root@localhost ~]# amportal chown
Please wait...
SETTING FILE PERMISSIONS
Permissions OK
[root@localhost ~]#

Reload

amportal a r- 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

Code Block
[root@localhost ~]# amportal a r
Please wait...
Successfully reloaded
[root@localhost ~]#

Unlock

amportal a u xxxxxxxxxxxxxxxx- The amportal a u 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.

...

amportal a m- This will log you into the mysql database as the FreePBX user automatically for you based on the username and password for MySQL in /etc/freepbx.conf

Code Block
[root@localhost ~]# amportal a m
Please wait...
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 629
Server version: 5.1.61-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

Manager Resync

amportal a s- This will resync the credentials between FreePBX and /etc/asterisk/manager.conf, then it will restart Asterisk

Code Block
[root@localhost ~]# amportal a s
Fetching FreePBX settings with gen_amp_conf.php..
Manager ReSynced, restarting Asterisk

UCP

usage: amportal (admin|a) ucp <option>

...

enableall|en: Enables UCP login for all User Manager users

Code Block
[root@localhost ~]# amportal a ucp enableall
Fetching FreePBX settings with gen_amp_conf.php..
All Users have been successfully enabled!

Session Unlock

unlock|u: Allows remote session unlock in UCP. Ex: amportal a ucp u <user> <session>

...

migrate|m: Migrates all users from Voicemail.conf into Usermanager

Code Block
[root@localhost ~]# amportal a userman m
 
Fetching FreePBX settings with gen_amp_conf.php..
 
Starting to migrate Voicemail users
Voicemail User 'demo' already has '1002' as it's default extension. Skipping
Voicemail User 'anagy' already has '1000' as it's default extension. Skipping
Added 1003 with password of 55555
 
Now run: amportal a ucp enableall
To give all users access to UCP