Page Contents
- Asterisk CDR Fields
- Fields
- Asterisk CDR Storage Methods
- Asterisk Applications
- Limitations
- Least cost routing (LCR)
- Pre-paid applications
- Post-paid (billing)
- Asterisk Billing Resources
- Open Source Software
- Commercial Software & Services
- NEON Soft – Billing, Rating and Monitoring solution for Asterisk
- ICTBroadcast
- Cybercallshop – Cyberhotel – by Comdif Telecom WIN32 VIrtual Machine
- Call Accounting Mate by callaccounting.ws
- Calls Professional for Asterisk PBX – interakt Co.
- Datatex Dynamics
- DTH Free Call Rating and Taxation Service
- MBILLING – Advanced VoIP billing system
- MOR – advanced billing and routing solution for Asterisk
- Omniware Billing System
- OpenRate:
- PayPal – IPN – Subscription VoIP Billing Solutions
- Dynasoft TeleFactura
- SipTar Billing Server – Integrated Asterisk Billing, Routing Solution & SMS, TTS, CallBack and Calling Card
- Streamco Smartswitch
- Super Technologies – VOIP Billing Solutions
- Telcotwo 2.0
- Vidanetwork Technologies – VOIP Billing Solutions
- Call4Smile
- See also
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.
Fields
- accountcode: What account number to use: account, (string, 20 characters)
- src: Caller*ID number (string, 80 characters)
- dst: Destination extension (string, 80 characters)
- dcontext: Destination context (string, 80 characters)
- clid: Caller*ID with text (80 characters)
- channel: Channel used (80 characters)
- dstchannel: Destination channel if appropriate (80 characters)
- lastapp: Last application if appropriate (80 characters)
- lastdata: Last application data (arguments) (80 characters)
- start: Start of call (date/time)
- answer: Answer of call (date/time)
- end: End of call (date/time)
- duration: Total time in system, in seconds (integer), from dial to hangup
- billsec: Total time call is up, in seconds (integer), from answer to hangup
- 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)
- amaflags: What flags to use: see amaflags: DOCUMENTATION, BILLING, IGNORE etc, specified on a per channel basis like accountcode.
- 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
- Asterisk cdr csv – Text files with comma-separated values
- Asterisk cdr FreeTDS – CDR Records to MS SQL or Sybase database through FreeTDS drivers
- Asterisk cdr manager – CDR Records to manager API
- Asterisk cdr mysql – CDR records to Mysql databases
- Asterisk cdr odbc – CDR records to any database that unixODBC supports
- Asterisk cdr pgsql – CDR records to PostgreSQL databases
- Asterisk cdr SQLite – CDR records to SQLite database
- Asterisk cdr yada – CDR records to any database that yada supports
- Asterisk cmd DBQuery – CDR Backend to store cdr data into a Mysql database by the use of a customizable Query.
Account codes and flags are set in the various channel configuration files or in the extension definition in extensions.conf.
Asterisk Applications
- Asterisk cmd AppendCDRUserField – Append data to CDR User field
- Asterisk cmd Authenticate – Authenticates and sets the account code
- Asterisk cmd ForkCDR
- Asterisk cmd NoCDR: Make sure no CDR is saved for a specific call
- Asterisk cmd ResetCDR: Reset CDR
- Asterisk cmd SetAccount: Set account code for billing
- Asterisk cmd SetAMAFlags: Set Asterisk billing amaflags for this call
- Asterisk cmd SetCDRUserField – Set CDR user field
Limitations
- 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 behavior 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 oftentimes 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.
- cnum.info 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 providers.
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 user’s 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 buyer price and a selling 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
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!
Freeside
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.
MBilling
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 the freedom to build their own VoIP server. You will be able to chose your termination, giving your business larger flexibility and autonomy.
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
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 configurable as per requirements.
- 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 management 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.
Cybercallshop – Cyberhotel – by Comdif Telecom WIN32 Virtual Machine
Comdif Telecom is working on billing VoIP software for a long time. Our goal is to make friendly software easy to install for peoples without large skills.
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 access and have a friendly GUI for administration to bill Calls Cybercafe and internet access.
The best news 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 has a special GUI for hotel with powerful wakeup system and many more.
All our systems are as well available to install on Linux server
Call Accounting Mate by callaccounting.ws
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 callaccounting.ws 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
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 the telephone network and control of expense in a company or any other organization.
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 upon.
- 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 the 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.
MBILLING – Advanced VoIP billing system
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
- Customized softphones development
- Custom user dialplan
- Custom rates
- Multi-Language
- 4 different web interfaces
- Payments methods
- Load balancer
- Much more…
MOR – advanced billing and routing solution for Asterisk
- More info: MOR
- User-friendly/presentable billing. Huge amount of functions. LiveCD available.
Omniware Billing System
OpenRate License: Proprietary
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
- Free PayPal – IPN and PayPal – IPN Subscription Starter Kit Software
- These applications, while not originally written for VoIP back in 2000-2001, can provide excellent insight into using PayPal for small to medium size VoIP businesses.
- Sorry, we can not offer support for free applications.
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.
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.
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 based 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 us 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 an IP Device similar to Vonage, and got an award
on the service from Internet Telephony Magazine and in the Internet World 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 living
you can check them out on www.phoneopia.com www.superphoneunlimited.com and ip-pabx.com
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!
Call4Smile
See also
- Algorithm to parse country code out a phone number
- Asterisk administration
- Asterisk CDR csv conversion mysql
- Asterisk CDR csv handling
- Asterisk CDR csv mysql import
- Asterisk Prepaid Applications
- CDR mediation
- Call Accounting Software
- Open Source Billing Systems
- VOIP Billing
- Asterisk: config files | channels | variables | FAQ | CLI | introduction | tips & tricks