Archive:FreePBX Distribution: Difference between revisions

From ThinkServer
m Coded restart statement
Started new article for Asterisk
Line 1: Line 1:
Asterisk VoIP server is a fully fledged VoIP allowing complete customisation to your needs and works with most setups. It has a web GUI that is slowly being developed to make implementation even easier for people.
Asterisk VoIP server is a fully fledged VoIP allowing complete customisation to your needs and works with most setups. It has a web GUI that is slowly being developed to make implementation even easier for people.


On the server, we have implemented Asterisk 11.x series. This is a very new version of Asterisk but is also a LTS release so will be supported well into the future with fixes (slated to be supported until 2016). We are also using the Web GUI from the Subversion repository to make sure it is up to date.
On the server, we have implemented AsteriskNOW! 6.12.65-26 distribution and Asterisk 13.x series. This is the latest version of Asterisk and is a LTS release so will be supported well into the future with fixes (slated to be supported until 2018). This is a complete distribution and so needs to be installed on a machine. We will be using Linux tools to install the distribution as a virtual machine.


== Installation ==
== Preparing the host machine ==
=== Packages Required ===


To implement the system, the following packages are required:
# With this method we need Intel VT-d extensions enabled so we can add the physical network card to the virtual machine
#* Enable Intel VT-d in the system BIOS. It may be called Intel Virtaulization Extensions or something similar. We must enabled both Intel VT-x and Intel VT-d. Intel VT-d is a later version of Intel VT-x and allows physical hardware to be taken over and used by a virtual machine and there other memory and performance enhancements also. Intel VT-d may only be available if you have a recent machine.
#* The extensions need to be enabled in the system kernel on the host machine as by default they are not enabled.
#** Login and open YaST. Type your root password if needed.
#** Under 'System', open 'Boot Loader'
#** Change to the 'Kernel Parameters' tab
#** After the last option on 'Optional Kernel Command Line Parameter', add <code>intel_iommu=on</code>.
#** Click 'Accept'
#** Reboot the machine
# Install Virtual Machine components.
#* Login and open YaST. Type your root password if needed.
#* Under 'Virtualization', click 'Install Hypervisor and Tools'
#* Under 'KVM Hypervisor', tick both 'KVM server' and 'KVM tools'
#* Click 'Accept'. The components will install.
#* When finished, reboot the machine as kernel components will have been changed.


* tftp
== Preparing the Virtual Machine ==
* yast2-tftp-server
* subversion
* make
* gcc
* gcc-c++


From Asterisk repository (http://download.opensuse.org/repositories/network:/telephony:/asterisk-11/openSUSE_13.1/)
# On the Kickstart Menu, type 'virt'. When displayed, open 'Virtual Machine Manager'
#


* asterisk
=== Installing AsteriskNOW! on the virtual machine ===
* asterisk-console
* asterisk-dahdi
* libasteriskssl1


* Checkout latest revision from http://svn.asterisk.org/svn/asterisk-gui/branches/2.0/ for Web GUI.
# On the host machine, download the latest 64-bit DVD image of AsteriskNOW! (http://www.asterisk.org/downloads/asterisknow}
 
# Attached the DVD images to a free optical drive on the virtual machine.
=== Installing the TFTP server ===
# Change the boot order so that the optical drive is at the top of the boot list.
 
# Start the virtual machine.
The TFTP server is what hard-phones use to download the settings files from the server. This step is not required if your not using hard-phones.
# When the boot menu appears, Under 'FreePBX 6.12.65 with Asterisk 13 - EXPERIMENTAL' header, select 'Full Install -- No RAID'.
 
#* Disregard the experimental header. When this version was released, Asterisk 13 was new and considered experimental. Once updated, Asterisk 13 is pretty mature and not considered experimental anymore.
# Install from YaST both the <code>tftp</code> and <code>yast2-tftp-server</code> packages.
# Once the system is booted, you will be presented with options to configure your network
# Run from YaST under Network Services "TFTP Server".
#* Make sure 'Enable IPv4 support' and 'Dynamic IP configuration (DHCP} are both selected.
# Change the toggle box to Enabled. This will make the TFTP server start at start-up. Then click OK.
#* Unselect 'Enable IPv6 support'
# Files for the hard-phones can then be dropped into <code>/srv/tftpboot/</code>.
#* Hit 'OK'
 
# On the next option, select the correct time zone
=== Installing the Asterisk server ===
#* As this virtual machine is installed on a Linux host, select 'System clock uses UTC'
 
#* Select Europe/London (tip: press 'E' on the keyboard to jump down to 'E' on the list.)
# From YaST, select Software Management. Once this has started, select from the top menu Configuration and then click Repositories.
#* Hit 'OK'
# When the Repositories screen comes up, click Add. Make sure Specify URL... and Download repository description files are both checked then select Next.
# On the next option, type in a password to use for the system.
# In Repository Name, type Asterisk 11. In URL, you will need the following URL: http://download.opensuse.org/repositories/network:/telephony:/asterisk-11/openSUSE_12.3/. Change the openSUSE version at the end of the link to your version of openSUSE. Then click Next.
# After you hit 'OK', the system will start to install. This may take a long while. The installer may look as though it has frozen at certain points. However it is important to be patient as a few of the packages take a long time to install.
# Click OK to return to the Software Management screen. It will ask you if you trust the key from this repository. This is an openSUSE project so make sure you push Trust.
# When the install is finished, the machine will reboot. When it comes up with the boot menu, this will be the installation discs boot menu.
# If you haven't used the Repositories filter before, you will need to click the View drop-down menu above the search box and then click Repositories. This will create a new Repositories tab and you won't have to do this step again. If you already have the Repositories tab, you can just click the tab.
#* 'Force Off' the virtual machine. This is safe as the machine is not fully running yet.
# Find the Asterisk 11 repository that you just added from the list and click on it.
#* From the boot order, remove the optical drive and make sure the hard drive is placed to the top.
# Tick the packages that need to be installed from above in the Packages Required section above.
#* Start the virtual machine again.
# Click Accept to install the packages. This will install the Asterisk server.
# On first boot, it will start downloading updates for FreePBX. This may take a while.
# When back in the YaST control panel, under System run System Services (Runlevel).
# Once finished, it will leave you at the command prompt. Type '<code>root</code>' for the username and the password you selected during install for password.
# Wait until all the ??? next to the services have changed to Yes or No.
# That's it, AsteriskNOW! is installed!
# Find the asterisk (Asterisk PBX) service (this should be towards the top of the list) and click the line.
# Click Enable. No should change to Yes*. Then click OK.
# It will now say 'Now the changes to runlevels will be saved.' Click Yes. This has just started the Asterisk server and made it start on each boot.
# To check that Asterisk is running, open a Terminal prompt and su as root. Run <code>asterisk -rvvv</code> and it should open a new command prompt for Asterisk. You can then type exit and exit the Terminal.
# If this says 'Cannot find remote Asterisk server', it may not have started or may not have installed properly. Type <code>service asterisk start</code> into the Terminal prompt. If you get no errors, it should have started and you can try the previous step again. If it says it can't find the service, it may not have installed properly and needs reinstalling again.
 
NOTE: If you are running openSuSE 12.3, there is a problem with the Runlevel YaST module where it will say the service is enabled but it won't actually enable this. Make sure your system is up to date to solve this problem! This does not affect later versions of openSUSE.
 
=== Installing the Web GUI ===
 
The Web GUI allows simple administration of the Asterisk server without fiddling around manually changing the contents of the folder.
 
Subversion revision 5220 as of writing this article
 
# Make sure <code>subversion</code> is installed through YaST.
# Open a Terminal prompt and su as root. Change directory to a folder to download the Web GUI software to.
# Run <code>svn co http://svn.asterisk.org/svn/asterisk-gui/branches/2.0/</code>. This will download the latest development snapshot of the Web GUI software.
# Change directory to the new folder <code>2.0</code>
# Run from the terminal <code>./configure</code>. This will only take a moment, this step configures the package for your computer.
# Run from the terminal <code>make</code>. This will only take a moment, this step builds the packages for your computer.
# Run from the terminal <code>make install</code> This step actually installs the packages on the computer. Keep this Terminal window open as we will need this later to check the configuration.
# Open File Manager - Super User Mode. Then go to <code>/etc/asterisk</code> and open <code>http.conf</code> with KWrite.
# Comments in Asterisk configurations are marked with <code>;</code>. Make sure <code>enabled = yes</code>, <code>bindaddr = 127.0.0.1</code>, <code>bindport = 8088</code> and <code>enablestatic = yes</code> are uncommented. <code>bindaddr = 127.0.0.1</code> can be adjusted to the IP address you'd like to access the GUI from. By default this is only the server itself for security. To allow access from any IP, you can change this to <code>bindaddr = 0.0.0.0</code>. <code>bindport</code> can be change to your preference too. Once you have finished, save the file.
# Open from the File Manager <code>manager.conf</code> with KWrite. Make sure that <code>enabled = no</code> is changed to <code>enabled = yes</code>. Uncomment <code>webenabled = yes</code>, <code>port = 5038</code> and <code>bindaddr = 0.0.0.0</code>.
# We need to add a user to this file. This is the admin user to the Web GUI. Add the following to the bottom of the file. <> denotes a field to change to your preference:<br><code>[<admin>]</code> (This is the admin username)<br><code>secret = <your-password-here></code><br><code>read = all</code><br><code>write = all</code><br>Once you have added your user, save the file.
# For the Web GUI to access the files, we need to give the permissions to Asterisk. Select all the files in the folder with Ctrl+A. Right click on any file and click Properties. On the permissions tab, change the user to <code>asterisk</code> and the group to <code>asterisk</code> then click OK. This will need to be done to the asterisk folder in <code>/etc</code> too.
# In the File Manager, goto <code>/usr/share/asterisk</code>. There should be a folder called <code>static-http</code>. Delete this folder as this is no longer needed.
# Right click in a space in the folder. Goto Create New > then Basic link to file or directory... In the File name:, type <code>static-http</code>. In the Enter path to file or directory:, type or find <code>/var/lib/asterisk/static-http/</code>.
# In the File Manager, goto <code>/var/lib/asterisk/</code>. Right-click on the folder and change the permissions to asterisk once again. Tick the Apply changes to all sub-folders and their contents. check box and click OK.
# Now go back to the Terminal prompt left open. Run <code>service asterisk restart</code> to restart Asterisk and enable the Web GUI. Run <code>make checkconfig</code>. This will check all your settings you have changed and make sure it is all working. If it says there are any problems, follow what it says to find the problem.
# You can now type <code>make checkconfig</code> into the terminal window you left open earlier. This will test the configuration and check that the web service is now running.
 
=== Using the Web GUI for the first time ===
 
# Once it has all been installed and Asterisk restarted, it can be accessed from http://127.0.0.1:8088/static/config/index.html in your web browser. Type in the user name and password you added to <code>manager.conf</code> earlier. You should now be presented with Asterisk's status page.
# It will need to change some of the configuration files so the Web GUI can configure them. Once this is done, it will log out and you'll have to log in again. This should only happen once.
 
=== Troubleshooting ===
 
* If after logging in, the browser loops checking Extensions.conf, this means there is a permissions problem somewhere. Double check you have made all the files accessible to the asterisk user and group.
* If after logging in, the browser stops at Checking write permissions for GUI folder, the basic link was not created properly during the installation. Make sure the basic link is created properly and pointing to the right place.
* Due to a problem with the packaged version for openSUSE, IAX will not connect to an IAX trunk on start up due to the network not being ready before Asterisk starts. This is solved by scheduling a task to restart the Asterisk service at start up (<code>service asterisk restart</code>).

Revision as of 23:45, 26 February 2016

Asterisk VoIP server is a fully fledged VoIP allowing complete customisation to your needs and works with most setups. It has a web GUI that is slowly being developed to make implementation even easier for people.

On the server, we have implemented AsteriskNOW! 6.12.65-26 distribution and Asterisk 13.x series. This is the latest version of Asterisk and is a LTS release so will be supported well into the future with fixes (slated to be supported until 2018). This is a complete distribution and so needs to be installed on a machine. We will be using Linux tools to install the distribution as a virtual machine.

Preparing the host machine

  1. With this method we need Intel VT-d extensions enabled so we can add the physical network card to the virtual machine
    • Enable Intel VT-d in the system BIOS. It may be called Intel Virtaulization Extensions or something similar. We must enabled both Intel VT-x and Intel VT-d. Intel VT-d is a later version of Intel VT-x and allows physical hardware to be taken over and used by a virtual machine and there other memory and performance enhancements also. Intel VT-d may only be available if you have a recent machine.
    • The extensions need to be enabled in the system kernel on the host machine as by default they are not enabled.
      • Login and open YaST. Type your root password if needed.
      • Under 'System', open 'Boot Loader'
      • Change to the 'Kernel Parameters' tab
      • After the last option on 'Optional Kernel Command Line Parameter', add intel_iommu=on.
      • Click 'Accept'
      • Reboot the machine
  2. Install Virtual Machine components.
    • Login and open YaST. Type your root password if needed.
    • Under 'Virtualization', click 'Install Hypervisor and Tools'
    • Under 'KVM Hypervisor', tick both 'KVM server' and 'KVM tools'
    • Click 'Accept'. The components will install.
    • When finished, reboot the machine as kernel components will have been changed.

Preparing the Virtual Machine

  1. On the Kickstart Menu, type 'virt'. When displayed, open 'Virtual Machine Manager'

Installing AsteriskNOW! on the virtual machine

  1. On the host machine, download the latest 64-bit DVD image of AsteriskNOW! (http://www.asterisk.org/downloads/asterisknow}
  2. Attached the DVD images to a free optical drive on the virtual machine.
  3. Change the boot order so that the optical drive is at the top of the boot list.
  4. Start the virtual machine.
  5. When the boot menu appears, Under 'FreePBX 6.12.65 with Asterisk 13 - EXPERIMENTAL' header, select 'Full Install -- No RAID'.
    • Disregard the experimental header. When this version was released, Asterisk 13 was new and considered experimental. Once updated, Asterisk 13 is pretty mature and not considered experimental anymore.
  6. Once the system is booted, you will be presented with options to configure your network
    • Make sure 'Enable IPv4 support' and 'Dynamic IP configuration (DHCP} are both selected.
    • Unselect 'Enable IPv6 support'
    • Hit 'OK'
  7. On the next option, select the correct time zone
    • As this virtual machine is installed on a Linux host, select 'System clock uses UTC'
    • Select Europe/London (tip: press 'E' on the keyboard to jump down to 'E' on the list.)
    • Hit 'OK'
  8. On the next option, type in a password to use for the system.
  9. After you hit 'OK', the system will start to install. This may take a long while. The installer may look as though it has frozen at certain points. However it is important to be patient as a few of the packages take a long time to install.
  10. When the install is finished, the machine will reboot. When it comes up with the boot menu, this will be the installation discs boot menu.
    • 'Force Off' the virtual machine. This is safe as the machine is not fully running yet.
    • From the boot order, remove the optical drive and make sure the hard drive is placed to the top.
    • Start the virtual machine again.
  11. On first boot, it will start downloading updates for FreePBX. This may take a while.
  12. Once finished, it will leave you at the command prompt. Type 'root' for the username and the password you selected during install for password.
  13. That's it, AsteriskNOW! is installed!