Friday, 20 September 2013

Install Web-MeetMe 4.0.2 for FreepPBX 2.8 with Asterisk 1.8 on CentOS 5.5

SOURCE: http://wikiasterisk.blogspot.com/2012/08/install-web-meetme-402-for-freeppbx-28.html
Web-MeetMe is a suite of PHP pages to allow for scheduling and managing conferences on an Asterisk PBX. In this installation guide I am going to show you howto install Web-MeetMe on a installation of FreePBX 2.8 with Asterisk 1.8. I also updated my own installation guide of FreePBX with Asterisk, this guide is also on this website. Well read on and learn howto install Web-MeetMe 4.0.2.
Prepare installation
First check if Asterisk module res_odbc is installed.  Login into your Asterisk server and start the Asterisk command-line:
1
asterisk -r
On the Asterisk command line execute the next command:
1
asterisk*CLI> module show like res_odbc
Also the module cdr_adaptive_odbc should be loaded into Asterisk. Check if it exists:
1
asterisk*CLI> module show like cdr_adaptive_odbc
If both modules fail or one of these two I recommend you install res_odbc and cdr_adaptive_odbc with the next steps:
1
yum install -y unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel php-odbc mysql-connector-odbc
Now we need to recompile Asterisk from the source:
1
2
3
4
5
6
cd /usr/src/asterisk-1.8.1.1/
amportal stop
make clean
contrib/scripts/get_mp3_source.sh
./configure
make menuselect
This last step opens a menu, in this menu be sure that:
  - Head into Channel Drivers and make sure chan_dahdi is selected
  - Head into Add-Ons and make sure app_mysql, app_saycountpl, cdr_mysql, format_mp3, res_config_mysql are selected
  - Head into Extra Sound Packages and make sure EXTRAS-SOUNDS-EN-GSM is selected
  - Head into Resource Modules and make sure res_odbc is selected
  - Head into Call Detail Recording and make sure cdr_adaptive_odbc is selected
If all off the above is marked for installation save and quit the menu.
Let us now compile Asterisk again and start it back up.
1
2
3
make
make install
amportal start
If you want you can check if the Asterisk modules (res_odbc & cdr_adaptive_odbc) are loaded. If not Google is your friend :-)
Also app_meetme module should be installed. If this is not installed follow my instructions that you can find here.
Check that you have PHP version 4.3 or later installed. If not install an update or install PHP. Normally you would have this version.
Configure ODBC
Open /etc/odbc.ini and add the following:
1
2
3
4
5
6
7
8
9
10
11
[MySQL-Asterisk]
Description     = ODBC for MySQL
Driver          = MySQL
Server          = 127.0.0.1
Database        = meetme
Port            = 3306
Socket          = /tmp/mysql.sock
Option          =
Stmt            =
Trace           = yes
TraceFile       = /tmp/odbc.log
Now let's create the res_odbc.conf
1
2
3
touch /etc/asterisk/res_odbc.conf
chown asterisk:asterisk /etc/asterisk/res_odbc.conf
chmod 775 /etc/asterisk/res_odbc.conf
Open /etc/asterisk/res_odbc.conf and add the following as DB user and pass I used the settings of the asteriskuser DB and PASSWORD2 from this article:
1
2
3
4
5
[meetme]
dsn => MySQL-Asterisk
username => -username>
password => -password> pre-connect => yes
Also we need to create the file /etc/asterisk/extconfig.conf:
1
2
3
touch /etc/asterisk/extconfig.conf
chown asterisk:asterisk /etc/asterisk/extconfig.conf
chmod 775 /etc/asterisk/extconfig.conf
Open /etc/asterisk/extconfig.conf and add the following:
1
2
[settings]
meetme => odbc,meetme,booking
To enable CDR logs we need to create /etc/asterisk/cdr_adaptive_odbc.conf:
1
2
3
touch /etc/asterisk/cdr_adaptive_odbc.conf
chown asterisk:asterisk /etc/asterisk/cdr_adaptive_odbc.conf
chmod 775 /etc/asterisk/cdr_adaptive_odbc.conf
Open /etc/asterisk/cdr_adaptive_odbc.conf and add the following:
1
2
3
[wmm]
connection=meetme ;Note that this matches res_odbc.conf
table=cdr
Open /etc/asterisk/cdr.conf en make sure that the following setting matches:
1
endbeforehexten=no
Prepare database
Let us setup the MySQL database for Web-MeetMe:
1
2
3
4
5
6
7
mysqladmin -p create meetme
cd /usr/src/
wget (link to download web meet me)
tar xzvf Web-MeetMe_v4.0.2.tar
cd webmeet-me
mysql -p meetme < cbmysql/db-table-create-v7.txt
mysql -p meetme < cbmysql/db-admin-user-create.txt
Let us start the MySQL command line:
1
mysql -p
Because I configured the asterisk DB user (asteriskuser with PASSWORD2) as DB user I have to give rights to this user for this database:
1
2
3
GRANT ALL PRIVILEGES ON meetme.* TO asteriskuser@localhost IDENTIFIED BY 'PASSWORD2';
flush privileges;
\q
Install and configure Web-MeetMe
First let us install Web-MeetMe
1
2
3
cd /usr/src/
mv weebmeet-me /var/www/html/
chown -R asterisk:asterisk /var/www/html/web-meetme/
Open the following PHP file
1
vi /var/www/html/web-meetme/lib/defines.php
And adjust the following settings to your needs (read the file; maybe more settings needed):
1
2
3
define ("WEBROOT", "http:///web-meetme/");
define ("FSROOT", "/var/www/html/web-meetme/");
define ("AUTH_TYPE", "sqldb");
We need to adjust the /etc/asterisk/phpagi.conf, make it look like this (adjust some settings to your needs):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[phpagi]
#enable debuging
debug=false
#use internal error handler
error_handler=true
#mail errors to
admin=your@email.com
#host name of this server
hostname=my.host.com
# temporary directory for storing temporary output
tempdir=/var/spool/asterisk/tmp/
 
[festival]
#path to text2wave binary
text2wave=/usr/src/festival/bin/text2wave
tempdir=/var/lib/asterisk/sounds/tmp/
 
[asmanager]
# server to connect to
server=localhost
# default manager port
port=5038
#username for login
username=pick the username from /etc/asterisk/manager.conf
#password for login
secret=pick the password from /etc/asterisk/manager.conf
 
[cepstral]
#alternate text to speech engine
swift=/opt/swift/bin/swift
voice=David
Now open the /etc/asterisk/manager.conf and uncomment the next line:
1
include manager_custom.conf
Then open the /etc/asterisk/manager_custom.conf and add the following to it:
1
2
3
4
[MeetMe]
secret = {pick-a-password}
read = call
write = command,originate
Open the next file to configure DB settings:
1
vi /var/www/html/web-meetme/lib/database.php
Adjust the file to the user you added to the meetme database. If you followed these instructions it is the asterisk DB user from this artice:
1
2
3
4
5
6
7
8
9
10
11
12
13

include_once 'DB.php';
$database = 'meetme';
$host = 'localhost';
$username = 'asteriskuser';
$password = 'PASSWORD2';
$dsn = "mysql://$username:$password@$host/$database";
$db = DB::connect($dsn);
if (DB::isError($db))
{
        die ($db->getMessage());
}
?>
Also the /var/www/html/web-meetme/index.html of Web-MeetMe needs a adjustment:
1
<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http:///web-meetme/meetme_control.php">
Let us finish the installation with a reboot of Asterisk and FreePBX
1
amportal restart

Complete and check installation
If everything went correct you are now able to use Web Meet Me. Check the installation by browsing to http:///web-meetme. You can login with the standard user and password which are:
user: wmm@localhost
pass: wmmpw
Don' forget to reset these credentials, because they are known over the world. Have fun with your Web-MeetMe installation!

No comments: