Installing From Source

From Starfish PBX Wiki

Jump to: navigation, search

This tutorial is not recommended to unexperienced users as it does not focus on a particular linux distribution and requires some previous knowledge on how asterisk / linux works. For less advanced users I would recommend installing the debian packages on a ubuntu system, you can find a link to the deb package on the main website's [download] page.


Contents

Prerequisites

Make sure you have this installed before going trough the tutorial:

  • subversion
  • apache or another php enabled web server
  • php
  • mysql
  • asterisk 1.4 or freeswitch

Getting the source

Since there are a lot of changes to the source code on daily basis as we don't have a stable release yet, I recommend downloading the sources directly from svn. By doing so you will assure you have the latest snapshot and you will be able to update files quicker. You will need subversion installed on you computer to do this.

cd /var/www/
svn co http://svn.starfish-pbx.org/trunk/ starfish-pbx

By running the previous command you should have starfish pbx sources in /var/www/starfish-pbx directory. Next we need to setup the database.

Make sure your web server has write permission to this directories:

/var/www/starfish-pbx/temp
/var/www/starfish-pbx/user/templates/compile
/var/www/starfish-pbx/backends/asterisk/generator/output

Setting up the database

There is a mysql dump for a clean database structure in the /database directory of the source tree, you can create the database using that script:

mysql -u root -p < /var/www/starfish-pbx/database/mysql-install.sql

If you want to change the database user or password setting you can create a 'include/config.local.php' file in the source tree directory. I don't recommend changing include/config.inc.php file if you want to submit svn diff patches to us as that file is handled by svn.

vi /var/www/starfish-pbx/include/config.local.php

and add this :
<?php
$conf['database']['user']      = '<YOUR DB USER>';
$conf['database']['password']  = '<YOUR DB PASSWORD>';
$conf['database']['host']      = 'localhost';
$conf['database']['database']  = 'starfishpbx';

Setting up the web server

Considering that your web servers has the document root on /var/www/ you should try to see if you can login to the web interface by now.

http://localhost/starfish-pbx/admin/
user: admin
password: demo


Setting up Asterisk

Starfish pbx generate the asterisk config files in /var/www/starfish-pbx/backends/asterisk/generator/output directory every time you make a change to the database and them automatically reload asterisk trough asterisk manager. So in order to finish up asterisk integration we will need to perform this steps

Create a Asterisk Manager User

Modify /etc/asterisk/manager.conf and add this:

[starfish]
secret=<SECRET_PASSWORD_HERE>
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

Then you should add this to /var/www/starfish-pbx/include/config.local.php

$conf['astman']['user']        = 'starfish';
$conf['astman']['password']    = '<SECRET_PASSWORD_HERE>';


Symlink Autogenerated Configuration Files

As I said before the auto generated config file are located in : /var/www/starfish-pbx/generator/output. For the beginning there may be only some file in there or none at all but we can trigger their creation from the command line:

cd /var/www/starfish-pbx/backends/asterisk/generator/
for file in *.conf.php;do php $file &>/dev/null ;done

The next step is to replace each file from asterisk config directory /etc/asterisk/ with a symlink to the corresponding file from the generator/output folder:

cdr_mysql.conf  extensions.conf  features.conf  iax.conf  meetme.conf  musiconhold.conf  queues.conf  sip.conf  voicemail.conf


Setting up Freeswitch

In order to get Starfish PBX work with Freeswitch you need to enable the xml_curl module first, so make sure you have uncommented it in conf/autoload_configs/modules.conf.xml:

     <load module="mod_xml_curl"/>


Second thing to do is to configure the xml_curl module, conf/autoload_configs/xml_curl.conf.xml :

<configuration name="xml_curl.conf" description="cURL XML Gateway">
       <bindings>
               <binding name="StarfishPBX">
                       <param name="gateway-url" value="http://127.0.0.1/starfish-pbx/backends/freeswitch/index.php" bindings="directory" />
               </binding>
               <binding name="StarfishPBX">
                       <param name="gateway-url" value="http://127.0.0.1/starfish-pbx/backends/freeswitch/index.php" bindings="dialplan" />
               </binding>
               <binding name="StarfishPBX">
                       <param name="gateway-url" value="http://127.0.0.1/starfish-pbx/backends/freeswitch/index.php" bindings="configuration" />
               </binding>
       </bindings>
</configuration>

That's all, restart Freeswitch and enjoy.

Personal tools