Skip navigation.
Home

Updated Installation Manual - Freeswitch on CentOs

Install Operating System

Install Centos 5.x. ( I Only Selected  Server, Server GUI Options ).  Then Did yum update and yum upgrade all sofware default dependacies to the latest versions.  This would upgraded a Centos 5.x to Cenos 5.4
Note:- please be sure to disable SELINUX

Install Required Software

  1. Install MySql, MySql-Server and  be sure to set the password for the root user.  Note:- please do not remove the “test database” or disable the “anonymous user access” at this time.
  2. Install Apache
  3. Install PHP & PHPMyAdmin (Optional but recommended)
  4. Install Freeswitch
    • Full instructions for installing Freeswitch may be found here http://wiki.freeswitch.org/wiki/Installation_Guide
    • If you’ll use sangoma Card or any other card that needs installing before Freeswitch is installed, please Install it’s dependencies and relevant Drivers, then install OpenZap in the case of WanPipe; so Freeswitch could build making provision for the sangoma wares.
    • You'll need to install the FreeSwitch Mod_Perl.  This is done by uncommenting the "mod_perl" line the in the Freeswitch modules.conf file.  You may be missing more dependencies.  A lot of systems need "gdbm-devel" and "db4-devel" installed.  (yum install gdbm-devel db4-devel
    • Install Freeswitch (make && make install)

3. Install dependencies of ASTPP, please see 3b.

3b. Using CPAN to install ASTPP dependencies

Note: ASTPP can take care of this for you a little later on.  I'll give you a command to run that will do most of this.

On the command line enter perl -MCPAN -e shell

cpan> install CPAN

cpan> reload cpan

cpan> install version Module::Build Class::Singleton DateTime::TimeZone DateTime::Locale Locale::gettext_pp Text::Template Locale::Country Locale::Language DBI DBD::mysql CGI Asterisk::AGI LWP::Simple URI::Escape POE::Component::Client::Asterisk::Manager Getopt::Long Data::Dumper Text::CSV Mail::Sendmail Email::Simple Time::DaysInMonth Data::Paginate HTML::Template HTML::Template::Expr

cpan> reload cpan

Then to be sure that much of the dependencies issues are handled, Install these through CPAN – you’ll notice I repeated some problematic modules just to be 110% sure.

cpan> install version Module::Build Class::Singleton DateTime::TimeZone

DateTime::Locale Locale::gettext_pp Text::Template Locale::Country

Locale::Language DBI DBD::mysql CGI Asterisk::AGI LWP::Simple

URI::Escape POE::Component::Client::Asterisk::Manager Getopt::Long

Data::Dumper Text::CSV Mail::Sendmail Email::Simple IO::Tty IO IO::All

DateTime Test::Pod MIME::Types POE::Test::Loops Storable Time::Zone Date::Parse Curses IO::String POE Params::Validate Sys::Syslog Log::Dispatch Test::Simple FCGI Email::Date::Format ExtUtils::CBuilder Set::Infinite DateTime::Set DateTime::Event::Recurrence DateTime::Incomplete Class::Data::Inheritable Locale::Country::Multilingual File::Slurp Template::Simple

Template::Plugin::DateTime Date::Language Date::Format Text::CSV_XS Term::ReadKey DateTime::Format::Strptime DBI::Shell Net::Daemon DBD::Mutiplex TimeDate Mail::Tools Asterisk::Manager Asterisk::Outgoing Asterisk::AGI Asterisk::Voicemail Template::Toolkit Date::Language Date::Format DateTime::Locale

Then

cpan> reload cpan

Then

cpan> exit

Then Test if CPAN installed the Modules by Running

perl -MXXXX -e 'print "installed!\n"'      - (the XXXX) is the Module name.

Note:- remove the anonymous user and test database from mysql.

4. Then install ASTPP.

i. Download a current copy of ASTPP from svn as indicated on:- http://www.astpp.org/?q=node/163

ii. I used this link :- https://astpp.svn.sourceforge.net/svnroot/astpp/trunk

Log in on your server as root on the target server then change to the usr/src directory

Now, Using the svn comand as follows :-

svn co https://astpp.svn.sourceforge.net/svnroot/astpp/trunk astpp

It should download and save it's self as "astpp" subdirectory.

Change to the astpp directory.

Note:- before proceeding, if your internet connection is poor, or if you got too many error warnings from CPAN or for any reason CPAN acted out; please repeat the process of modules installation via CPAN until the errors clear (You may rearriange the order i placed the modules if you get errors from CPAN ) or download and install manually from CPAN website. - You have my good wishes !

On the command line enter make resolve_perl_dep in the comand line.

It should output something like /usr/lib/perl5/X.X.X/CPAN/config.pm initialized   -( the X.X.X is the version of Perl installed on your server).

Then would request you make a choice of  being ready to do manual configuration, i entered no to run the configuration automatically

It runs for a while then stops with a notice mentioning that some prerequisites where not found, then asks "shall i follow them and prepend them to the queue of modules we are processing right now ?"

I selected "yes" by entering Yes and pressed enter.

It continued to run

Halting to ask for permission to proceed

Halting again to request permission to do a network test

In the process, it may delay while sending a report by mail

Please be careful to read the feed back from the system before answering yes or no.

Most of the request for feedbacks should be replied with yes confirmed with enter on the keyboard.

As a rule answer yes if queried for answer for queuing a task until later.

It should go well and install well with an echo "looks Good" and "writing Makefile for ASTPP" , .... etc.

But should not have any error message.

For a Freeswitch installation enter at the command line  make install_freeswitch

For an Asterisk based installation enter make install_asterisk

Then enter from the command line make samples

Then on the command line enter make install_samples

You should get  'install -m 644 -o root -g root ./samples/sample.astpp-config.conf  /var/lib/astpp-config.conf' as a feedback from the server.

It is now time to prepare the database and the inital configuration files.

To create the ASTPP database use the following commands as root on your system:

mysqladmin create astpp

This will have created a database called astpp. It's now time to populate that database with the necessary tables.

mysql -u root -p astpp < /(the path to astpp source directory on your server  )/sql/astpp-(most appropriate/recent date).sql

You will be prompted for your database root  user password.

If you do not currently have a cdr database, please create one by following these commands :

mysqladmin create asteriskcdrdb  (asterisk based installation)

 

Or

mysqladmin create freeswitchcdrbd  (freeswitch based installation)

mysql -u root -p freeswitchcdrdb < /(the path to astpp source directory on your server)/sql/cdrdb-2009-10-05.sql ( for asterisk installation substitute “freeswitchcdrdb” with “asteriskcdrdb”)

You will be prompted for your database root user  password.

If you do not currently have freeswitch database and you want to use it to authenticate users please create one by following these commands:

mysqladmin create freeswitch

mysql -u root -p freeswitch < (freeswitch source directory) /contrib/intralanman/PHP/fs_curl/sql/(appropriate sql file)

You will be prompted for the password.

Note:- If you get errors, then you may have to load this manually as some versions of mysql would generate syntax errors.

Create a user other than "root"

Grant all privileges to all the databases (astpp, etc ) to the user you've just created

Set password for this user

Once these databases have been created please be sure to edit /var/lib/astpp/astpp-config.conf

to update your database connection information. - Please enter your astpp database access credentials only !.

10. Now you need to add these lines to cron:

@hourly /usr/local/astpp/astpp-update-balance.pl

@daily /usr/local/astpp/astpp-update-balance.pl sweep=0

0 0 * * 0 /usr/local/astpp/astpp-update-balance.pl sweep=1

0 0 1 * * /usr/local/astpp/astpp-update-balance.pl sweep=2

0 0 1 1,4,7,10 * /usr/local/astpp/astpp-update-balance.pl sweep=3

0 0 * 1,7 * /usr/local/astpp/astpp-update-balance.pl sweep=4

0 0 * 1 * /usr/local/astpp/astpp-update-balance.pl sweep=5

@daily /usr/local/astpp/astpp-rate-engine.pl runtype=sweep

@daily /usr/local/astpp/astpp-generate-invoices.pl sweep=0

0 0 * * 0 /usr/local/astpp/astpp-generate-invoices.pl sweep=1

0 0 1 * * /usr/local/astpp/astpp-generate-invoices.pl sweep=2

0 0 1 1,4,7,10 * /usr/local/astpp/astpp-generate-invoices.pl sweep=3

0 0 * 1,7 * /usr/local/astpp/astpp-generate-invoices.pl sweep=4

0 0 * 1 * /usr/local/astpp/astpp-generate-invoices.pl sweep=5

11. Manually install the script to rotate the cdrs. "cp /( freeswitch source Directory )/contrib/wasim/cdrload.pl /usr/local/astpp" then add the following line to crontab:

* * * * * /usr/local/astpp/cdrload.pl

12. Visit the astpp admin page in your web browser. It can be found here: http://server_ip/cgi-bin/astpp-admin/astpp-admin.cgi Please change the ip address depending upon your box. The default password is " Passw0rd! ". you do not need to enter username.

Then configure the remaining database connection details from the Admin GUI, You may setup the brands and routes etc.

14. You will need to run astpp-rate-engine.pl to rate the calls. It can be run either from a cron job or in realtime.

15. If you want your logo on the pages put it in a file called logo.jpg in your webservers _astpp directory.

16. Follow other instructions on the astpp.org site for config, etc.

17. You are on your own now !