Village Telco Server
What is it?
A mesh potato (MP) is a low power wireless telephone adapter that is able to mesh with other wireless nodes by means of the BATMAN wireless mesh protocol. The most simple deployment is to let the mesh potatoes place calls directly to each other without the need of a central infrastructure. In this pure ad-hoc telephony network, both signaling and traffic travel between nodes without the need of a server. Another possible scenario is to have a server in the infrastructure capable of billing and monitoring the calls, keeping credit of the different accounts and enabling advance services as peering with other operators or issuing vouchers for credit.
The major functionalities of the Village Telco (VT) Server are:
- PBX: Exchange of voice calls between mesh potatoes and external operators
- Billing: Keeps track of credit, customer information and status of pre-paid cards
- Monitoring: Provides status information of accounts and hardware in the network
- Advance voice services: Text-to-speech account status, credit balance, system health.
Components
The Village Telco Server package is composed of four main components:
- asterisk realtime : Based on asterisk 1.6 and mysql realtime support.
- a2billing village telco : Based on a2billing version 1.7.0, a2biling incorporates our Village Telco simplified GUI, a SOAP webservice and a few extra patches to work in Ubuntu 10.04. A2billing is written in PHP+smarty and interfaces with Asterisk using AGI and AMI.
- a2billing installation wizard : The wizard interfaces with the SOAP webservice and performs a full installation of a2billing for Village Telco in 5 steps. The wizard is written in PHP+Cake MVC and interfaces with a2billing with SOAP.
- a3glue : The a3glue is a webservice that follows the REST architecture and delivers JSON provisioning and monitoring information to other components of the Village Telco as the Afrimesh monitoring panel. A3glue is written in PHP and interfaces with Asterisk using Asterisk AJAM (MXML).
Versions
Latest release: 0.6 (March 2011)
Download
http://dev.villagetelco.org/debs/
Installation
There are three ways to install the village telco server. The first two require a fresh install of Ubuntu 10.04.2 and the third way is designed for those that want to test the server using Proxmox-Openvz virtualization platform.
The first two installation methods use Ubuntu 10.04.2 as the base operative system. If you have a small system and you are familiar with Linux use method 1. If you want to run the system with more than 100 nodes, we suggest that you enable Asterisk Real Time and use method 2. If you want to test the village telco server quickly, you can try our Proxmox Appliance image (method 3)
(method 1) Installation in Ubuntu 10.04.2
Introduction
This instructions will install Village Telco Server without Asterisk Realtime extensions.
Pre-requirements
- Install the pre-require packages as follows:
apt-get install libapache2-mod-php5 php5 php5-common php5-cli \ php5-mysql mysql-server apache2 php5-gd php5-curl php5-mcrypt php-soap php-pear espeak asterisk
IMPORTANT When you are prompted for the root password of mysql (New password for the MySQL "root" user:) Make sure that you do not forget the password as you will need it later! The installation process will ask you as for your MySQL password a few times :D. Remember this is admin password of MySQL database and not the root password or your system.
Download DEB package
cd /var/tmp; wget http://dev.villagetelco.org/debs/villagetelco-server_0.6-2.deb cd /var/tmp; wget http://dev.villagetelco.org/debs/villagetelco-server_0-6-2.deb.md5
Verify the MD5 signature
md5sum /var/tmp/villagetelco-server_0.6-2_all.deb cat /var/tmp/villagetelco-server_0.6-2_all.deb.md5
Install the villagetelco-server
cd /var/tmp/; dpkg -i villagetelco-server_0.6-2_all.deb
IMPORTANT Until we create alternative asterisk-config packages, we are making backup copies of the files we overwrite in /etc/asterisk and /usr/share/asterisk/agi-bin We expect a apache2 fresh installation. We are disabling the default website and enabling a new website villagetelco under /etc/apache2/sites-enabled
If it is the first time you install the package you can answer "N" to the question of dropping the databases. If you have installed a previous version answer "y" to the question Do you really want to drop the 'mya2billing a2b_wizard a3glue' database?
(method 2) Installation in Ubuntu 10.04.2 with Asterisk Real Time
You need to follow all the steps of method 1 and add asterisk-mysql hooks to your installation.
The Village Telco Server is prepared to use asterisk realtime but unfortunately the asterisk-mysql addons that ships with Ubuntu 10.04 and 10.04.2 remain broken (See: https://bugs.launchpad.net/ubuntu/+source/asterisk-addons/+bug/560656). There are three different ways to enable real time in asterisk
After installing the asterisk-mysql add-on, you need to
Comment the last line of /etc/asterisk/sip.conf with a (;)
;#include additional_a2billing_sip.conf
and restart asterisk
/etc/init.d/asterisk restart
Install our already pre-compiled package
wget http://dev.villagetelco.org/proxmox/asterisk-mysql_1.6.2.0-vt2_amd64.deb dpkg -i asterisk-mysql_1.6.2.0-vt2_amd64.deb
Recompile asterisk add-ons for .deb sources
apt-get build-dep asterisk-mysql apt-get -b source asterisk-mysql
Install the package
dpkg -i asterisk-mysql_1.6.2.0-1_i386.deb
Recompile asterisk add-ons from .tar.gz sources
apt-get install libncurses5-dev libnewt-dev ASTERISKADDONS16VER=asterisk-addons-1.6.2-current.tar.gz cd /usr/local/src wget http://downloads.asterisk.org/pub/telephony/asterisk/$ASTERISKADDONS16VER tar zxf $ASTERISKADDONS16VER mv asterisk-addons* asterisk-addons #Install Asterisk Addons cd asterisk-addons make clean ./configure make menuselect make make install make samples
(method 3) Installation in Proxmox/OpenVZ
Introduction
Proxmox Virtual Environment http://pve.proxmox.com is an easy to use Open Source virtualization platform for running Virtual Appliances and Virtual Machines.
To run the Village Telco image you need to:
- Install Proxmox using the bootable CD in 64bits machine: http://pve.proxmox.com/wiki/Downloads Download the ISO image and burn it to CD-ROM and boot your server from CD-ROM.
- Download our Village Telco Appliance image from http://dev.villagetelco.org/proxmox/ubuntu-10.04-villagetelco_10.04-1_amd64.tar.gz
- From the Proxmox web interface go to VM Manager > Appliance Templates > Upload and upload our template to proxmox
- Create a new virtual machine VM Manager > Virtual Machine > Create > Type: Openvz (use villagetelco server template) and assign an IP to the machine in the venet interface
- Boot the machine and connect to the Village Telco Server via HTTP
Routing requirements
The mesh potatoes use the IP network 10.130.1.0/24 by default. One of the mesh potatoes need to be the gateway to the wired network (Super Node). Let us assume that you have configure a super node (the wired mesh potato) with the IP address 10.130.1.0 (ath0) / 192.168.130.1 (eth0).
The Village Telco Server can be placed in IP address 192.168.130.20. If you use Proxmox, you can assign 192.168.130.2 to Proxmox and 192.168.130.20 to your village telco server.
Routing configuration
Two major configuration steps are needed:
- Advertising the server network in the super node: you need to advertise the 192.168.130.0 network inside of the mesh via the super node. In the super node edit the configuration files
/etc/config/batmand /etc/config/network
root@OpenWrt:/etc/config# cat batmand config batmand general option interface ath0 option announce 192.168.130.0/24 option gateway_class option originator_interval option preferred_gateway option routing_class option visualisation_srv option policy_routing_script
root@OpenWrt:/etc/config# cat network config 'interface' 'loopback' option 'ifname' 'lo' option 'proto' 'static' option 'ipaddr' '127.0.0.1' option 'netmask' '255.0.0.0' config 'interface' 'lan' option 'ifname' 'eth0' option 'proto' 'static' option 'netmask' '255.255.255.0' option 'ipaddr' '192.168.130.1' option 'dns' '192.168.130.2' option 'gateway' '192.168.130.2' config 'interface' 'wifi0' option 'ifname' 'ath0' option 'proto' 'static' option 'netmask' '255.255.255.0' option 'ipaddr' '10.130.1.1'
- In the server we need to add a route back to the mesh network
The easier way to do this is to add to your /etc/rc.local file the line:
route add -net 10.130.1.0 netmask 255.255.255.0 gw 192.168.130.2 exit 0
Another alternative is to edit the file /etc/interfaces/network in the server and add the entry to the network interface section:
post-up route add -net 10.130.1.0 netmask 255.255.255.0 gw 192.168.130.2
Checking the source code
Trunk
trunk: svn co http://dev.villagetelco.org/svn/villagetelco/server/trunk
