
Recording all calls on trixbox Pro using Oreca GPL
Document v1.0 - Last edited 1/9/2009 by Chris Sherwood, SureTeq, Inc.
Record-all is a feature that is requested all the time for trixbox Pro. For companies that have legal compliance issues, or just want to have a recording of all calls, you can't beat the open-source recording tool Oreka GPL. This document will detail the installation and configuration of Oreka GPL on trixbox Pro.
***NOTE: This solution is unsupported by Fonality...if you call in asking them to fix your record-all solution...they won't know what you're talking about! Also, please note that this solution will take CPU cycles away from call processing on the server...your total number of concurrent calls WILL drop when record-all is running.
Let SureTeq provide you with FtOCC certified trixbox Pro and/or trixbox CE hourly support! Hourly rates and support contracts are available. For pricing information and contact details, please click here or contact us!
Table of Contents
1.0 - Orkaudio Installation
2.0 - Orkaudio Configuration
3.0 - Recording Calls
4.0 - Orktrack Prerequisites
4.1 - MySQL installation
4.2 - Install Webmin
4.3 - MySQL
Configuration
4.4 - Install the Java
SDK
4.5 - Apache
and Tomcat Installation
5.0 - Orktrack Installation
The first step is to get Oreca GPL installed onto trixbox Pro. To do this, log into the Linux CLI of your trixbox Pro server using an SSH client such as Putty or SecureCRT. Once logged in, run these commands to install Oreca GPL:
cd /usr/src
wget
http://prdownloads.sourceforge.net/oreka/orkaudio-0.5-313-centos-4.2-i386-RPMs.tar
***NOTE: The 'wget' command refers to the 0.5-313 version of Oreca GPL. As versions change, this will change as well. Make sure you download the current version, and adjust all of the following commands accordingly. To see the link for the latest version, go to http://oreka.sourceforge.net/download/redhat and look at the download link underneath 'Recommended Download.'
Once you have downloaded the installation package, run the following commands:
tar -xvf orkaudio-0.5-313-centos-4.2-i386-RPMs.tar
cd orkaudio-centos-4.02-i386-RPMs
yum -y install boost-devel
rpm -ivh xercesc-2.7.0-1.i386.rpm
rpm -ivh ACE-5.4.8-1.i386.rpm
rpm -ivh log4cxx-0.9.7-1.i386.rpm
rpm -ivh libsndfile-1.0.13-1.i386.rpm
rpm -ivh orkbasecxx-0.5-10.i386.rpm
rpm -ivh orkaudio-0.5-313.i386.rpm
You are now installed.
By default, the configuration files are in /etc/orkaudio. The main file we want to use to configure Oreca GPL is /etc/orkaudio/config.xml. Let's open that file and take a look:
nano -w /etc/orkaudio/config.xml
There are many options in this configuration file, but we will only be dealing with a small number of them.
The first configuration option we want to look at is the <AudioOutputPath> setting. By default, it is set to /var/log/orkaudio. We're going to leave it default for now, but you should know that this is the directory where Oreca GPL stores your recorded calls in the format of /orkaudio/YYYY/MM/DD/HH. (Year, Month, Day, Hour). If you choose to install Orkweb (sections 4 and 5 below), then we will be adjusting this path to our Apache/Tomcat webapps directory.
The next configuration option we want is the <Devices> option. This option tells Oreca GPL which Ethernet interface to listen on for SIP calls. I am going to assume that we only have a single interface in trixbox Pro (eth0), so you will want to change:
<!--<Devices>eth1, eth2</Devices>-->
to
<Devices>eth0</Devices>
We have now uncommented the setting and told it to listen on eth0. Let's leave the rest of the file default and press CTRL+X followed by 'Y' to save and exit.
Now that we have configured Oreca GPL, let's fire it up! At the Linux CLI, type:
orkaudio
You should get something that says 'Starting orkaudio daemon...' and returns you to the Linux CLI. If there were no errors, Oreca GPL is now running. If you get some errors...go back and figure out where you screwed up!
Once Oreca GPL is running, it will automatically record all calls to /var/log/orkaudio (or the directory you specified in the config file). Make some test calls and then go into the Linux CLI and head to the /var/log/orkaudio directory. If your test calls were successful, you should now see a YYYY (year) folder...I see '2009.' Go into that directory, and you should see see another folder...and another, and another. The files are stored in the format /var/log/orkaudio/YYYY/MM/DD/HH (Year, Month, Day, Hour). Once in the 'Hour' folder, you should see some WAV files...those are your recordings.
[root@trixbox123456 13]# ls -la
total 44
drwxr-x--- 2 root root 4096 Jan 10 13:59 .
drwxr-x--- 3 root root 4096 Jan 10 13:55 ..
-rw-r----- 1 root root 2660 Jan 10 13:55
20090110_135535_192.168.201.195,2224.wav
-rw-r----- 1 root root 16310 Jan 10 13:59
20090110_135854_192.168.201.18,11608.wav
-rw-r----- 1 root root 16310 Jan 10 13:59
20090110_135854_192.168.201.199,3000.wav
Great! So how the hell do we listen to them? Good question...we need to install Orktrack/Orkweb now. That will give us a web interface where we can search for and listen to our recordings. Oh...and by the way...if you thought installing Oreca GPL and getting call recordings going was the hard part...guess what...it isn't. Move on...
By default, trixbox Pro does not come with MySQL, Java, or a web server, so we have to install all of these. Keep in mind that this is a completly unsupported solution, so if you are having issues, and you call up Fonality support, they won't know what the heck you're talking about...and they certainly won't support your solution.
To get the web interface for Oreca GPL up and running, we will need to install MySQL server, then the Java SDK, and then Apache/Tomcat...once we have all of those installed, we are good to go...let's start with MySQL:
If we go to the Linux CLI and run 'yum list |grep mysql' we should see that a few of the MySQL packages are installed, but not the 'mysql-server' that we want. To install it, run:
yum -y install mysql-server
This should just take a few moments, and you'll see 'Complete!' when finished. Let's make sure MySQL runs at startup and get it started:
chkconfig --levels 345 mysqld on
service mysqld start
All good so far? Good.
By default, MySQL comes with a blank 'root' user password, so let's set the password:
mysqladmin -u root -p password new_password_here
When prompted for a password, just hit 'ENTER.' You have now changed your MySQL root password. Before we move on to installing the Java SDK, we need to create a database and user for Orktrack. If you know how to create databases and users in the MySQL CLI...please be my guest. I'm not a database guy however, so I take the easy way out and use Webmin. First, let's get Webmin installed.
To install Webmin, you need to run the following commands in your Linux CLI:
cd /usr/src wget http://prdownloads.sourceforge.net/webadmin/webmin-1.441-1.noarch.rpm rpm -ivh webmin-1.441-1.noarch.rpm
***NOTE: The version of webmin available at the time this document is being written is v1.441-1. You may have to adjust the lines above if a newer version is available.
***NOTE: Sometimes you will get an error when installing Webmin that states 'Port 10000 is already in use.' If you get that error, you can run the following command to see what is using port 10000:
lsof -i :10000
This will most likely tell you that our friend orkaudio is taking up port 10000 already. Run a 'killall orkaudio' before installing webmin, and then restart orkaudio once the Webmin installation finishes.
Once the install has finished, you can get to your Webmin console by putting the following into a browser that exists on your LAN:
https://192.168.200.30:10000 (obviously, replace my IP with your trixbox Pro IP, and note that this is HTTPS...not HTTP). The login is root and your root password.
Once inside Webmin, click on 'Servers' followed by MySQL Database Server. You will be prompted for a username and password. This is the MySQL 'root' username and the password you created in step 4.1.
Once logged in to the MySQL Webmin module, click 'Create a new database' under 'MySQL Databases.' Next to 'Database name' just type 'oreka' and leave everything else default. Click 'Create.'

You are now taken back to the main screen, and you should see the newly created 'oreka' database listed. Now, let's add our Orktrack user. Click on the 'User Permissions' icon under 'Global Options.'
Now click on 'Create new user' near the top of the 'User Permissions' screen. Use this information:
Username: admin
Password: admin
Hosts: any
Permissions: (use CTRL or SHIFT to select ALL of the permissions)

Click 'Create.' You are taken back to the User Permissions screen, and you should now see your admin user listed. MySQL configuration is now complete!
The next step is to install the Java SDK that is used by Apache/Tomcat. Unfortunately, I couldn't find a real easy way to download and install this with a 'wget' command. I had to download this to my Windows computer and then use WinSCP to transfer it over to the trixbox Pro server...so let's do it that way. In your browser, navigate to http://java.sun.com/javase/downloads/index.jsp. The first 'Download' button should be next to 'Java SE Runtime Environment (JRE) 6 Update 11. (Note that by the time you are reading this, version numbers may have changed, so you can either find an older version, or just download whatever is current). Click 'Download.'
You are now taken to a selection screen. For 'Platform,' select 'Linux.' Leave 'Language' default and then check the box to accept the license agreement. Click 'Continue.'
You are now taken to the download screen. We want to download the first of the two files in the list...the one with 'rpm' in the name. You can check the box and download with the Sun Download Manager, but I opted to just click the link underneath the file description. Once it has been downloaded, note its location.
Now, you can open up WinSCP and connect to your trixbox Pro. The download, installation, and configuration of WinSCP is beyond the scope of this document, but it's a fairly easy process. Note that you can get the file to the trixbox Pro any way you like (such as FTP), but I just prefer WinSCP.
You will want to put the file into a new directory on the Linux box. I called mine 'Java' and put it into /usr/src. To create this folder, go to the Linux CLI of your trixbox Pro server and type:
mkdir /usr/src/java
You should now have the Java SDK in the /usr/src/java folder. It is a .bin file, so that means we need to make it executable before we go any further. From the Linux CLI of the trixbox Pro server type the following:
cd /usr/src/java
chmod +x jre-6u11-linux-i586-rpm.bin
Now that the file has execute rights, let's run it!
sudo /usr/src/java/jre-6u11-linux-i586-rpm.bin
You should get a few pages of licensing leagalese followed by a [yes or no] prompt. Type 'yes' and press 'Enter.' The .bin file will now extract and run the RPM that was contained within. Once it is done (just a few moments), you are returned to the Linux CLI.
The last step in the Java installation is to create an environment variable in Linux so that Orktrack and Tomcat can easily find Java. The environment variable we need to set is called 'JRE_HOME' and we will first set it manually. From the Linux CLI, type the following:
export JRE_HOME=/usr/java/jre1.6.0_11
That will work fine...but we don't want to have to type that in every time our server reboots...we will be setting this automatically in the next section.
Done with Java installation!
4.5 - Apache and Tomcat Installation
The final piece of prerequisite software we need to install is Apache/Tomcat. Let's start with the easier of the two...Apache. From the Linux CLI, type the following:
yum -y install httpd
After a few moments, you should see 'Complete!' and you are taken back to the command line. Apache is now installed, but we need to do a little configuring.
First we need to change the default HTTP port that Apache uses since trixbox Pro already does a redirect anytime someone goes to HTTP port 80. I'm going to change mine to 88 since Tomcat will be using 8080 below...you can set the HTTP port to whatever you want besides 80 and 8080.
nano -w /etc/httpd/conf/httpd.conf
Find the line that says:
Listen 80
And change it to:
Listen 88
CTRL+X followed by 'Y' to save and exit.
Now let's make sure that the httpd service starts every time we boot the system:
chkconfig --levels 345 httpd on
Next, add an 'apache' group to the server:
groupadd apache
Now let's fire it up:
service httpd start
You may get a message about httpd: could not determine the server's FQDN...blah blah blah. That's fine...it won't affect anything. Let's move on.
Tomcat is a Java Servlet for Apache. To download and install do the following:
cd /usr/src
wget
http://apache.tradebit.com/pub/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.tar.gz
tar zxvf apache-tomcat-5.5.27.tar.gz
To run Tomcat, type the following:
sudo /usr/src/apache-tomcat-5.5.27/bin/startup.sh
Tomcat is now running, but we want to set it to run every time we reboot the server. To add it as a startup item, do the following:
nano -w /etc/rc.d/rc.local
Somewhere in the file (the bottom is fine), add these lines:
export JRE_HOME=/usr/java/jre1.6.0_11
/usr/src/apache-tomcat-5.5.27/bin/startup.sh
orkaudio
CTRL+X followed by 'Y' to save and exit. Reboot and your system is ready to run Orktrack.
Finally! Man...too many prerequisites if you ask me. That's OK though...keep in mind that Fonality has streamlined trixbox Pro to free up as many CPU cycles as possible for normal operation. Where a typical Linux install may include Apache, MySQL, etc., those have purposely been removed from trixbox Pro. Also, please keep in mind that by now ADDING all of this extra software, you are reducing your system's total number of concurrent calls. Keep an eye on the CPU after this installation to make sure you are still running smoothly.
*** TIP: If you don't want to degrade the performance of trixbox Pro, you can always install this solution on a separate server and have it monitor a mirrored switch port. For instance, if your trixbox Pro is plugged into port 1 of a switch, you can mirror (depending on the switch being used) all traffic to and from the 1st port to the 2nd port on the same switch. You then configure your Oreca GPL server with 2 NIC's...one to plug into the network normally (eth0) and the other one (eth1) to plug into the 2nd switch port (the mirrored switch port) of the switch. Voila! You now have a record-all server...plug in a boatload of HDD's!
To download and install Orktrack, do the following from the Linux CLI:
mkdir /usr/src/orktrack
cd /usr/src/orktrack
wget
http://prdownloads.sourceforge.net/oreka/oreka-0.5-311-orktrack-orkweb.zip
unzip oreka-0.5-311-orktrack-orkweb.zip
If you view the /usr/src/orktrack directory now (ls -la), you will see three .zip files, a couple of .war files, and a README. We will now want to copy these various files to their new homes:
cd /usr/src/orktrack
unzip lib.zip -d /usr/src/apache-tomcat-5.5.27/shared/lib
unzip ConfigFiles.zip -d /etc
cp orkweb.war orktrack.war /usr/src/apache-tomcat-5.5.27/webapps/
Ok, so we have now created our config directory (/etc/oreka) and copied the two .war files to our Tomcat webapps directory. I believe the .war files are programs that are processed automatically when Tomcat is started, so now that they are prepped...let's restart Tomcat.
/usr/src/apache-tomcat-5.5.27/bin/shutdown.sh
/usr/src/apache-tomcat-5.5.27/bin/startup.sh
Now, if you go to /usr/src/apache-tomcat-5.5.27/webapps, you will see two new directories - orktrack and orkweb. Inside each of these directories are config files we need to edit. Do the following in the Linux CLI:
nano -w /usr/src/apache-tomcat-5.5.27/webapps/orktrack/WEB-INF/web.xml
Find this section:
<param-name>Log4jConfigFile</param-name>
<param-value>c:/oreka/orktrack/log4j.properties</param-value>
And change it to:
<param-name>Log4jConfigFile</param-name>
<param-value>/etc/oreka/orktrack/log4j.properties</param-value>
(I love how they defaulted the config file for Windows installations :P ).
Also find:
<param-name>ConfigFile</param-name>
<param-value>c:/oreka/orktrack/orktrack.config.xml</param-value>
And change it to:
<param-name>ConfigFile</param-name>
<param-value>/etc/oreka/orktrack/orktrack.config.xml</param-value>
Finally...find this section:
<param-name>HibernateConfigFile</param-name>
<param-value>c:/oreka/orktrack/mysql.hbm.xml</param-value>
And change it to:
<param-name>HibernateConfigFile</param-name>
<param-value>/etc/oreka/orktrack/mysql.hbm.xml</param-value>
CTRL+X followed by 'Y' to save and exit.
One more config file to change:
nano -w /usr/src/apache-tomcat-5.5.27/webapps/orkweb/WEB-INF/web.xml
Find this section:
<param-name>Log4jConfigFile</param-name>
<param-value>c:/oreka/orktrack/log4j.properties</param-value>
And change it to:
<param-name>Log4jConfigFile</param-name>
<param-value>/etc/oreka/orktrack/log4j.properties</param-value>
Finally...find this section:
<param-name>HibernateConfigFile</param-name>
<param-value>c:/oreka/orktrack/mysql.hbm.xml</param-value>
And change it to:
<param-name>HibernateConfigFile</param-name>
<param-value>/etc/oreka/orktrack/mysql.hbm.xml</param-value>
CTRL+X followed by 'Y' to save and exit.
We have basically now told Tomcat where to find our Oreka config files. Now onto editing those config files for our system:
nano -w /etc/oreka/orktrack/mysql.hbm.xml
Find the line that says:
<property name="hibernate.connection.password">password</property>
and change it to:
<property name="hibernate.connection.password">your_MySQL_root_password_here</property>
You will want to put in the MySQL root user password that we created in step 4.1.
CTRL+X followed by 'Y' to save and exit.
We also want to do the same thing for the mysql.hbm.xml file in the /etc/oreka/orkweb subdirectory:
nano -w /etc/oreka/orkweb/mysql.hbm.xml
Find the line that says:
<property name="hibernate.connection.password">password</property>
and change it to:
<property name="hibernate.connection.password">your_MySQL_root_password_here</property>
You will want to put in the MySQL root user password that we created in step 4.1.
CTRL+X followed by 'Y' to save and exit.
Finally, we need to tell Orkaudio where to output our recording files so that Orkweb can find them. To do this, we want to set the <AudioOutputPath> again:
nano -w /etc/orkaudio/config.xml
Change:
<AudioOutputPath>/var/log/orkaudio</AudioOutputPath>
To:
<AudioOutputPath>/usr/src/apache-tomcat-5.5.27/webapps</AudioOutputPath>
Restart Tomcat again:
/usr/src/apache-tomcat-5.5.27/bin/shutdown.sh
/usr/src/apache-tomcat-5.5.27/bin/startup.sh
Phew...that was a lot of configuration for such a simple thing! Drum roll please!!
Point Internet Explorer (Orkweb uses the Windows Media Player plug-in, so you HAVE to use IE, except I was able to get it working in Google Chrome also) to http://(your IP address):8080/orkweb. You should see the logon screen. If you don't see the logon screen...oops! You probably missed a step somewhere...either that or I made a typo somewhere, and then everyone is hosed.

We will now use the MySQL user we created to log in (user/pass = admin/admin).
If all is well, you will see the main screen:

You can now enter in some search criteria and click 'Search' to find your recordings, and they will appear to the right of the search dialogue:

ONE LAST CONFIGURATION STEP!! Very important...if you hover your mouse over the 'Play' button, you should see something like:
javascript:play('http://trixboxNNNNNN:8080//2009......wav')
The 'trixboxNNNNNN' where NNNNNN is your trixbox Server ID is NOT a Fully Qualified Domain Name (FQDN), so you'll have to either set that hostname up manually in your c:\windows\system32\drivers\etc\hosts file so that it looks like this:
trixbox123456 192.168.200.18
You will want to substitute your trixbox Server ID for the 'trixbox123456' portion, and your trixbox IP address for the IP. Save and exit the file, and you should be working. Alternatively, you can use a service such as WINS to alias the trixbox123456 hostname for your entire network.
***HELP! - If someone knows how to change this so that it uses FQDN instead of just the system hostname, please email me! I'd love to fix this piece.
Once that is in place, you can click the 'Play' button and listen to your recordings.