Skip to content
Santiago Palladino edited this page Jun 22, 2017 · 11 revisions

Install Verboice on Ubuntu

Do you need this?

InSTEDD provides a hosted Verboice server for free for non-commercial uses. We monitor, maintain, support and update this server but we won't be able to do the same with yours. You would only need to install your own server if you need to connect hardware modems to it or you are running a commercial application.

Using Vagrant

Vagrant provides an easy way of managing Virtual Machines. You will find a Vagrantfile in the project's repository which will automatically provision a VM running Ubuntu 14.04. This may be the easiest way to set up your own Verboice instance.

Virtual Machines

There are available Virtual Machines with Verboice pre-installed (built with Vagrant) that can be used with VirtualBox, a virtualisation software that is available for Windows, Mac and Linux. Simply download the Verboice image and import it.

These VMs are also prepared to be used along with a local Voiceblue device. Ensure the second Network adapter is bridged to the Ethernet interface that is connected point-to-point to the Voiceblue gateway. The VM will use 192.168.1.10 as IP by default, so make sure your host computer uses a different IP to avoid any clashes.

Manually

Erlang

Verboice requires Erlang R17 and Ubuntu comes with an older version. To properly satisfy this requirement, install first the packages from Erlang Solutions.

Packages

Now it's time to install the required packages:

#!bash
sudo apt-get install ruby1.9.3 apache2 asterisk erlang erlang-dev mercurial git mailutils \
      libxml2-dev libxslt1-dev mysql-server libmysqlclient-dev lame sox libsox-fmt-mp3 nodejs \
      libcurl4-openssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev libyaml-dev postfix \
      festival libzmq3-dev

Note that Ubuntu 12.04 and earlier do not have libzmq3-dev on the default repositories, so if installation fails, you need to add the following repository:

#!bash
sudo add-apt-repository ppa:chris-lea/zeromq
sudo apt-get update
sudo apt-get install libzmq3-dev

Bundler

Install Ruby Bundler:

#!bash
sudo gem install bundler --no-ri --no-rdoc

Passenger

Install Passenger module and enable in Apache doing:

#!bash
sudo gem install rack -v=1.6.4 
sudo gem install passenger --no-ri --no-rdoc
sudo passenger-install-apache2-module -a
sudo sh -c 'passenger-install-apache2-module --snippet > /etc/apache2/mods-available/passenger.load'
sudo a2enmod passenger

Also, edit the default Apache website file located at /etc/apache2/sites-enabled/000-default:

#!apache
<VirtualHost *:80>
  DocumentRoot /opt/verboice/public
  PassengerSpawnMethod conservative
</VirtualHost>

And restart Apache:

sudo service apache2 restart

Setup Verboice

Clone the Verboice sources into /opt/verboice:

#!bash
cd /opt
git clone https://github.com/instedd/verboice.git --branch stable

Create database:


#!bash
mysql -uroot 
create database verboice;
create user 'verboice'@'localhost';
grant all on verboice.* to 'verboice'@'localhost';
exit

Now install some extra requirements and compile the application:

#!bash
cd verboice
bundle install --deployment --path .bundle --without "development test"
bundle exec rake db:setup RAILS_ENV=production
bundle exec rake assets:precompile
make -C broker deps

Configure Verboice

Some settings has to be changed in the broker configuration file. Run the following lines adjusting the values if needed:

#!bash
script/update_erl_config broker/verboice.config verboice db_name verboice
script/update_erl_config broker/verboice.config verboice asterisk_config_dir /etc/asterisk
script/update_erl_config broker/verboice.config verboice asterisk_sounds_dir /usr/share/asterisk/sounds
script/update_erl_config broker/verboice.config verboice base_url "http://`hostname`"
script/update_erl_config broker/verboice.config verboice crypt_secret super_secret
script/update_yml_config config/verboice.yml default_url_options host `hostname`

Install Services

Verboice uses Procman to install the services using Upstart:

#!bash
echo "RAILS_ENV=production" > .env
echo "HOME=`pwd`" >> .env
sudo -E bundle exec foreman export upstart /etc/init -a verboice -u `whoami` --concurrency="broker=1,delayed=1"

Setup Asterisk

Make some configuration changes required to connect Asterisk with Verboice:

#!bash
sudo rm -rf /etc/asterisk/*
sudo cp /opt/verboice/etc/asterisk/* /etc/asterisk/
sudo touch /etc/asterisk/sip_verboice_registrations.conf /etc/asterisk/sip_verboice_channels.conf
sudo chown `whoami` /etc/asterisk/sip_verboice_*
sudo mkdir /usr/share/asterisk/sounds/verboice
sudo chown `whoami` /usr/share/asterisk/sounds/verboice
sudo /etc/init.d/asterisk restart

Start Verboice Services

That's all! Verboice services must now be started:

#!bash
sudo start verboice

You should now be able to navigate to the Verboice console from your browser.