Asterisk billing

Asterisk CDR Fields

Asterisk generates a CDR (Call Detail Record) for each call. By default, records are stored in comma-separated value file will be created in /var/log/asterisk/cdr-csv. You can specify account codes and AMA (Automated Message Accounting) flags on a per-channel (Zaptel et al) or per-user (IAX, SIP) basis to help with accounting. Look at the top of cdr/cdr_csv.c to see the format for the records.


  1. accountcode: What account number to use: Asterisk billing account, (string, 20 characters)
  2. src: Caller*ID number (string, 80 characters)
  3. dst: Destination extension (string, 80 characters)
  4. dcontext: Destination context (string, 80 characters)
  5. clid: Caller*ID with text (80 characters)
  6. channel: Channel used (80 characters)
  7. dstchannel: Destination channel if appropriate (80 characters)
  8. lastapp: Last application if appropriate (80 characters)
  9. lastdata: Last application data (arguments) (80 characters)
  10. start: Start of call (date/time)
  11. answer: Answer of call (date/time)
  12. end: End of call (date/time)
  13. duration: Total time in system, in seconds (integer), from dial to hangup
  14. billsec: Total time call is up, in seconds (integer), from answer to hangup
  15. disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY, FAILED (on some CDR backends, e.g. ODBC, these may be integers; note that more detailed info can be found in the dialplan variable $HANGUPCAUSE)
  16. amaflags: What flags to use: see amaflags: DOCUMENTATION, BILLING, IGNORE etc, specified on a per channel basis like accountcode.
  17. user field: A user-defined field, maximum 255 characters

In some cases, uniqueid is appended:
  • uniqueid: Unique Channel Identifier (32 characters)

Asterisk CDR Storage Methods

Account codes and flags are set in the various channel configuration files or in the extension definition in extensions.conf.

Asterisk Applications


  • A CDR record will not be created if you use a .call file that calls an application instead of an extension. Workaround: Use an extension that then starts the desired application. See also: Bug report 240
  • You can't use exten => h, if you have any hope of getting accurate billing info. Its wise to call ResetCDR(w) in your exten => h, or not use it at all.

Important note on transfers

In general: As soon as transfers (or parked calls that were resumed) come into play, be it attended, blind or through SIP REFER, it is very likely that you will end up with incorrect and misleading CDR data; see bug 11093 and CDR behaviour changes in 1.4.

IAX: If you are trying to collect records on IAX to IAX calls you need to be aware that by default, IAX will attempt to transfer calls in this situation (if DTMF is not required). When the transfer is completed the call is dumped from the middle machine and thus the call detail records will report a short call time. If you want detailed records you must turn off IAX transfer (transfer=no in 1.4 or notransfer=yes in 1.2), but unless your servers are very close together, you will definitely get a latency hit from doing so.

Background info on confusing CDRs

The core of Asterisk is a threading model but a very conservative one. Only origination channels and channels executing an application have threads. The B leg of any call operate only within the same thread as the A leg and when something happens like a call transfer the channel must first be transferred to a threaded mode which often times includes a practice called channel masquerade, a process where all the internals of a channel are torn from one dynamic memory object and placed into another. A practice that was once described in the code comments as being “nasty”.

The same went for the opposite operation the thread was discarded by cloning the channel and letting the original hang-up which also required hacking the cdr structure to avoid seeing it as a new call. One will often see 3 or 4 channels up for a single call during a call transfer because of this.

For Asterisk 1.6 (or later) we might see a completely re-designed method to generate and store CDR data.

Least cost routing (LCR)

Especially for EU countries and small offices/home offices: Since the introduction of Call-By-Call (and Carrier Pre-selection) things have become both a lot cheaper and more complicated. The VoIP providers that offer IP-to-phone services add to the complexity of finding the cheapest route for a call. Finally there's the emerging ENUM system.
Implementing LCR functionality in Asterisk can be accomplished without too much effort using AGI and a mySQL backend
  • Application LCDial Asterisk third-party add-on. Adds LCDial() command, which is just like Dial() but looks up the dialed number in a database, to find a dial-string for that destination.
  • realtime Call-by-Call rates for the german market provided as ENUM service
  • LCR tool for i4l: Collection of LCR a variety of LCR tools for Asterisk, i4l etc
  • ZIDial Adds ZIDial() command.Low cost routing with multiple redial (on each route), also multiple redial for multiple provider.

Pre-paid applications

If you have users that you have little or no contact with, or where fraudulent usage can be an issue, it might be worth looking at Pre-paid solutions. With the pre-paid model we need to access a users funds before the call is made in order to see how much cash is available for the call to be made. Next, once the call destination is known, we should start a timer to disconnect the call (or more userfriendly, interrupt the call with an announcement) and finally close the deal.

Some considerations when creating a calling card application:
  • take care of multiple calls using the same credentials (PIN or username)
  • the SIP protocol does not allow for recognition of a client that was disconnected
  • cut off the call when the credit has dropped to 0
  • the hard part is to correctly rate a call, e.g. attaching the correct tariff

See: Asterisk Prepaid Applications

Post-paid (billing)

The Call Detail Record
Asterisk generates CDR (Call Detail Records) that contain data about which extension made or received calls to or from which number for how long. These records are generally stored in plaintext logfiles located in /var/log/asterisk/cdr-csv, but can also be stored in PostgreSQL or (with the asterisk-addon package) MySQL databases.

Rating the CDR
Since Asterisk does not know about its location or the deals the machine has with Telco providers (your PSTN line or perhaps a VoipJet, NuFone, VoicePulse or IConnectHere account), so it cannot know the cost of each call. To solve this problem the CDR's need to be 'rated'. On each combination of parameters you could technically assign a buyers price and a sellers price. This process is generally called 'rating'.

Billing the users
Only when we have neatly rated CDR's the billing process can start, but this is now a reasonably simple process of accounting all prices linked to an account code or source or destination.

Software out there
There are probably some very decent commercial rating/billing packages out there, but only very few open source ones. Most notably there is Trabas Billing, however the Trabas company seems to be taking further development on the software back from the community.

Asterisk Billing Resources

Open Source Software

Also See: Open Source Billing Systems


  • A2Billing is an Open-source VoIP Billing, Calling Card, Wholesale Solution. Includes LCR & LCD, rate-engine, callerID authentication, multi language/currency, Invoicing, DID management, Callback, Agents and much more! -


  • astCDRview is an open source, licensed under GNU/GPL, lightweight, Web-based, multi-language Asterisk SQLite CDR viewer that supports multiple outgoing carriers, multiple incoming numbers, billing, an address book, and extensions -


  • AstPP is not only a web-based, user friendly billing interface for Asterisk and VOIP. It is also provides a gui editor for REALTIME devices and dialplans. AstPP is Open Source and under constant development. Prepaid, Postpaid and Calling Cards supported as well as resellers, lcr, callbacks,etc. -


  • EasyITSP, an open source ITSP/Hosted PBX solution that sits on top of Digium's open source Asterisk PBX, has been released to the public. EasyITSP allows people with little experience to easily manage and run an ITSP and/or Hosted PBX services with its small footprint and its easy to use admin and customer portals. EasyITSP is quickly gaining ground in its market with constant development of new features. To learn more and view a demo, visit


  • Freeside is the open-source billing, ticketing and account administration package for Internet Service Providers that now includes support for VoIP CDR rating and billing. Freeside Internet Services also offers installation, integration, configuration, migration, training, and customization services. - Freeside Internet Services Inc.


  • MagnusBilling® is a VoIP Billing server system that brings together the best IP Billing Telephony software in the market, creating a comprehensive, flexible and superior tool. MagnusBilling was made for companies that need freedom to build their own VoIP server. You will be able to chose your termination, giving your business larger flexibility and autonomy. For more info visit

Commercial Software & Services

NEON Soft - Billing, Rating and Monitoring solution for Asterisk

  • CDR Rating
  • Flexible Rate Management
  • Subscription plans (Recurring and One-Off Charges)
  • Prepaid / postpaid billing
  • Reseller function
  • Discount Plans
  • White Labelling
  • Fixed Line billing
  • Customer Portal for your clients
  • Detailed Analytics
  • Live Monitoring
  • LCR
  • Rate Analysis
  • Unlimited Rate Plans
  • Much more...


ICTBroadcast is a Unified communication and telemarketing solution for service providers with pre-paid multi service billing , multilingual support and advance routing system . ICTBroadcast features Voice broadcasting, fax blasting, mass sms messaging bulk Email marketing and Survey Conducting.

  • Prepaid and Multi Service billing
  • Multi language and Multi currency support
  • Flexible and configureable as per requirments.
  • Real Time billing
  • SMS billing based on segments.
  • Fax billing based on pages.
  • Voice billing based on duration.
  • Web based and user friendly.
  • Least cost routing supported.
  • Payments managment included.
  • Multi tenant system.
  • Scalability, reliability and high availability.
  • Linux based secure system.
  • Real time campaign and call statistics
  • Multiple rate plans supported.
  • Advance routing system included.


Mature and complete voice billing system for the major open source telephony engines namely Asterisk, FreeSwitch, Yate and OpenSIPS.

  • Real-time billing
  • Flexible rating
  • Multiple business models
  • Prepaid and postpaid service
  • Products and account management
  • Web-based customer care and self-provisioning
  • Virtual private networks for corporate accounts
  • Reports and invoices
  • Least Cost Routing
  • Web Interface
  • Credit Card payment processing
  • Partnerships /Reseller
  • Scalability, reliability and high availability
  • Operation support systems and fraud detection
  • Statistics and monitoring
  • Multiple networks integration
  • Scratch cards and recharge cards

Cybercallshop - Cyberhotel - by Comdif Telecom WIN32 VIrtual Machine

Comdif Telecom is working on billing Voip software since long time.
Our goal is to make friendly software easy to install for peoples without large skill.

-Last Cybercallshop version work on WINDOW XP/VISTA/SEVEN computer
and is able to give you a full working standalone system
able to make voip call / Cybercafe control / Wifi internet acces and have a friendly GUI for administration
to bill Calls Cybercafe and internet access .
Please visit here for howto and download links
The best new is that Cybercallshop have advanced routing system and you can use 1 to 5 cheap Voip provider of your choice
for each destination !! enjoy

Now Cyberhotel is online , Cyberhotel have a special GUI for hotel with powerfull wakeup system and many more.
All our systems are as well available to install on Linux server

Call Accounting Mate by

The world's most popular shareware Do-It-Yourself Call Accounting Software

Call Accounting Mate is a call accounting software that can be used in institutions such as offices, hospitals, universities, and organizations that need to allocate telecom costs to various individuals, departments or cost centers. It can also be used to monitor telephone costs and productivity of each and every employee in the company. Call Accounting Mate includes more than 50 built-in reports, support for accounts codes and pin codes, multiple operator support, contacts database to quickly identify business and personal calls, client billing, flexible cost calculation, support for both incoming and outgoing calls, built-in query builder, and support for most telephone and PBX systems.

Support for asterisk is in the form of a custom CDR module which is included or directly via the mysql database. Asterisk Support forum for the software is located at Call Accounting Asterisk and more information is available at Call Accounting Site .

Call Accounting Mate designed by is the only browser based, integrated webserver solution with a built-in report writer and SQL database engine. The software has an automated task scheduler for efficient unattended reporting. * Call Accounting Mate - starts at $375

Join us on Twitter here

Alternatively, check Hosted Call Accounting for managed enterprise services.

Calls Professional for Asterisk PBX - interakt Co.

Calls Professional for Asterisk PBX is a program suite, which is designed to manage call statistics and greater review in telephone network. It includes programs Asterisk CDR server and Calls Professional. CDR Server is used to collect data of calls from Asterisk PBX, user settings and program activity, Calls Professional is multi purpose / multi user program for reviewing, making print outs and export call reports. The latter possibility is to create own phone book, and includes a whole palette of other useful settings. Program packet is ideal expedient for traffic control in telephone network and control of expence in company or any other organization.

CenIP SoftSwitch:

CenIP VirtualServer is a full-featured platform for VoIP billing. It provides routes/customers/devices gui manager with support for prepaid, postpaid, callingcard, resellers, lcr, dids and a lot more.

Cybex Development VoIP Billing System

Prepaid & PostPaid Included. Wholesale, End-User, Calling Cards.
We provide the lowest price.

Datatex Dynamics

Datatex has been developing software solutions for the telephony industry since 1999.
Topaz Next Generation (TNG)

TNG is the latest Telephone Management System (TMS) or billing system released.
The Asterisk version of TNG has the following features:
  • Generates a call record for each part of a transferred call. (e.g. call transferred 5 times will show 5 call records
with each party reported)
  • Calls transferred or forwarded to queues will properly show the extension the call ended up on.
  • Transferred unanswered calls properly identified.
  • Runs on Windows or Linux.
  • Connects to the standard Asterisk Manager Interface.
  • Report drill down from summary level to detailed calls.
  • Report scheduling to email reports automatically.

DTH Free Call Rating and Taxation Service

This free, hosted service was designed primarily for companies who need to rate and tax their call records but may not be able to justify implementation of a full VoIP Billing and Customer Management system.

Using our service is simple. Import your rate sheets, upload your call records (file upload or SOAP API) and we will return rated records to you.

Once you get your rated file back, you can use your accounting system (QuickBooks®, etc) to send out your invoices.

We currently support Native CSV, Asterisk CSV and Sansay VSXi source file formats for postpaid environments and a SOAP API for real-time or prepaid environments.

IPerbill - VoIP Billing System

  • Main features:
    Online administration from any web brower
    Multiple rate plans management
    Multiple providers management
    Multiple currencies management
    Prepaid and postpaid accounts management
    Reports displaying margin per destination
    Real time quality statistics (ASR, ACD, PDD)
    RADIUS AAA server (with RADIUS client for Asterisk)

  • Calling cards module:
    Prepaid card batches management
    Batch data export for printing
    Access number rating
    Card resellers management

  • Call back module:
    Geographic area management (limitating usage of call back products)
    Call back access numbers management
    Classic ANI call back
    Trigger call back (or DID call back): one DID per customer
    Web call back (customisable web interface)
    Possible integration for SMS call back

  • Residential, Call shops & Corporate module:
    VoIP (SIP or IAX) extensions authentication
    Additional services billing (Voicemail, DID, ...)
    Mail alerts management (low credit for instance)
    Web interface for customers
    Resellers management

  • Wholesale A-Z and/or Termination (GSM, E1, SS7):
    Optimized RADIUS server for wholesale traffic
    Multiple Asterisk RADIUS clients management
    Advanced call limitations per customer and/or per destination
    Web interface for customers

  • Mobile Operators (MVNO):
    International traffic routing management
    Minutes plans management
    SMS & Data billing
    Mobile phone fleets management

MBILLING - Advanced VoIP billing system

FREE and FULL versions

  • FULL version features
    Wholesale traffic
    Residential use
    Callshop module
    Total DID management
    Prepaid / postpaid billing
    Reseller function
    Company logo upload (white labeled)
    IVR complete function
    Massive call sending
    Customised softphones development
    Custom user dialplan
    Custom rates
    4 different web interfaces
    Payments methods
    Load balancer
    Much more...

MOR - advanced billing and routing solution for Asterisk

User friendly/presentable billing. Huge amount of functions. LiveCD available.

Omniware Billing System

Operates a hosted billing system services for ITSPs and ISPs. Also offered as standalone product. Used in two deployments by Bell Canada, and designed to be very flexible.


OpenRate is an open source, commercially supported, high performance batch and real time rating engine. For end users it is licensed under GNU/GPL, for systems integrators and resellers the proprietary license allows white-labelling or re-branding.
Can support virtually any rating scheme using a pipeline configuration of standard modules. Extendible and highly flexible.

PayPal - IPN - Subscription VoIP Billing Solutions

Dynasoft TeleFactura

  • Dynasoft TeleFactura is the definitive BSS OSS convergent telecom voice, data, voip, billing and Radius Authorization Authentication Accounting AAA system solution for data, voice, Wifi, ISP, WISP, mobile, MVNO, telecom, callshop, operators and carriers. Billing includes carrier provisioning, account reconciliation, mediation, call rating. Able to pull all CDR data from Asterisk, process it, invoice it and publish it to its own Web portal, in real time and using hundreds of different options and settings.


  • Phonyx IP/ISDN-PBX based on Asterisk and opensips, Czech Web-Interface (for admins even for customers), Czech sounds, specialised for czech VoIP providers, High-availability support, Skype channel support, Prepaid/Postpaid support.

SAM Reports by Token

Asterisk CDR Reports made Simple

  • Windows desktop application for Asterisk CDR Reports and Queue Reports
  • Interactive drag & drop interface for designing Asterisk reports
  • BI Pivot Reports - Drag & Drop
  • No installation (does not req. db or web server) or maintenance required

SipTar Billing Server - Integrated Asterisk Billing, Routing Solution & SMS, TTS, CallBack and Calling Card

SipTar Billing Server - SipTar Billing For Asterisk - SipTar Billing Server is a powerful billing and routing system, SipTar Callshop, SMS, Callback, Text To Speech Message and Calling Card System.

Screenshots of SipTar Billing Server in Action:

Streamco Smartswitch

Free routing+billing telephony system based on Asterisk.
Has built-in reseller/wholesale, pc2phone, calling cards, call-center, pbx, virtual pbx etc applications.
User-friendly web interface (including visual dialplan editor). Flexible routing(LCR, code length, time of the week, priorities...).
Financial Module allows to automatically block companies or users basing on their balance.
Mailing and SMS subsystems.
Role-based permission system for web access. Web portals for users and companies.
Accounting(payments, invoices, refills, etc) is tightly coupled with billing/routing.
Real-time billing with support of multiple currencies.
Web interface allows to configure the system, check dialplan, view active calls, view statistics with selected granularity, export CDR to files, etc. No need to edit config files!
High performance. Written in C/C++/Java.

Super Technologies - VOIP Billing Solutions

Super Technologies has been in VOIP service since 1999. Was the first company
in the world to offer a DID number on a IP Device similar to vonage, and got an award
on the service from Internet Telephony Magazine and in the Internet Wrold Show in 2001.
With this experience and software in use for over 5 years now, they are now offering
the same software that they use for their own services, to the world to offer billing to their clients.

They have software for VONAGE Type Service, Net2phone and ip centrex services, sample are all working and live
you can check them out on and

Web site for software is

Telcotwo 2.0

Call Accounting For Resellers

  • Software as a Service, a complete WEB 2.0 application
  • Recurring profitable monthly income
  • High performance Low cost, from US$0.20 per extension per month
  • A fully managed alternative to hardware and software
  • View reports via any web browser
  • International coverage and support
  • Online help and training
  • Low cost Data Buffers, alternatively use our FREE SOFTWARE for ASTERISK and all traditional PBX.

How Does TelcoTwo2.0 Help You?
Simple: We built TelcoTwo2.0 Call Accounting to make it easy for you and your customers to manage phone use and infrastructure.

What Is TelcoTwo2.0?
TelcoTwo2.0 Call Accounting is an Internet application and business tool, designed to benefit the reseller and the customer in ways that old fashioned stand alone call accounting software just cannot do.

TelcoTwo2.0 Call Accounting is designed to generate profit for the reseller in all aspects of your service. Least Cost Routing, equipment provision, and elevating the customer's perception of your company through unique "your brand" options.
When You Use TelcoTwo2.0, you will:

  • create a healthy monthly income
  • improve your company image through branding
  • manage your customer environment more professionally
  • have a new and unique sales proposition to grow your customer base

Who Is TelcoTwo2.0 For?

  • PBX resellers
  • Telecoms Consultants
  • Large Businesses
  • Small Businesses

Vidanetwork Technologies - VOIP Billing Solutions - Powerful billing system that allows you to setup Pre-pay, Post-pay, metered Flat Rate billing plans for residential and Cooperations. Their scalable network management and billing system integrate multiple Asterisk call servers together to work like one system. The web-based solution has 4 levels of access interfaces: Administrator, Operator, VPBX admin, and End User Portal. It also offers Hosted Virtual PBX and Virtual Call Center solutions for offering services to business users. If you already have a Web page and a payment gateway account (like Paypal), they can also integrate them with their software, so that your customers could sign up your services from your web page and make payments online.

If you are service providers and would like to offer services to residential and business users, this is definitely the right solution for you!

vspPanel - Integrated Asterisk Billing Solution & Control Panel

vspPanel - Asterisk Control Panel - vspPanel is a full control panel system for the Asterisk PBX and has been designed as a "VSP In A Box" solution, much like it's counterpart CPanel in the Web Hosting Industry vspPanel allows users to control all aspects of their Asterisk server from a web interface, along with call routing, adding of providers and customers and most importantly billing (Both Pre-paid and Post-Paid). vspPanel does not require any additional hardware and is already begining to be offered in Data Centers around the world as a VOIP Provider Hosted Solution, however it may be installed on any Linux Server along with Asterisk. vspPanel has been designed to allow any entreprenuer to become a VSP and offer VSP services to their customers and alleviates the need for an operator to be a "technical guru".

Current Status: Free Beta Available.

Screenshots of vspPanel in Action:

YakaVOIP- Integrated web billing solution for Asterisk

YakaVOIP is a fully integrated, open-source -NOT FREE-, web-based, user friendly billing and administration interface for Asterisk and Voice-Over-IP. It leverages existing open-source technologies (Joomla, PHP, MySQL) and ecompases 3rd party payment gateways like Paypal, MyGate, Moneybookers & Google Pay.


Call4Smile is a hosted unified broadcasting service that offers Voice, SMS and Fax broadcasting online. You don't have to buy any software. Just need to have access to the Internet and a web browser and then using, you can broadcast your message anywhere in the world.

See also

Created by: oej, Last modification: Tue 16 of Jan, 2018 (14:04 UTC) by codedesk123
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+