5 Steps to build your calling card

انظمة بطاقات الاتصال باستخدام أستريسك
أضف رد جديد
مدير الموقع
مشاركات: 234
اشترك في: 11 مايو 2010, 19:53
مكان: Germany

5 Steps to build your calling card

مشاركة بواسطة albalawi »

مشاركات: 27
اشترك في: 09 فبراير 2011, 21:16

Re: 5 Steps to build your calling card

مشاركة بواسطة elmadysm »

5 Steps to build your calling card / billing system based on Asterisk PBX.
General concept of the calling card platform

The phone cards are a well-known product in telecommunication sector, which can be employed from any country where a number of access is available. The phone calling card is a printed card containing the access information and the information
of account to make international as well as national calls. The Card carry a limit on the maximum use and are normally sold by on Internet or in the street distribution.

Today the Calling Cards is one of the top business in the VoIP Industry and A2Billing with Asterisk is trying to complete the needs for large, medium-sized companies and start-up who appreciate the Calling Cards business model. A2Billing allows to craft a calling card management system over your Asterisk Server.

It’s powerful calling card platform can be easily deployed with Asterisk, it is providing wide set of tools to manage a complex & advanced calling card system! With A2Billing & Asterisk, prepaid/postpaid calling card services are just as easy to implement as to make a few entries through a web interface. With its user-friendly, powerful functionality, A2Billing try to end to be the preferred billing software for Calling services. As Asterisk, the most valuable of A2Billing is the open source nature.

The source are provided and the soft can be enhanced by the asterisk community or peoples that use it. This concept will ensure that the soft will grow up and continue to fill the billing needs of the asterisk users. This solution aims to manage all aspects of the calling card service and it takes care of the calling card service through real-time integration for card activation, authentication and debiting the account balance of users. The solution provides Web interface for administrator to manage all the billing system and for customer to see their own call history, balances and user data.


A PC or Server is required to run the software. The size and specification of the PC will be based on the number of concurrent calls that are expected to pass through the platform, and the codecs chosen by the calling card operator. Refer to the Digium website and [http://www.voip-info.org] for minimum recommended specifications.


The A2Billing platform is a fully featured pre-paid and post-paid calling card platform built and designed on LAMP. (Linux, Apache, MySQL and PHP) The telephony interface is supplied by Asterisk, the open source telephony toolkit designed by Digium. The A2Billing platform has many features that are only found in high end calling card platforms costing many thousands of dollars.

Line Interface Cards

In order to connect the A2billing platform to the PSTN, then a line interface card is required. Although there are a number of clone cards, it is recommended that Digium cards are purchased for two reasons. Asterisk is designed by Digium, and given that they supply the cards, one expects the cards to work with Asterisk with the minimum of effort. Digium makes most of its money by selling Asterisk associated hardware, and given that Asterisk is open source, it is in all our interests that the company continues to be supported financially to improve and bring more features to Asterisk.

VoIP Provider

Rather than send calls out via the PSTN, better rates can often be enjoyed using Voice over IP service providers. Ensure that the VoIP provider allows concurrent calls.


In order to take full advantage of all the features offered by A2Billing, a broadband connection will be required, preferably with a fixed IP address. The amount of broadband will dictate how many concurrent calls you can make. The number of calls that ADSL (Asymmetric Services) can carry will be dictated by the upstream speed, irrespective of the downstream speed. Broadband is also required by the web interface to allow your customers to sign up online, and to make payments via Paypal.

Paypal Business Account

A2Billing is equipped with a PayPal payment gateway. So having set up a PayPal business account, A2billling gives the facility to collect payments online and securely with customers topping up their calling cards with either PayPal or any major credit card. A2Billing also supports Authorise.net and Moneybookers.

General Setup

SETP 1 - Log into A2Billing

http://xxx.xxx.xxx.xxx/a2billing> (Username: root ; Password: myroot)


The trunk can be created either in Asterisk using sip.conf, zaptel.conf or iax.conf, or directly from the A2Billing interface. If the trunk is created in Asterisk, then simply refer to the trunk name in A2Billing. Multiple trunks can be enabled, which may have different rates, and will allow the system failover to a working trunk should the default trunk fail.

List Trunk

This screen lists the trunks already created in the system. The system allows a prefix to be added or removed from every call using this trunk

Modify the default Trunk (TRUNK -> List Trunk -> Edit)
PROVIDER TECH: Your Asterisk Trunk Protocol (SIP or IAX)
PROVIDER IPHOST: Your Asterisk Trunk IP/Name

SETP 3 – RateCard


The rate card section is used for defining rates and tariffs. It is imperative that an accurate set of dialling codes is obtained, so that calls can be rated correctly.

If the dialled digits do not match an entry in the rate card attached to the customer, then the call cannot be terminated. A Call Plan is a collection of rate-cards. Therefore a rate-card must be created before the Call Plan, and then added to the group. Both carrier costs and retail rates can be added into this section which will assist in ensuring that each destination is profitable. A Call Plan has many rate cards – A rate card has many rates The Call Plan is applied to a customer via the edit customer screen.

Create a new rate card. A descriptive name, a start date and an expiry date can be set, as well as the trunk to use. If no trunk is specifically defined, then the default trunk will be used. The DNID (Dialled Number Identifier) Prefix allows the definition of a rule to choose this particular rate card. DNID by default is set to all, to match every DNID. The DNID can be set to an individual number to always choose this rate card when the number matches.

Create a RateCard. RATECARD -> Create new RateCard

Add Rate

Rates can be added individually, but this can become tedious, so an import rate function is described below.

Select the rate-card to which you want to add the rate, enter the dial prefix, which matches the rate and give a destination. The remaining fields are filled in with carrier cost, retail cost, minimum duration and minimum billing interval. More control over the rates charged can be enabled by editing a setting in a2billing.conf. The screen will then offer the option to apply stepped charges to the customer. Stop and start dates, days and times will allow different rates to be applied at different times of the day or week. Note that if there is no matching dial-code / day /time, then the call will not be terminated.

There is also a setting which when selected, sets that destination to be included in the package offer as free time to call.

Create a new Rate. RATECARD -> Add Rate

RATECARD Name of the card created before

SETP 4 – Tariff Group / Call Plan

Create Call Plan

A rate-card has to be created first. A group can contain many rate-cards. Give the Group a descriptive name, and then select whether the rate should be chosen on the basis of LCR (Least Cost Routing) or LCD (Least Cost Dialling)

LCR will select a rate based on the cheapest carrier cost, whereas LCD will select the cost on the basis of the cheapest charge to the customer. There is an option to remove the international dialling prefix as some VoIP carriers do not require the leading 00 (0011 in the USA). If the prefix is removed, then the rate card dialling codes must be in the same format, for instance 441 for UK National calls rather than 00441 (0011441 for the USA).

This screen also allows the possibility of applying a Package Offer for a certain number of minutes to a destination.

Create a Tariff Group. RATECARD -> Create TariffGroup
TARIFFPLAN: Name of the RateCard created before

SETP 5 – Customer

A customer has a number of properties, mainly a card number, an Alias and a password. The card numbers are unique, and both identify the customer as well as providing secure access. The numbers are generated randomly with no obvious pattern, so that a hacker cannot calculate valid card numbers. The customer is also assigned with a numeric ID, which is simply consecutively numbered at 1.

Attached to the card number is an Alias. This number, or the customer's email address is used to log in to the web site graphical user interface. Customers can be created by:-

*- Accessing the sign-up page – [http://xxx.xxx.xxx/a2billing/signup]
*- Create the customer through the management pages. This will create a single customer.
*- Generate Customers, which will create a whole batch of customers, where the card numbers can be printed on cards and sold through retail outlets.

*- Import Customers, to provide for existing customer details to be imported from a legacy platform.

Create Customer

Create customer allows the administrator to create a single customer. Certain fields are pre-filled, such as the card number, Card Alias and password. These fields can be edited, however, one must be careful not to compromise the security of the customer’s account. The card number and the password are used to authenticate a SIP or IAX client, while the Card Alias (or customer email address) and password are used to access the customer web interface.

Simultaneous and individual access can be set here. This is a very powerful tool to reduce fraud. Extremely large telephone bills can be racked up in a very short space of time, and indeed, I have seen a company lose £112,000 over a weekend on a single post-pay card with simultaneous access, as multiple concurrent calls were being made to a premium rate number. If individual access is enabled, then the fraudster will only be able to make a relatively few calls, thus reducing your exposure.

Customers can be set up as either Pre-paid or Post-paid. Pre-paid customers have to charge their account with a sum of money before they can make calls. Each time that the customer makes a call, the balance can be read out to them. Post-pay customers pay the operator on receipt of an invoice, after the call has been made. However, to limit the liability and debt risk, a credit limit can be set-up within the system, which if exceeded; the customer will be able to make no more calls.

Create a Customer CUSTOMERS -> Create customer

TARIFFGROUP Name of the TariffGroup created before

Generate Customers

The Generate customers section allows the administrator to create multiple cards with the same properties, which can then be printed on physical cards and sold via retail outlets. More information on individual fields can be gleaned from the list or create customer screens.

List Customers

Customers previously created are listed here. Click edit to change the properties of a customer. The fields are all fairly self explanatory, with text below most fields to explain and clarify the purpose of the field. Clicking Edit will give access to the individual properties of the customer. The form allows VAT to be charged, as well as selecting which tariff group will apply to this customer. Additionally, the page allows the administrator to search for a specific card, or a batch of cards. Having defined a search criterion, the cards selected can be exported in CSV or XML format. Alternatively, certain properties of the card can be batch updated.

It is from this interface that cards are topped up manually via the refill button. This tops up the card, and the when payment is received, it is appplied via the Add New Payment button.

Customer login:
Username: Card Number, Password: WEBUI PASSWORD

Now, your calling card billing system is ready. For use choose one of the two following methods:

Method 1:
Customer dials a number to access the service
Method 2:
Customer uses SIP or IAX agent (Software or hardware)

Un-comment the lines of the CallingCard application

Modify the Incoming Route of the assigned number to Custom App: custom-callingcard,s,1

Method 1
Method 2

When a customer dials the assigned number, A2Billing will prompt to enter the card
Using Caller ID
Log into A2Billing http://xxx.xxx.xxx/a2billing
CUSTOMERS -> List Customer
Click Edit on the customer you want to be authenticated using Caller ID
Enter the Caller ID at the end of the page (CALLERID)
Modify a2billing.conf, change cid_enable=NO to YES
If the customer will access the service using that Caller ID, A2Billing will NOT prompt for a PIN

Add to sip.conf
#include additional_a2billing_sip.conf

Add to iax.conf
#include additional_a2billing_iax.conf

Add to extensions_custom.conf
;allow phones to access trunks
include => outbound-allroutes
exten => s,1,Answer
exten => s,2,Wait,2
exten => s,3,DeadAGI,a2billing.php
exten => s,4,Wait,2
exten => s,5,Hangup

Log into A2Billing http://xxx.xxx.xxx/a2billing
CUSTOMERS -> List Customer
Click SIP or IAX on the customer you want
Click Click here to reload Asterisk Server
Click Edit on the customer you want to modify
Change SECRET to the same value as WEBUI PASSWORD
Change NAT to meet your requirement
Change ALLOW to meet your requirement
مدير الموقع
مشاركات: 234
اشترك في: 11 مايو 2010, 19:53
مكان: Germany

Re: 5 Steps to build your calling card

مشاركة بواسطة albalawi »

جزاك الله خيرا اخ elmadysm

شرح رائع ومفصل احسنت
مشاركات: 27
اشترك في: 09 فبراير 2011, 21:16

Re: 5 Steps to build your calling card

مشاركة بواسطة elmadysm »

والله انت الذى تستاهل كل خير على هذا المنتدى الرائع
انا نقلت فقط
مشاركات: 19
اشترك في: 02 يونيو 2010, 14:38

Re: 5 Steps to build your calling card

مشاركة بواسطة ABD ELSHAFY »

الاخوة الاعزاء كام واحد علي الموقع يجيد الانجلزية برجاء اعادة الموضوع بالعربية ولكم الشكر[ /b]
مشاركات: 14
اشترك في: 18 يناير 2014, 06:33

Re: 5 Steps to build your calling card

مشاركة بواسطة AsteriskFan »

الاخوه الاعزاء يفترض بهذا الموقع ان يكون عربيا ومن لديه علم في شي واجاده في الانجليزية فليترجم لنا الخطوات زكاة في علمه وفقكم الله جميعا
أضف رد جديد

العودة إلى ”بطاقات الاتصال Calling Card System“