Archive:FreePBX Distribution: Difference between revisions

From ThinkServer
m Added IAX trunk problem, changed openSUSE version in URL
m Coded restart statement
Line 86: Line 86:
* 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 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.
* 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 (service asterisk restart).
* 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 00:30, 2 February 2014

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.

Installation

Packages Required

To implement the system, the following packages are required:

  • tftp
  • yast2-tftp-server
  • subversion
  • make
  • gcc
  • gcc-c++

From Asterisk repository (http://download.opensuse.org/repositories/network:/telephony:/asterisk-11/openSUSE_13.1/)

  • asterisk
  • asterisk-console
  • asterisk-dahdi
  • libasteriskssl1

Installing the TFTP server

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.

  1. Install from YaST both the tftp and yast2-tftp-server packages.
  2. Run from YaST under Network Services "TFTP Server".
  3. Change the toggle box to Enabled. This will make the TFTP server start at start-up. Then click OK.
  4. Files for the hard-phones can then be dropped into /srv/tftpboot/.

Installing the Asterisk server

  1. From YaST, select Software Management. Once this has started, select from the top menu Configuration and then click Repositories.
  2. When the Repositories screen comes up, click Add. Make sure Specify URL... and Download repository description files are both checked then select Next.
  3. 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.
  4. 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.
  5. 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.
  6. Find the Asterisk 11 repository that you just added from the list and click on it.
  7. Tick the packages that need to be installed from above in the Packages Required section above.
  8. Click Accept to install the packages. This will install the Asterisk server.
  9. When back in the YaST control panel, under System run System Services (Runlevel).
  10. Wait until all the ??? next to the services have changed to Yes or No.
  11. Find the asterisk (Asterisk PBX) service (this should be towards the top of the list) and click the line.
  12. Click Enable. No should change to Yes*. Then click OK.
  13. 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.
  14. To check that Asterisk is running, open a Terminal prompt and su as root. Run asterisk -rvvv and it should open a new command prompt for Asterisk. You can then type exit and exit the Terminal.
  15. If this says 'Cannot find remote Asterisk server', it may not have started or may not have installed properly. Type service asterisk start 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

  1. Make sure subversion is installed through YaST.
  2. Open a Terminal prompt and su as root. Change directory to a folder to download the Web GUI software to.
  3. Run svn co http://svn.asterisk.org/svn/asterisk-gui/branches/2.0/. This will download the latest development snapshot of the Web GUI software.
  4. Change directory to the new folder 2.0
  5. Run from the terminal ./configure. This will only take a moment, this step configures the package for your computer.
  6. Run from the terminal make. This will only take a moment, this step builds the packages for your computer.
  7. Run from the terminal make install This step actually installs the packages on the computer. Keep this Terminal window open as we will need this later to check the configuration.
  8. Open File Manager - Super User Mode. Then go to /etc/asterisk and open http.conf with KWrite.
  9. Comments in Asterisk configurations are marked with ;. Make sure enabled = yes, bindaddr = 127.0.0.1, bindport = 8088 and enablestatic = yes are uncommented. bindaddr = 127.0.0.1 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 bindaddr = 0.0.0.0. bindport can be change to your preference too. Once you have finished, save the file.
  10. Open from the File Manager manager.conf with KWrite. Make sure that enabled = no is changed to enabled = yes. Uncomment webenabled = yes, port = 5038 and bindaddr = 0.0.0.0.
  11. 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:
    [<admin>] (This is the admin username)
    secret = <your-password-here>
    read = all
    write = all
    Once you have added your user, save the file.
  12. 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 asterisk and the group to asterisk then click OK. This will need to be done to the asterisk folder in /etc too.
  13. In the File Manager, goto /usr/share/asterisk. There should be a folder called static-http. Delete this folder as this is no longer needed.
  14. Right click in a space in the folder. Goto Create New > then Basic link to file or directory... In the File name:, type static-http. In the Enter path to file or directory:, type or find /var/lib/asterisk/static-http/.
  15. In the File Manager, goto /var/lib/asterisk/. 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.
  16. Now go back to the Terminal prompt left open. Run service asterisk restart to restart Asterisk and enable the Web GUI. Run make checkconfig. 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.
  17. You can now type make checkconfig 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

  1. 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 manager.conf earlier. You should now be presented with Asterisk's status page.
  2. 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 (service asterisk restart).