5.3. Administrative Applications
In addition to call-handling applications, we need applications for performing housekeeping. If nothing else, the traditional telephony providers understood accounting and billing!
5.3.1. Call Accounting
The all-important billing system is a required element of a service provider's softPBX. But there's more to call accounting than merely charging customers for the amount of service they use or the number of calls they place. Call accounting includes gauging to whom, when, and to where calls were placed so that utilization of the PBX can be fairly accounted for within the enterprise. Call accounting allows system managers to enforce voluntary system policies, too: abuse of telephone privileges can be documented and so on.
5.3.2. Project 5.1. Analyze Call Detail Records and Call Accounting
22.214.171.124 What you need for this project:
Most commercial softPBX systems provide a detailed logging mechanism for keeping track of when and to whom calls were made and received. Asterisk provides this, too. In /var/log/asterisk/cdr-csv/Master.csv , a flat text log of all call activity is retained. It's a snap to import this into Excel or your favorite spreadsheet for analysis. You can download the file using FTP from your server, or you can run the following command to email it to you. Keep in mind, large logfiles may not work well with this trick:
# more /var/log/asterisk/cdr-csv/Master.csv mail firstname.lastname@example.org
Of course, replace email@example.com with your email address. If your Linux server has sendmail or a similar SMTP agent running (most do), you'll receive the log in your email. You can then copy and paste it into Excel, as in Figure 5-1. Place the cursor on column A, row 1 before pasting.
Figure 5-1. A portion of the Asterisk ASCII CDR logfile, copied and pasted into the Macintosh version of Excel; the Windows version will work just as well to handle these logfiles
Once you paste the text or open the file, select column A by clicking the A column heading. Then use Excel's Text to Columns function, on its Data menu. This launches a wizard that helps you organize the text file into columns . You'll see a preview of the text you pasted in the bottom portion of the window that appears. Leave the Delimited radio button selected and then click Next.
Select Comma as a delimiting character, make sure there are no other delimiters selected (as in Figure 5-2), and click Finish. Now, you're ready to label the column headings according to their purposes. Insert a blank row at the top of the spreadsheet, and you can label them as follows .
Figure 5-2. The second step of the Text to Columns Wizard breaks up the CDR log text into meaningful cells of data
126.96.36.199 Asterisk CDR default fields
The underscored field names record very Asterisk-proprietary information. For example, the Application field may not have a meaningful correlation on another softPBX because not all softPBXs refer to telephony functions as applications. More detailed descriptions of these Asterisk terminologies can be found in Chapter 17.
The idea here is that once the CDR is imported into Excelor another data analysis toolyou can interpret it in interesting ways. Suppose you want to figure out which customer places the most calls to your technical support department. You can count occurrences of that customer's caller ID in the CDR. Or if your teenage daughter is receiving a dozen calls a day, you can bill her accurately for them!
With CDR records in Excel, Crystal Reports, or even a homegrown Perl program, a savvy telephony administrator can:
Most PBX environments support a central, "big picture" application called an attendant console . This application can monitor the status of calls in progress throughout the PBX or within a certain scope of users, tell who's on the phone and who's not, and sometimes even keep track of who's in the office and who's out of the office. The console application may or may not have a phone directly connected. In some systems, the console itself is an endpoint with a large, specialized display built in. In others, it's a PC application or terminal connected to a serial interface on the PBX.
In Asterisk, there isn't a dedicated console application, but some people have used Astman as a substitute for a homegrown console application. Cisco, Avaya, and Nortel provide PC-based or web-based console applications for their softPBX systems.
5.3.4. In-Out, DND, and Call Forward
Many traditional PBX systems offer endpoints with an in-out functionthat is, the endpoint can be used to alert the console when an office occupant is in or out of their office. That way, the human attendant, who uses the console, will better know how to handle that user 's calls.
Do not disturb, or DND, is another PBX endpoint function that allows each user to silence the ringer on her phone, placing it in a state of silence so incoming calls don't disrupt the user's activities.
Call forward gives PBX endpoints the ability to temporarily relay all incoming calls to another endpoint, either on the same system or, if the PBX supports it, on the PSTN.
5.3.5. Call Logs and Missed-Call Indications
Some PBX endpoints and caller ID-equipped analog phones can store a log of calls placed, received, and missed. This feature tends to be something built into the endpoint, though the same information is almost always stored in the PBX's call accounting system.