FreePBX 2.11 w/ Asterisk 11

75 posts / 0 new
Last post
Steel Reign
Steel Reign's picture
FreePBX 2.11 w/ Asterisk 11

Well first let me start out by saying I love FreePBX over any other Asterisk GUI. That said, why is it so damn hard to find any good documentation on how to install it on Ubuntu (12.04) or any other OS other then CentOS? Every website that I search has a different set of instructions and which none of them work.

Is it really that difficult to have a site that has !COMPLETE! How to's on a few major distros?

I am mean COMPLETE!!! As in Dependencies (sqlite3, mysql,PHP5, etc..), Asterisk, DAHDI, LibPRI, FreePBX,

I think this would be a great help to many people out there would benefit greatly from this, including myself. I am even willing to help.

Now that I got that out. I have Asterisk 11 installed on Ubuntu 12.04LTS.

What dependencies do I need to fulfill and how do I configure FreePBX 2.11 beta to work with Asterisk and SQLite3? other then ./start_asterisk start and ./install_amp?

Any info would be greatly appreciated.

Steel Reign
Steel Reign's picture
Stuck here

Right now I am stuck here:

root@LinuxTestVM:/usr/src/freepbx-2.11.0beta1# ./install_amp
Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking user..OK
Checking if Asterisk is running..running with PID: 891..OK
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..parsed amp_conf variables from /etc/amportal.conf:
amp_conf [AMPDBHOST] => [localhost]
amp_conf [AMPDBENGINE] => [sqlite3]
amp_conf [AMPENGINE] => [asterisk]
amp_conf [AMPMGRUSER] => [admin]
amp_conf [AMPMGRPASS] => [amp111]
amp_conf [AMPBIN] => [/var/lib/asterisk/bin]
amp_conf [AMPSBIN] => [/usr/local/sbin]
amp_conf [AMPWEBROOT] => [/var/www/html]
amp_conf [AMPCGIBIN] => [/var/www/cgi-bin ]
amp_conf [FOPWEBROOT] => [/var/www/html/panel]
amp_conf [FOPPASSWORD] => [passw0rd]
amp_conf [AUTHTYPE] => [database]
amp_conf [AMPEXTENSIONS] => [extensions]
amp_conf [AMPDBUSER] => [asteriskuser]
amp_conf [AMPDBPASS] => [passw0rd]
amp_conf [AMPWEBADDRESS] => [192.168.1.1]
amp_conf [AMPDBNAME] => [asterisk]
amp_conf [ASTETCDIR] => [/etc/asterisk]
amp_conf [ASTMODDIR] => [/usr/lib/asterisk/modules]
amp_conf [ASTVARLIBDIR] => [/var/lib/asterisk]
amp_conf [ASTAGIDIR] => [/var/lib/asterisk/agi-bin]
amp_conf [ASTSPOOLDIR] => [/var/spool/asterisk]
amp_conf [ASTRUNDIR] => [/var/run/asterisk]
amp_conf [ASTLOGDIR] => [/var/log/asterisk]
OK
Checking for /etc/asterisk/asterisk.conf..OK
Reading /etc/asterisk/asterisk.conf..OK
Using asterisk as PBX Engine
Checking for Asterisk version..11.0.1
Checking for selinux..OK
Connecting to database..You must setup properly AMPDBFILE in /etc/amportal.conf

Anyone know how to solve this?

Steel Reign

tm1000
tm1000's picture
Did you import the tables

Did you import the tables from SQL into your database....

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
No...

This a new install. Do I have to do anything with SQLite other then just install it?

Steel Reign

dicko
dicko's picture
unless you know what you are

unless you know what you are doing I suggest you:-

AMPDBENGINE = mysql

after installing mysql server. sqlite is only needed for the replacement of berkleydb in newer asterii

You will also need to reconfigure the apache2 user from www-data to asterisk an the webroot to /var/www/html or (harder) change it in FreePBX install. harder as FreePBX still had some hardcoded Centos Based assumptions the last time I looked.

tm1000
tm1000's picture
As dicko said. sqlite is not

As dicko said. sqlite is not really fully tested. I would advise against it.

Senior Developer
Schmoozecom, INC

tm1000
tm1000's picture
Writing documentation takes

Writing documentation takes time. We have to either code or write documentation. You decide.

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
mysql???

i dont mind using mysql, but I am under the assumption that i have to use sqlite with asterisk 11. Is that not the case?

And for the record i prefer the coding part, but document part would be nice, just saying... heck I would even write them up for you if they gave me all the info.

Steel Reign

dicko
dicko's picture
Do not be tempted to use any

Do not be tempted to use any .deb's available in the repos, they put lots of things in the "wrong" place Smile

Compile manually in this order

libpri
dahdi
asterisk

don't forget make menuselect as you do asterisk or you won't get mp3 or mysql cdr's

tm1000
tm1000's picture
He/she has already complied

He/she has already complied asterisk

Senior Developer
Schmoozecom, INC

tm1000
tm1000's picture
sqlite is for the asterisk

sqlite is for the asterisk internal db. That is different from the freepbx storage db (which is usually mysql) Make sense?

Senior Developer
Schmoozecom, INC

dicko
dicko's picture
Document what you do , it

Document what you do , it will work in the end, I know as all my servers are Debian based.

Steel Reign
Steel Reign's picture
i dont use .deb's

I have a VM with Ubuntu 12.04LTS 64-bit and have complied DADHI, LibPRI, and, Asterisk 11 all from source. Asterisk is up and running and everything is good. The problem now is how to get FreePBX 2.11 installed and communicating with Asterisk 11.

Steel Reign

dicko
dicko's picture
I see that, but if "it" did

I see that, but if "it" did it in the wrong order then perhaps dependancies will fail without a real trace as to why ISDN or DAHDI is not working Wink

I'm just being rigorous.

Steel Reign
Steel Reign's picture
tm1000

yes it does. so I have to have both installed and use mysql for FreePBX 2.11. i will give it shot now,

Thanks.

Steel Reign

dicko
dicko's picture
For me following my previous

For me following my previous suggestions got it working, use mysql and change your apache2 configuration to be congruent with Centos thinking, you will save a lot of time .

Steel Reign
Steel Reign's picture
lol "it" is a dude...

Don't let the avatar fool you.

I have done everything in the correct order. As I mentioned before everything else is online. Just need to know what are the dep's for FreePBX 2.11 and if install procedures are the same. As in: ./start_asterisk start and ./install_amp

Steel Reign

dicko
dicko's picture
Well, Ubuntu uses a varient

Well, Ubuntu uses a varient on "standard" startup scripts (upstart) so you will need to make sure asterisk is running as asterisk:asterisk and you will have to contend with whether you use safe_asterisk or rely on your init script. There are quite a few steps to go yet.

dicko
dicko's picture
The deps for FreePBX are

The deps for FreePBX are basically a properly functioning LAMP stack, you sound like you have that already

Steel Reign
Steel Reign's picture
That's why...

some form of documentation would be great. This is not an easy process for someone trying to learn all this stuff. I do my research but there are so many conflicting answers out there that it would be awesome if there was a definitive guide as i mentioned before.

Steel Reign

tm1000
tm1000's picture
This is outdated but will

Senior Developer
Schmoozecom, INC

dicko
dicko's picture
To my knowledge there is not

To my knowledge there is not that beast, as tm1000 said we try to make it work but someone else will need to write the documentation.

I thought you offered to write the definitive guide Wink How is going so far?

Steel Reign
Steel Reign's picture
@dicko

and what exactly is part of that? looking for a response in something to the effect of:

aptitude install -y build-essential linux-headers-`uname -r` openssh-server bison flex apache2 php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev

Steel Reign

dicko
dicko's picture
I use these in my standard

I use these in my standard installs:-

aptitude -y install linux-source-$KERNEL_VERSION linux-headers-$KERNEL_VERSION_FULL \
apache2 apache2.2-common apache2-mpm-prefork apache2-utils apt-show-versions \
bison build-essential bzip2 curl dnsmasq dnsmasq-base ethtool g++ giflib-tools imagemagick iptraf \
tftpd-hpa hdparm jack kernel-package libapache2-mod-perl2 libapache2-mod-php5 libasound2 \
libasound2-dev libaudiofile-dev libauthen-pam-perl libiksemel3 libiksemel-dev \
libiksemel-utils libio-pty-perl libmysqlclient-dev libncurses5-dev \
libnet-ssleay-perl libnewt-dev libogg-dev libpam-runtime libqt4-core \
libqt4-gui libsnmp15 libsnmp-base libsnmp-dev libspandsp-dev libspeexdsp-dev \
libsqlite3-dev libsqlite3-0 libtiff4-dev libtonezone-dev libusb-dev \
libvorbis-dev libwww-perl libxml2-dev linux-libc-dev mc mysql-client \
gawk mysql-server nmap ntp ntp-doc ntpdate openssl perl php5 php5-cli \
php5-common php5-curl php5-dev php5-gd php5-imap php5-ldap \
php5-mcrypt php5-mhash php5-mysql \
php5-odbc php-db php-file php-mail php-mail-mime php-pear python rcconf \
resample rsync screen selinux-utils sqlite subversion tcpdump unixodbc-bin \
unixodbc-dev unzip vlan zip zlib1g-dev \
iftop htop ngrep sudo ghostscript expect screen \
dialog mtr tcpdump libwww-perl mlocate openvpn \
sysstat openssh-server postfix dos2unix console-data \
apache2-suexec debtags info2www

IWFM but YMMV as I use Debian Squeeze and I support t38 modems and hylafax and avantfax etc.

tm1000
tm1000's picture
Thanks dicko!

Thanks dicko!

Senior Developer
Schmoozecom, INC

tm1000
tm1000's picture
You are right. We do need

You are right. We do need better documentation. We are working on that with the new site and perhaps we can work on a quick install guide for CentOS and Ubunutu.

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
As I said

I would be willing to help with that. I am trying to put one together now for this setup. and i have seen that randy tech site in the past. i used it to build my first asterisk+freepbx machine. working out well.

Steel Reign

Steel Reign
Steel Reign's picture
almost there.

any help with this error?

root@LinuxTestVM:/usr/src/freepbx-2.11.0beta1# amportal start

Fetching FreePBX settings with gen_amp_conf.php..
PHP Fatal error: require_once(): Failed opening required '/var/www/html/admin/libraries/modulelist.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/admin/functions.inc.php on line 167

PHP Fatal error: require_once(): Failed opening required '/var/www/html/admin/libraries/modulelist.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/admin/functions.inc.php on line 167
**** WARNING: ERROR IN CONFIGURATION ****
astrundir in '/etc/asterisk' is set to but the directory
does not exists. Attempting to create it with: 'mkdir -p '

mkdir: missing operand
Try `mkdir --help' for more information.
**** ERROR: COULD NOT CREATE ****
Attempt to execute 'mkdir -p ' failed with an exit code of 1
You must create this directory and the try again.

Steel Reign

dicko
dicko's picture
Is apache2 setup and running

Is apache2 setup and running as I suggested with the right docroot and the right ownership?

ps aux|grep apache

ls -l /var/www/html/

grep -r asterisk /etc/apache2/*

grep -r DocumentRoot /etc/apache2/*

Steel Reign
Steel Reign's picture
yes

yes

Steel Reign

tm1000
tm1000's picture
You dont have files in

You dont have files in /var/www/html

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
i see that

i wiped out the vm i am starting over. this is getting to be very frustrating. i am going to try once more. if not then i will just give up and use asterisk 1.8+freepbx 2.10 until there is better docs on the 11's.

Steel Reign

tm1000
tm1000's picture
There are also fully

There are also fully compiled distros. Why you HAVE to do this by hand is beyond me.

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
Oh!

and i used the randytech guide and just replace the asterisk and frepbx packages with the latest versions and adding sqlite3 and that is how i got that error.

Steel Reign

tm1000
tm1000's picture
I dont know what the problem

I dont know what the problem is. I just setup ubuntu 12.04LTS and freepbx 2.11 and asterisk 11 and it worked fine. Maybe because I'm a developer but I dont know. I just didnt find it hard at all.

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
maybe so..

but if you could send me your notes on how you installed everything that would be great. i am sure that i am missing something that is probably really stupid.

Steel Reign

Steel Reign
Steel Reign's picture
note

i am starting with a clean ubuntu 12.04 lts 64bit install with the options of openssh and lamp selected during install.

not sure if i need to cover any other dep's then that. maybe sqlite3 and libsqlite-dev not sure about any other.

Steel Reign

tm1000
tm1000's picture
Firstly your system is

Firstly your system is fudged. I'd start over I don't want to start in the middle of some hosed system.

Lets assume you installed asterisk with something like

Asterisk Stuff

cd asterisk-11.1.0-rc1
make clean
./configure
make menuselect
make
make install
cd /var/lib/astersik/sounds
wget -O - http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz | tar xvfz -

Install deps for FreePBX

apt-get install php-pear
pear install db

Install FreePBX from SVN (with Future GIT Support)

apt-get install subversion git
cd /srv
svn checkout http://svn.freepbx.org freepbx

This will probably take a century. You don't have to checkout the freepbx svn and could probably extract the 2.11 package there instead

Add Asterisk User and then have that user own asterisk and html

adduser asterisk
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
mkdir /var/www/html
chown -R asterisk. /var/www/

Some apache changes and stuffs (Increase file upload size and user nobody/apache needs to be asterisk

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
service apache2 restart

Setup mysql database for freepbx and cdrs (cdrs wont work)

cd /var/srv/freepbx
export MYSQL_ROOT_PW=1234
export ASTERISK_DB_PW=amp109
mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk
mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb
mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql
mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql
mysql -u root -p${MYSQL_ROOT_PW} <<-END_PRIVS
GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
flush privileges;
END_PRIVS

Install FreePBX AFTER starting asterisk

./start_asterisk start
./install_amp

Just hit enter on every prompt.

Finally load ALL modules.

amportal restart

Senior Developer
Schmoozecom, INC

tm1000
tm1000's picture
I'm going though my history

I'm going though my history right now and I'm going to edit the above so wait a second

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
thanks

really appreciate all the help. i am going to try it right now. just got up a clean vm.

Steel Reign

Steel Reign
Steel Reign's picture
ok

ok

Steel Reign

tm1000
tm1000's picture
Ok done. I'll spin up a VM

Ok done. I'll spin up a VM in a few hours and run through my steps and see. So I can't say 100% that it will work for you.

Senior Developer
Schmoozecom, INC

Steel Reign
Steel Reign's picture
again

thank you very much i really appreciate the help.

Steel Reign

Steel Reign
Steel Reign's picture
Got it!!!

Finally!! i got it working. Had to do a little tweaking of the info you provided and a few minor mods and BAM!. its online now. i can't thank you enough for the help you guys provided.

and dicko. I am going to make a step by step guide for this and post it up just for you.

Steel Reign

dicko
dicko's picture
Well done and tThanks Steel

Well done and tThanks Steel Rein, although I don't need it, I'm sure many others will appreciate it.

Cisco Kid
Cisco Kid's picture
Awesome!

I am a huge fan of ubuntu server and I have been looking for a step by step guide that will work on 12.04. Eagerly awaiting the guide! Thanks in advance for the work you have all put into it. I can't wait to finally get 'er done Biggrin

Cisco Kid
Cisco Kid's picture
svn checkout uh oh

I'd like to point out for any noobs like myself that are reading this thread, running the "svn checkout http://svn.freepbx.org freepbx" command is a bad idea if you have limited space to work with. I have files from 2.2 - 2.9 but sadly I woke up to find my disk out of space this morning. Now I will be starting over using the tarball instead Wink

dicko
dicko's picture
You can be more granular, I

You can be more granular, I use

mkdir -p /usr/src/freepbx
cd /usr/src/freepbx
svn co http://www.freepbx.org/v2/svn/freepbx/branches/${VER_FREEPBX}
cd ${VER_FREEPBX}
.
.

where VER_FREEPBX can be anything from 2.1 through 2.11 This is very good for migrating TrixBox and Elastix systems when needed.

Cisco Kid
Cisco Kid's picture
Ahhh! I see. Thanks so much

Ahhh! I see. Thanks so much for pointing that out Smile

Steel Reign
Steel Reign's picture
Almost ready

I have built a step by step guide on how to install Asterisk 11 and FreePBX 2.11 on Ubuntu 12.04 LTS. I am going to be testing it out today to work out any -glitches in the matrix-. As soon as I verify everything is ok, I will post it on this thread.

Be Patient,

Steel

Steel Reign

Steel Reign
Steel Reign's picture
The Guide

***DISCLAIMER: I don't proceed to think I know everything. So maybe TM1000 and/or dikco can take a look and see if I left anything out. So far I have not found any issues working on my system. SO FAR...

And now without further adieu...

Install Ubuntu 12.04 LTS 32 or 64-bit

Select OpenSSH and LAMP Server options.

Configure root password.

sudo passwd root

Update system and reboot to make changes take effect.

sudo aptitude update && sudo aptitude upgrade -y

Install dependencies.

*If you are using Ubuntu Desktop 12.04 LTS 32-bit, then you might have to install aptitude.

sudo apt-get install aptitude -y

**If this is a new install and you selected OpenSSH and LAMP as stated above, then install:

aptitude install -y build-essential linux-headers-`uname -r` bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev

***If this is an existing install, then you will need to install:

aptitude install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev

Reboot server

reboot

Setup pear database

pear install db

Download Asterisk source files.

cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.6.2.4.tar.gz

Compile and install DAHDI.

tar xvfz dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-2.6.1+2.6.1
make all
make install 
make config

=============================================================================
!!!WARNING!!! There is a known bug for LIBPRI 1.4.13. ‘make’ will error out with an ‘pritest.c:71:8’ error. You can find the bug report here. To correct this error follow these steps:

Download patch.

wget https://issues.asterisk.org/jira/secure/attachment/44869/fix_unused_write.patch

Rename file.

mv fix_unused_write.patch pritest.patch

Patch the pritest.c file.

patch pritest.c pritest.patch

=============================================================================
Compile and install LIBPRI.

cd ..
tar xvfz libpri-1.4-current.tar.gz
cd libpri-1.4.13
make
make install

Compile and install Asterisk

cd ..
tar xvfz asterisk-11-current.tar.gz
cd asterisk-11.0.1
./configure
make menuselect
make
make install
make samples

Configure and instlal Asterisk-addons.

cd ..
tar xvf asterisk-addons-1.6.2.0.tar.gz
cd asterisk-addons-1.6.2.0
./configure
make
make install

Finally, compile and extract Asterisk-Extra-Sounds

cd /var/lib/asterisk/sounds
wget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
tar xvfz asterisk-extra-sounds-en-gsm-current.tar.gz

Download and extract FreePBX.

cd /usr/src
wget http://mirror.freepbx.org/freepbx-2.11.0beta1.tar.gz
tar xvfz freepbx-2.11.0beta1.tar.gz
cd freepbx-2.11.0beta1
cp amportal.conf /etc/

Now create Asterisk user and set ownership permissions.

adduser asterisk --disabled-password --no-create-home --gecos "Asterisk User"
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
mkdir /var/www/html
chown -R asterisk. /var/www/

A few small modifications to Apcahe.

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
service apache2 restart

Configure Asterisk database in MYSQL.

export MYSQL_ROOT_PW=ROOTPASSWORD 
export ASTERISK_DB_PW=ROOTPASSWORD 
mysqladmin -u root -p${MYSQL_ROOT_PW} create asterisk
mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb 
mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql 
mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql 
mysql -u root -p${MYSQL_ROOT_PW}

Set permissions on MYSQL database.

GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";
flush privileges; 
exit

Restart Asterisk and install FreePBX.

./start_asterisk start
./install_amp

** If “. /install_amp” fails to run correctly, in terminal type:

./install_amp --username=root --password=ROOTPASSWORD

Finally, one last mod and start FreePBX.

ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
amportal start

Finally you can open your web browser and navigate to:

http://yourlocalipaddress/html

or if you prefer

http://localhost/html

=============================================================================

After you enable and update the modules in FreePBX You will see the following error.

Symlink from modules failed

To correct this error do the following.

Delete the list of failed files
Example:

cd /etc/asterisk
rm ccss.conf confbridge.conf features.conf sip.conf iax.conf logger.conf extensions.conf sip_notify.conf

Then on the FreePBX webUI got to the ‘Module Admin’ and uninstall and reinstall the ‘Camp On’ module. This should resolve the Symlink issue.

Steel Reign

Pages