Skip to content

Installing on Raspberry PI

Juan B edited this page Oct 1, 2015 · 3 revisions

Install Verboice on Raspbian

This document details 2 ways in which you can install Verboice on a Raspberry Pi (Debian Wheezy).

Easy method

We provide an Operating System Image with Verboice pre-installed on a Raspbian. The system user is the same as the predefined (user: pi, password: raspberry). Verboice is running as a service, and will start on the Raspberry startup. The admin user is raspberry@verboice.org and the password is raspberry-verboice

Download Operating System Image

You can install it using the Raspberry Pi Image Installation Guide

Manual method

Erlang

Verboice requires Erlang and Raspbian does not have it pre-installed. To properly satisfy this requirement, you first need to install the packages from Erlang Solutions by running the following commands from a terminal inside your Raspberry Pi: (if it asks for distribution name, put wheezy)

#!bash
wget --no-check-certificate https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update

Packages

Now it's time to install the packages that Verboice requires to run. Run the following commands:

#!bash
sudo apt-get install ruby1.9.1-dev asterisk erlang-dev git mailutils \
      libxml2-dev libxslt1-dev mysql-server libmysqlclient-dev lame sox \
      libcurl4-openssl-dev libapr1-dev libaprutil1-dev libyaml-dev postfix \
      festival libzmq-dev

Bundler

Install Ruby Bundler:

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

Setup Verboice

There’s a specific respository branch with modifications for Raspbian. This branch is based on the latest stable version of Verboice.

Clone the Verboice sources into /opt/verboice:

#!bash
cd /opt
git clone https://github.com/instedd/verboice.git
git fetch && git checkout raspberry_pi

Create database:


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

You will need to precompile the assets on a machine with verboice and rails installed. This is a heavy task for the Raspberry, and it is not recommended that you do it on it. On the machine with verboice run:

#!bash
cd verboice
bundle exec rake assets:precompile

Then copy the folder ../verboice/public/assets to /opt/verboice/public/assets on the raspberry

Now you need to 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
make -C broker deps

Configure Verboice

Some settings have 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, and it doesn't come preinstalled on Raspbian. You will need to install it

#!bash
sudo apt-get install upstart

The system will probably ask if you are sure, as this package conflicts with some pre-installed packages. Confirm (usually typing 'Yes, do as I say!'), and install it.

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

Setup Asterisk

Finally, you need to 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.

Feel free to contact the community if you run into any issues.

Clone this wiki locally