Creating Free CDR Reports for Asterisk

icon-bar-chart-o How to Create Free CDR Reports for Asterisk

For a long time, we suffered with buggy third-party visualizers and statistic engines specifically made for Asterisk’s call detail records.  Then one day we decided to build our own.

This post is intended to help anyone who has been in the same situation.

 

 

We used Asterisk’s built-in cdr_mysql and had it write call records to a Cloud SQL instance on Google Cloud Platform (GCP).  You don’t have to do this, but we found it to be the easiest option since we’ll be using Google Data Studio to generate our reports, tables, charts, and graphs.

If you prefer, you could also use something like Metabase.  And Data Studio will work with PostgreSQL or an uploaded CSV file if you don’t like MySQL.

We won’t go into detail about connecting Asterisk’s CDR to an SQL database.  There are plenty of tutorials out there for that.  Just make sure you have a functioning database before you proceed.

We also won’t show you how to build every report.  We’ll do one to get started and you can play with the tools to build others.  It’s all pretty simple, though we did have to tell Data Studio how to interpret some data, as well as create variables that Asterisk doesn’t create on its own.

 

PART I — GETTING STARTED

First thing we need to do is go to Google Data Studio and start a new blank report.

 

 

To proceed, you’ll have to agree to Google’s terms and opt out of some marketing emails.

After that, you’ll see a mostly blank screen.

Click on “CREATE NEW DATA SOURCE” at the bottom right.

 

 

The next screen will have a grid of different data selectors.

If your CDR is hosted on Cloud SQL, choose “Google Cloud Storage”.

Otherwise, you’ll probably be choosing MySQL or PostgreSQL.

 

 

Google will make you authorize access to data in Google Drive, just in case you choose to use that.

For the next step we’re going to pretend you chose a generic MySQL database hosted somewhere.

 

 

Enter all the credentials of your database and click the “AUTHENTICATE” button.

Assuming it connects and you agree to any popups Google throws at you, you should come to a screen like the one below.

Congratulations!

But we need to take a little detour before we build a report.

 

PART II — DATA FIELDS & FUNCTIONS

 

 

Before we make a report, we need to go back and look at our data fields.

Go back to the navigation home and click on “Data Sources”.

 

 

You should only have the one data source, so click that.

That will bring you to a screen like the one below.

 

 

Don’t worry that we have functions you don’t (the fx icons).  We’ll get to those in a second.

First, make sure you change the Type for “duration” and “calldate”.

As you’ll see above, they need to be changed to “Duration (sec.)” and “Date Hour (YYYYMMDDHH)” respectively.

Once that’s done, click on “Add A Field” in the top right.

 

 

We’re going to name this “Date” and the Formula will be: TODATE(calldate, DEFAULT_DASH, %Y%m%d)

Its Type will be “Date (YYYYMMDD)”.

Got all that?  Good!  Let’s go build a dang report!

 

PART III — BUILDING A REPORT

Finally!

Let’s go back to your Untitled Report, or start a new blank report.  Whatever gets you to this screen again:

 

 

We’re going to make a simple chart that shows our cumulative call duration per day for all calls.  We will also add a date control, but no other filters.  You can add an accountcode filter later if you want to examine duration per day per customer.

Let’s add the date control first.  Click on the “Date Range” icon in the toolbar.

 

 

I like to move the date control to the top right, so that’s where you’ll see mine.  Feel free to move/resize it however you like.

With the new date control selected, click the “Auto Date Range” drop-down.  It should be on the right side of the screen.

 

 

When the calendar appears, click the new “Auto Date Range” drop-down at the top right.

Again, feel free to select whatever default date range you want.  For this tutorial, we’ll select “Last 7 days” and check the “Include today” checkbox.  This means that when we open this unnamed report, it will only show data from the last week, including the current day, until we change the date range in our date control box.

I wrote this post on Dec. 14, 2018.  So my date range shows today and the six days before it.

 

 

Time to add our chart.  Click on “Add a chart” in the toolbar, then click the first “Time series” chart.

 

 

Again, I have resized and moved my chart.  Feel free to position and size yours however you want.

As you’ll see above, my chart defaulted to the right dates, but it is showing some strange cost metric that I don’t care about right now.  Let’s fix that.

 

 

Ignore my Data Source.  I’m using Cloud SQL, so it’s probably different from yours.  Make sure your Date Range Dimension and Time Dimension both have the date field we created earlier.

The Metric needs to be changed if it is not on “duration”.  Click the Metric field and change it to “duration”.

 

 

Finally, let’s check the Type again for our Dimensions and for our Metric.  The little icon to the left of the fields will let you see what those are.

 

 

Click the icon next to the field underneath the Date Range Dimension, the Time Dimension, and the Metric.  It will pop up a dialogue like the following:

 

 

Make sure the Types are the following:

For the fields under “Date Range Dimension” and “Time Dimension”, both need to be “Date (YYYYMMDD)”.

The “duration” field under “Metric” needs to be “Duration (sec.)”.

If you’ve done all that, you should have something like this:

 

 

(Note: I’ve secretly filtered my chart so it’s not showing our entire call duration.  Your daily call durations are hopefully much larger!)

Great!  We have a working chart!  Does it look a little boring, though?  Again, we won’t go into this much here, but you can style everything to your liking by selecting an object and clicking the “STYLE” tab on the right side.

 

 

After some easy styling changes, my chart now looks like the one below.  Don’t worry if you didn’t change your styling.  It doesn’t matter what it looks like.

 

 

Much better!  We can see data points, the x-axis is labeled, and the objects stand out from the background.

At this point, we should rename our report so it’s easy to find later.  Click on “Untitled Report” in the top left and enter a new name for your chart.  I chose “Tutorial Chart” for mine.

Once you’ve renamed your chart, click the “VIEW” button in the top right.

 

 

PART IV — VIEWING REPORTS

 

 

The “View” mode is for seeing and interacting with the charts once you’ve built them.  Notice that you can hover over data points, change the date range, and that the whole thing is now an interactive call detail report.  Pretty cool!

Really quickly, let’s look at this refresh button in the top right.

 

 

The “Refresh data” button will update your chart.  Our charts can sometimes take 10+ seconds to refresh since our SQL instance isn’t very powerful.  Your charts will automatically refresh if you’ve been away from them for a while (we’re not sure how many minutes).  If you’re looking for a call that you know just happened, you’ll be clicking that refresh button.

There is also a Chrome extension that auto refreshes for you, but we haven’t used it.  One day, we’ll have a big screen on the wall with real-time calling charts, but today isn’t that day.

And that’s about it!  Feel free to stop reading here.  The rest will just be our final thoughts and an example of what we’ve built.

 

PART V — FINAL THOUGHTS

We wanted to show you a report we built after we’d been using Data Studio for a few weeks.

 

 

(Note: again, we have filtered our data so it only shows a slice of our calling — we also edited out the Account Code and Call Cost entries.)

Notice that we can see all our calls, calling charts, total call minutes, and we even calculated a per-second cost to give us a rough idea of how much the call minutes costs us.  And the best part is we can filter all this data by any date range or account code we want!  We can see details on every accountcode in our system!

Hopefully that gives you an idea of the power of Data Studio.  It’s definitely not perfect, but it’s way better than our previous CDR Reporting software.

Good luck building your own reports!  And if you happen to live in Indiana, take a moment to check out our business phone service!

Indy Business: How Does e911 Work?

icon-ambulance Indy Business: How Does e911 Work?

Have you ever wondered how 911 calling actually works?  With old analog telephone service provided by the phone companies, the call would route through local stations that could transfer it to local emergency services.  But what about for Indianapolis VoIP phone service like we provide?  How does it get where it needs to go?

 

Area codes mean nothing.

Before voice-over IP and cell phones, area codes mattered.  But now mobile phones, home phones, and business phones can use numbers from any area code for the same cost as their local area code.  A Seattle area code can be routed to Indiana, and vice-versa.  So clearly a 911 call can’t route just based on the area code anymore.  Even if it could, how would you route a toll-free number?

The answer to that is actually pretty clever.

 

We know where you live.

When we provision a new number and allow it to send calls, we can also enable something called e911.  This is a service that provides extra information with the caller ID.  Let’s use our number for example and say it’s provisioned to the Soldiers and Sailors Monument.

Here’s what happens:

911 is called from a phone; the caller ID is set to 317-644-0075; and we have in our system that when that number calls 911, the location tied to it is 1 Monument Cir, Indianapolis, IN 46204.  So before the emergency dispatcher can even answer the call, they know that the call is probably coming from that address.  If the phone dies or the caller can’t give them much information, they at least know where to start looking.

Of course, the dispatcher would still ask for the caller’s current location because they know that what it says in the system may not be where the phone is located.  And that’s pretty much it.  We solve the problem of mobility by sending a little extra data along with the call.

 

Hopefully this post has clarified some of the mystery around current e911 calling.  Feel free to contact us about our voip phone service, or give us a call if you have any questions.  Thanks, and have a great day!

Indy Business: Best Phone System 2018

icon-building Indy Business: Best Business Phone System 2018

Choosing between business phone systems can be more than confusing if you don’t know exactly what you’re looking for.  Do you want a traditional system or a voice-over IP (VoIP) system?  How many lines do the systems support?  How do they hook up to your phone service provider?

Today, we’ll try to answer these questions as best we can.

 

Go digital.

We will be recommending a system in a minute; but no matter what system you buy, it should be digital.  Digital systems are everywhere and their call quality is crystal clear compared to old analog systems.  While we’re at it, you might as well go with a voice-over IP system too.  Most systems (including our recommendation) work regardless of your phone service provider, so there’s nothing to fear when it comes to compatibility.

Digital VoIP phone systems also usually offer more lines for the money.  When a call is going over your network as opposed to using traditional phone wiring, the number of calls doesn’t matter nearly as much.  So voice-over IP is more efficient.

 

Our recommendation.

The system we like best is from Grandstream.  Specifically, a system made up of Grandstream GXP2130’s.  That system would offer up to 3 lines per phone, the phones themselves would be reliable and professional, setup wouldn’t be too complicated, and the quality you get for the price can’t be beat.  We’ve looked at the alternatives from Mitel, Polycom, Cisco, etc.  We still prefer the high-end line of Grandstream phones.

We’re also going to recommend using the system with a hosted VoIP provider like ourselves.  You could use it with an on-site Grandstream PBX, but that’s a piece of hardware you don’t really need and if your office goes offline, all your inbound call functions are offline too.

 

Still need help?

If you still have questions or aren’t sure if our recommendation would work in your location, feel free to contact us anytime.  After all, sometimes you just need to ask an expert!

Indy Business: Cheaper Home Phone?

icon-home Indy Business: Why is Home Phone Service Cheaper?

No matter who you buy phone service from, you’ll likely notice that home or residential service costs less than business phone service.  Oddly enough, the reasoning for the price difference has probably swung back around with the rise of voice-over IP (VoIP) phone service.  In this post, we’ll learn why that is!

It’s all in the minutes.

The biggest reason business phone service costs more than residential is because, on average, a home user is on the phone less.  Perhaps before VoIP service came about, it didn’t matter whether a phone line was in use for five minutes or five hours; but even when phone service is sold as unlimited, the provider is paying more every time the customer is on the phone.  To make up for the possibility of a business being on the phone constantly, the price has to be high enough to ensure no money is lost.

Also, the increased cost does not only come from connecting the call to the wider phone network.  There are unlimited channels for high-usage phone numbers, but VoIP also requires computing power and bandwidth.  Both of those increase when calls are in progress.

One line, multiple people.

Now you might be wondering why, for example, a single home phone line and a single business line do not cost the same.  One line is one line, right?  Couldn’t a home phone be used more than a business phone?

Of course it is possible for a home phone to be used more often than a business phone, but businesses typically have more people relying on that phone line.  A business with only one employee still has multiple customers.  Those customers will need to call or be called, and that means the phone at the business is probably used more.

The exception.

Not every phone service provider does this; but for large businesses or Indianapolis enterprises, the per-line cost could be cheaper than home phone service.  We offer huge discounts as the number of lines increase, which can massively decrease the price of phone service for businesses.

To find out just how affordable we can be, feel free to contact us or give us a call.  Thanks, and have a great day!

Indy Business: Hosted VoIP Perks

icon-cloud-upload Indy Business: Hosted VoIP Perks

Should you have your phone server on-site?  Or should it be hosted in the cloud?  It’s an important decision to make for any business, but there are some benefits to having your PBX hosted off-site.  Let’s take a look at some of the perks of hosting to help you decide.

The cloud’s ISP is better than yours.

With today’s cloud infrastructure, having a hosted VoIP PBX usually means 100% uptime.  Unlike your office building, the internet service going to a hosted phone server is more reliable, faster, and doesn’t have any data caps.  That means that when your local internet inevitably goes offline, your incoming calls are still hitting your phone server and your customers can still access you in a number of ways.

With a hosted PBX like our VoIP Indianapolis uses, your customers can:

  • Hear all prerecorded messages you’ve created.
  • Leave you a voicemail.
  • Be routed to another office or even a cell phone.

Most of that is not possible if your PBX is located on-site.  When your local internet is down, your PBX is down too.

No hardware changes.  No upgrades.

For hosted VoIP, you shouldn’t ever have to worry about hardware failure or updating outdated components.  Your PBX’s hard drive never gets errors.  Your power supply never overheats.  And your processor never gets too old.  After 5, 10, or 20 years, the phone server doesn’t need to be replaced, because it is regularly upgraded in the cloud without any loss of service to you and your business.

Also, power outages, lightning strikes, and power surges never take your phone server offline.  So that’s a plus!

Deciding between on-site and hosted.

It can be tough to choose between on-site and hosted VoIP.  Typically, we recommend a cloud hosted VoIP like ours; but not all businesses are a good fit for its benefits.  If you’d like help choosing between the two, please feel free to contact us or call us anytime.  Thanks, and have a great day!