09 February 2012

A2Billing System Settings

  • Global List
  • Group List
  • Add Agi-conf
  • Config Editor 
System Settings are where the different areas of the platform are setup, including the agi-conf(s) which manage the call in progress.
    • Global - System wide settings such as currency.
    • Call-Back - Call-back behaviour
    • WebcustomerUI - Configuration variables for the customer interface
    • SIP-IAX-Info - VoIP customer configuration information.
    • Epayment_method - Configure online payment gateways.
    • Signup - Sign-up related settings.
    • Backup - Backup and restore settings.
    • WebUI - WebUI and API configuration
    • Peer_friend - Default settings for auto-creation of VoIP accounts.
    • Log-files - Handles the location of the log files.
    • Agi-conf1 - The default agi-conf controlling the call in progress.
    • Notifications - Notifications configuration.
    • Dashboard - Dashboard configuration.
    • WebAgentUI - Handles the agent user interface parameters.
New agi-conf can be added as required and addressed via the asterisk dialplan. Agi-conf1 is by default set up for calling card operations. All subsequent agi-confs are copied from the agi-conf1 settings. Different agi-conf are required to provide different services, e.g. calling card or VoIP.

A2Billing Initial Set-up

This guide takes you through the initial stages of setting up A2Billing for production.

System Settings | Global Settings.

Set the base currency, manager settings timezones, and all the other settings which are appropriate to your installation. Note that if you change the currency, you also have to update the currencies under Billing | Currency List

Trunks

Create the trunks to the service provider in Asterisk, and confirm they work by configuring an extension in Asterisk and dialling out via the new trunk. Then tell A2Billing that the trunks exist and they can be used in the Providers | Trunks section.

Call-plans & Rate Tables

Create a call-plan and rate tables under rates. The relationship is that one customer has one call plan, which may have multiple rate tables (usually one per trunk) which in turn has multiple rates. Edit the call-plan and add the rate tables pertaining to that call-plan.

Rates

Create your rates and upload them into your rate tables, Note that the longest match of dial-code to dialed-digits is chosen first, and that a call cannot be made unless a rate exists for the destination.

Asterisk Dial-Plan

A VoIP dial-plan may look like...
[a2billing]
exten => _X.,1,NoOp(A2Billing Start)
exten => _X.,n,DeadAgi(a2billing.php,1)
exten => _X.,1,Hangup()
...whereas a calling card dial-plan may look like this: -
[a2billing-callingcard]
exten => _X.,1,NoOp(A2Billing Start)
exten => _X.,n,Answer()
exten => _X.,n,Wait(2)
exten => _X.,n,DeadAgi(a2billing.php,1)
exten => _X.,1,Hangup()
Note that with VoIP, the call is not usually answered, whereas with a calling card, it is, so you can play audio to the customer. A2Billing VoIP accounts will use the a2billing context by default, whereas you will have to configure your calling card access number to pass into the a2billing-callingcard context.

Agi-Conf

The “1” after “a2billing.php” in the above dial-plan examples refer to which agi-conf to use. The agi-conf under System Settings controls the call in progress and how the call is to behave, e.g. whether to read out the balance, prompt for the number to call, ask for PIN etc. The agi-conf is well commented, so set its parameters according to the way that you want to handle the call.

Create Customer and Test

Once you have defined your product using call-plans and rates, then you can create a new customer, and at the same time this, by default, creates new VoIP settings. You can now register a VoIP phone or test calling cards once you have added credit to the customer's account.

A2Billing Install Guide

Some knowledge of Asterisk and Linux is expected in order to install the system.
  1. Install Asterisk with Asterisk Realtime, MySQL, Apache and PHP version 5.2
  2. Download and explode the A2Billing tarball.
  3. Move, copy or symlink the Admin, Customer, Agent and Common directories into web-root, or configure apache to display them in a directory of your choice.
  4. Move copy or symlink AGI/a2billing.php into the asterisk agi-bin directory, and also copy or symlink the common/lib directory.
  5. Create a new A2Billing database then create the database schema with DataBase/mysql-5.x/a2billing-mysql-schema-v1.7.0.sql
  6. Apply each “DataBase/mysql-5.x/UPDATE...” SQL file in order from 1.7.0 to the latest version.
  7. Place a2billing.conf in /etc/ and adjust the database settings to suit your install.
  8. Move or copy your sound files from addons/sounds/ into the asterisk “sounds” directory.
  9. Install the cronjobs from the Cronjobs/ directory. The comments at the top of each file give a suggested schedule for each cronjob.
  10. Configure the Asterisk dial-plan for A2Billing using the files in addons/asterisk-conf/ as a guide.
The role of A2Billing is to provide public telephony services and therefore in the majority of cases, customers must be given access by both web services and VoIP. A2Billing is often better hosted on a public IP address to reduce NAT issues.
Although an aggregation or PBX distribution can be used as a base for A2Billing, most are not security hardened for connection directly to the Internet and indeed are provided with the caveat that they should be located behind a separate hardware firewall with no access allowed from outside the LAN (Local Area Network).
Note that any telephony server exposed to the internet is a valuable target where an attacker can make real money using a variety of fraudulent techniques. Therefore great care should be taken in building any telephony system to ensure that it is secure.
We recommend that all customers and users operate the latest version of A2Billing. In general we have a policy of not removing any functionality from A2Billing, so there is little or no danger in upgrading to the latest stable version.

How Call-Back Works

Call-Back services are often used in countries where the cost of making an international call is very expensive, and the customer can save money by launching a call from another country, and then being presented with secondary dial-tone so that they can make an onwards call.
How Call-Back Works
How Call-Back Works
A2Billing supports a number of ways of triggering a call-back. A call is triggered to the customer, this is called the A leg, and then the customer can make an onwards call. This is called the B Leg.
The customer calls an access number or trigger number on the A2Billing platform, the call is never answered, so the customer is not charged for this call, even if the trigger number is an international number.

ANI Call-Back

The A2Billing platform captures the caller ID of the caller, and a few seconds later, giving the customer time to hang up their phone after triggering the call-back, a call is launched back to the customer. The customer is then prompted for a PIN number to identify the customer, alternatively, their caller ID is recognized, and secondary dial tone is presented, prompting the customer to dial their desired destination.

DID Call-Back

DID based call-back is used in circumstances where the caller ID is not always delivered reliably, often in an effort to block call-back services by the incumbent operator. The customer calls their own personal DID, which in turn triggers a call-back to a previously defined number. This is expensive on DID usage, but may be the only reliable methodology.

Web Based Call-Back

As standard with A2Billing, there is a Customer Portal, and one of the options with the portal is to be able to launch a call-back. The customer types in the number they want to receive the call-back on, and the telephone number of the person they want to call. The call-back is launched with a call to the customer first, and then as soon as they pick up the phone, the second leg of the call is launched to the person they want to call.

IVR Call-Back

IVR call-back is a system developed where tone clamping takes place. The customer rings the trigger number, and via an IVR, is prompted for the number to call, and the number to call-back on. The cost to the customer is a brief call to the access number charged by their operator, then the call-back and subsequent conversation is then charged via A2Billing.

How Billing Works

A2Billing can authenticate calls in a number of ways:-
  1. VoIP registration – the endpoint is registered to A2Billing with a username and password.
  2. IP Address – All calls accepted from a specific IP address.
  3. PIN Authentication – Using a unique PIN code.
  4. Caller ID authentication – Using the CID for authentication. (Pinless dialling)
When a call comes into A2Billing, the customer is recognised using one of the above methods. From their identity, we know the amount of credit available for that customer.
The customer's dialled digits are captured, and from the rate tables pertaining to that particular customer, we know the rate for the destination.
By dividing the available balance by the cost per minute of the call, the total maximum duration of the call can be calculated. A “Dial” command is sent to Asterisk with the total time allowed for the call.
At the end of the call, which is either forcibly disconnected by Asterisk or when either party hangs up, the actual cost of the call is calculated, and the customer's balance decremented.
A2Billing has a very flexible billing system including connection and disconnection charges and stepped billing.

DID Resale

A2Billing is equipped for DID (Telephone Number) resale  and redirection with a variety of charging methods. DID are delivered to the switch from VoIP DID providers or via a PRI. (Primary Rate Interface)
DID Resale

Monthly Subscriptions

Monthly Subscription – a fixed rental for the DID is removed from the customers account on the monthly anniversary of the DID's destination being set up.

A-Leg DID Billing

A-Leg – DID ingress charges are applied per minute. Connection charges can also be applied. Per minute billing can be negative or positive making it suitable for apportioning revenue for revenue share numbers.

B-Leg DID Billing

B-Leg - DID egress charges can be applied for numbers directed to PSTN destinations via A2Billing trunks, or the calls can simply be passed directly to a VoIP destination.

ON-Net DID Billing

On-Net charges can be applied, so that customers can phone each another, and a charge be made for the call, but no carrier charges are incurred, as the DID routes through the platform.

Purchase DID online

Customers can purchase new DID online via the customer portal.

DID Failover

A number of destination priorities can be set up to allow calls to failover to PSTN destinations if the VoIP destination is unavailable. This makes A2Billing particularly suitable for delivering DID reliably to business IP-PBX systems.

How Calling Cards Work

Calling card services is still one of the best ways to allow people to make low cost international calls from their mobile and fixed line phone, and very profitable businesses have been built around the calling card features available on an A2Billing Softswitch.
How Calling Cards Work


A calling card customer calls a DID or access number which is directed to the A2Billing Softswitch. The calling card customer is then prompted for some identification. The A2Billing Softswitch supports both identification by PIN or on the basis of the caller ID, otherwise known as Pinless Dialling.
Optionally, the balance is read out, and the calling card customer is presented with secondary dial-tone, or prompted to dial the number they require.
The rate the customer pays for the call is usually far lower than the cost of the same call using a payphone, the incumbent telephone company or a cell-phone. This is particularly true of international calls.

08 February 2012

Overview of A2Billing

Below is a diagram showing the calls and data-flow between the entities in A2Billing.
A2Billing, A Business in a Box
A2Billing, A Business in a Box

Services

A2Billing can provide a number of services to the end customers including, but not limited to, Wholesale, business and residential VoIP origination and termination, calling card and call-back services, and special applications requiring telephony and billing.

Termination and Origination

A2Billing supports origination and termination using a variety of technologies such as VoIP, PSTN (PRI, BRI and analogue circuits) and GSM gateways.

Revenue Management

A2Billing has a number of payment methods including online payment processors including Paypal, as well as manual payment and top-ups using vouchers via an IVR or the customer's portal with full accounting and reporting.

Sales and Marketing

A2Billing supports commission agents allowing online signup and affiliate marketing, as well automated signup via a simple telephone call providing easy customer acquisition.

Softswitch Architecture

The architecture of A2Billing consists of a database server, Asterisk telephony server and a web-server for administration, agent, customer and online sign-up. Usually these servers are hosted on the same physical hardware, but can be distributed across multiple servers to increase the capacity. A SIP proxy can be added to load balance calls across multiple Asterisk servers and assist with NAT traversal.

VoIP Billing & Termination

There are three main customer types for Voice over IP, and A2Billing supports all of them with flexible VoIP Billing and charging options.

Residential VoIP

Residential VoIP

Residential VoIP - Providing VoIP services, VoIP Billing and DID redirection to the general public. The endpoint is usually a PC-Dialler (or softphone) a physical VoIP phone or ATA. The latest smartphones also support VoIP.

Business VoIP

VoIP for Business

Business VoIP - Providing VoIP termination to IP-PBX systems for companies, billing the calls, as well as providing invoices for VoIP services as well as supplying DID directed to the IP-PBX via VoIP or PSTN.

Wholesale VoIP


Wholesale VoIP - Terminating and billing large numbers of calls from a customer who has an A2Billing Softswitch or similar class 4 or class 5 switch.
The only difference between the above types of service as far as A2Billing is concerned in in terms of volume. Configuration is broadly similar for each service.
The A2Billing Softswitch supports both the SIP and IAX2 protocol as well as a range of VoIP codec protocols, such as g711 which is a high quality uncompressed codec. Where bandwidth is limited, the supplied GSM codec can be used or commercial g729 licenses or g729 voice compression cards for high capacity systems are available.
The customer’s end-point is configured to pass its VoIP traffic through the A2Billing Softswitch, where the call is then least cost routed via the lowest cost carrier, the call is rated, and the customers available balance decremented.

A2Billing Install Guide

Some knowledge of Asterisk and Linux is expected in order to install the system.
  1. Install Asterisk with Asterisk Realtime, MySQL, Apache and PHP version 5.2
  2. Download and explode the A2Billing tarball.
  3. Move, copy or symlink the Admin, Customer, Agent and Common directories into web-root, or configure apache to display them in a directory of your choice.
  4. Move copy or symlink AGI/a2billing.php into the asterisk agi-bin directory, and also copy or symlink the common/lib directory.
  5. Create a new A2Billing database then create the database schema with DataBase/mysql-5.x/a2billing-mysql-schema-v1.7.0.sql
  6. Apply each “DataBase/mysql-5.x/UPDATE...” SQL file in order from 1.7.0 to the latest version.
  7. Place a2billing.conf in /etc/ and adjust the database settings to suit your install.
  8. Move or copy your sound files from addons/sounds/ into the asterisk “sounds” directory.
  9. Install the cronjobs from the Cronjobs/ directory. The comments at the top of each file give a suggested schedule for each cronjob.
  10. Configure the Asterisk dial-plan for A2Billing using the files in addons/asterisk-conf/ as a guide.
The role of A2Billing is to provide public telephony services and therefore in the majority of cases, customers must be given access by both web services and VoIP. A2Billing is often better hosted on a public IP address to reduce NAT issues.
Although an aggregation or PBX distribution can be used as a base for A2Billing, most are not security hardened for connection directly to the Internet and indeed are provided with the caveat that they should be located behind a separate hardware firewall with no access allowed from outside the LAN (Local Area Network).
Note that any telephony server exposed to the internet is a valuable target where an attacker can make real money using a variety of fraudulent techniques. Therefore great care should be taken in building any telephony system to ensure that it is secure.
We recommend that all customers and users operate the latest version of A2Billing. In general we have a policy of not removing any functionality from A2Billing, so there is little or no danger in upgrading to the latest stable version.


A2Billing Initial Set-up

System Settings | Global Settings.

Set the base currency, manager settings timezones, and all the other settings which are appropriate to your installation. Note that if you change the currency, you also have to update the currencies under Billing | Currency List

Trunks

Create the trunks to the service provider in Asterisk, and confirm they work by configuring an extension in Asterisk and dialling out via the new trunk. Then tell A2Billing that the trunks exist and they can be used in the Providers | Trunks section.

Call-plans & Rate Tables

Create a call-plan and rate tables under rates. The relationship is that one customer has one call plan, which may have multiple rate tables (usually one per trunk) which in turn has multiple rates. Edit the call-plan and add the rate tables pertaining to that call-plan.

Rates

Create your rates and upload them into your rate tables, Note that the longest match of dial-code to dialed-digits is chosen first, and that a call cannot be made unless a rate exists for the destination.

Asterisk Dial-Plan

A VoIP dial-plan may look like...
[a2billing]
exten => _X.,1,NoOp(A2Billing Start)
exten => _X.,n,DeadAgi(a2billing.php,1)
exten => _X.,1,Hangup()
...whereas a calling card dial-plan may look like this: -
[a2billing-callingcard]
exten => _X.,1,NoOp(A2Billing Start)
exten => _X.,n,Answer()
exten => _X.,n,Wait(2)
exten => _X.,n,DeadAgi(a2billing.php,1)
exten => _X.,1,Hangup()
Note that with VoIP, the call is not usually answered, whereas with a calling card, it is, so you can play audio to the customer. A2Billing VoIP accounts will use the a2billing context by default, whereas you will have to configure your calling card access number to pass into the a2billing-callingcard context.

Agi-Conf

The “1” after “a2billing.php” in the above dial-plan examples refer to which agi-conf to use. The agi-conf under System Settings controls the call in progress and how the call is to behave, e.g. whether to read out the balance, prompt for the number to call, ask for PIN etc. The agi-conf is well commented, so set its parameters according to the way that you want to handle the call.

Create Customer and Test

Once you have defined your product using call-plans and rates, then you can create a new customer, and at the same time this, by default, creates new VoIP settings. You can now register a VoIP phone or test calling cards once you have added credit to the customer's account.