amportal commands

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.  

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 "amportal" commands:

 

Restart

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

[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.

[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

[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.

  • 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.

Database

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

Manager Resync

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

UCP

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

options:

Enable All

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

Session Unlock

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

 

 Highlight the bottom corner of the login box to get the session id for your browser.

User Manager

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

options:

Enable All

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

Return to Documentation Home I Return to Sangoma Support