Village telco Server Project.
This project is based arround the raspberry PI mini computer. We use the model B with 512MB ram and Ethernet interface. As the software base we use the moebius minimal Raspbian wheezy distribution.
Preparing your SD card for the Raspberry Pi
In order to use your Raspberry Pi, you will need to install an Operating System (OS) onto an SD card. An Operating System is the set of basic programs and utilities that allow your computer to run; examples include Windows on a PC or OSX on a Mac. These instructions will guide you through installing a recovery program on your SD card that will allow you to easily install different OS’s and to recover your card if you break it. 1. Insert an SD card that is 4GB or greater in size into your computer 2. Format the SD card so that the Pi can read it a. Windows i. Download the SD Association's Formatting Tool from 1 https://www.sdcard.org/downloads/formatter_4/eula_windows/ ii. Install and run the Formatting Tool on your machine iii. Set "FORMAT SIZE ADJUSTMENT" option to "ON" in the "Options" menu iv. Check that the SD card you inserted matches the one selected by the Tool v. Click the “Format” button b. Mac i. Download the SD Association's Formatting Tool from https://www.sdcard.org/downloads/formatter_4/eula_mac/ ii. Install and run the Formatting Tool on your machine iii. Select “Overwrite Format” iv. Check that the SD card you inserted matches the one selected by the Tool v. Click the “Format” button c. Linux i. We recommend using gparted (or the command line version parted) ii. Format the entire disk as FAT 3. install moebius a. windows use the discimmage tool b. mac see linux c. linux use the dd command to transfer the image to your SD card. dd if=file.img of=/dev/sdx bs=1MB where x is you cards device adress,
Note: The builtin Windows formatting tool will only format the first partition that Windows can read not 1 the entire disk. For this reason we advise using the official SD Card Association Formatting Tool.
1) asterisk pbx. We are not going to reinvent the wheel so grab you copy from http://www.raspberry-asterisk.org/
2) Asterisk billing
A2Billing Install on Debian
A2Billing is a global switching, billing and Customer Relationship Management solution for small to medium VoIP providers. It allows a large set of VoIP services ranging from Calling Cards to Wholesale VoIP business. Go through this step by step tutorial to install A2Billing on debian (wheezy).
- GENERAL SECTION ****
- apt-get update
- apt-get upgrade
- apt-get -y install asterisk
- apt-get -y install php5 php5-mysql php5-dev
- apt-get -y install apache2
- apt-get -y install mysql-server mysql-client phpmyadmin
- DOWNLOAD A2BILLING ****
- cd /usr/src
- wget https://github.com/Star2Billing/a2billing/archive/master.tar.gz
- tar xvf master.tar.gz
- cd a2billing-master
- AGI & GENERAL CONF SECTION ****
- cp a2billing.conf /etc
- cp /usr/src/a2billing-master/AGI/a2billing.php /usr/share/asterisk/agi-bin
- ln -s /usr/src/a2billing-master/common/lib /usr/share/asterisk/agi-bin/lib
- cp -r /usr/src/a2billing-master/admin /var/www
- cp -r /usr/src/a2billing-master/agent /var/www
- cp -r /usr/src/a2billing-master/customer /var/www
- cp -r /usr/src/a2billing-master/common /var/www
- MYSQL DATABASE SECTION ****
Use phpmyadmin or mysql command line interface to create a2billing database, a2billing database user and a2billing db user password. You should update [database] section in a2billing.conf with these values.
- cd ./DataBase/mysql-5.x
you will be asked for a2billing databse name/user/passwd during the execution of the install-db script. You will end up with something like 97 tables in your a2billing database. You can check if this is the case with mysql commands: >use a2billing-database-name; >show tables;
- ASTERISK CONFIGURATION SECTION ****
- cd /etc/asterisk
- touch additional_a2billing_sip.conf additional_a2billing_iax.conf
- include additional_a2billing_sip.conf at the end of sip.conf
- include additional_a2billing_iax.conf at the end of iax.conf
Add following settings to /etc/asterisk/manager.conf:
A2billing should have its proper context in extensions.conf as shown bellow:
[a2billing] exten => _X., 1, NoOp exten => _X., n, Progress() exten => _X., n, AGI(a2billing.php) exten => _X., n, Hangup
- A2BILLING CRONJOBS SECTION ****
Create a2billing running directory: #mkdir /var/run/a2billing
- crontab -e
Copy the following cronjobs:
- update the currency table
0 6 * * * php /usr/src/a2billing-master/Cronjobs/currencies_update_yahoo.php
- manage the monthly services subscription
0 6 1 * * php /usr/src/a2billing-master/Cronjobs/a2billing_subscription_fee.php
- To check account of each Users and send an email if the balance is less than the user have choice.
0 * * * * php /usr/src/a2billing-master/Cronjobs/a2billing_notify_account.php
- this script will browse all the DID that are reserve and check if the customer need to pay for it.
- bill them or warn them per email to know if they want to pay in order to keep their DIDs.
0 2 * * * php /usr/src/a2billing-master/Cronjobs/a2billing_bill_diduse.php
- This script will take care of the recurring service.
0 12 * * * php /usr/src/a2billing-master/Cronjobs/a2billing_batch_process.php
- To generate invoices and for each user.
0 6 * * * php /usr/src/a2billing-master/Cronjobs/a2billing_batch_billing.php
- to proceed the autodialer
- /5 * * * * php /usr/src/a2billing-master/Cronjobs/a2billing_batch_autodialer.php
- manage alarms
0 * * * * php /usr/src/a2billing-master/Cronjobs/a2billing_alarm.php
- manage archive
0 12 * * * php /usr/src/a2billing-master/Cronjobs/a2billing_archive_data_cront.php
0 10 21 * * php /usr/src/a2billing-master/Cronjobs/a2billing_autorefill.php 15 * * * * php /usr/src/a2billing-master/Cronjobs/a2billing_batch_cache.php
- A2BILLING LOG FILES SECTION ****
- mkdir -p /var/log/a2billing
- A2Billing Sounds Installation *****
- cd /usr/src/a2billing-master/addons/sound
- Root Vs Asterisk user ****
By default all files and directories created during this installation process belong to root user. However It should be noted that for A2Billing to work proprely, some of theses files/direcroties have to belong to asterisk user. In particular the following ones: a2billing.conf (/usr/share/asterisk/agi-bin additional_a2billing_sip.conf (chmod 777) additional_a2billing_iax.conf (chmod 777) all web folders (admin, agent, customer, common) log forlder The permissions/ownership setting is one of the most significant issues that arise when dealing with a2billing installation.
3) Freeswitch + Vbilling
wget --no-check-certificate http://goo.gl/ap7KV -O install.sh chmod +x install.sh ./install.sh