Information

WinTariff tips and tricks

Author

Oleg Zemskov

Contacts

zeosoft@postman.ru phonewarez@gmail.com

Web

www.phonewarez.net


Connect to PBX (part 1)

The problem: the program has been installed and started, but call list does not increase!

WinTariff contains two basic modules:
  • PbxCollect.exe - this module receives data (duration, number, etc) from PBX and writes them into the Calls.dbf file
  • Tariff32.exe - processing module - here you can view data on calls, to print a report, etc.
Two variants are possible:
  1. no data do not come at all to the PbxCollect.exe module
  2. data come from PBX, but in the Tariff32.exe module the calls list, however, does not grow
You can know what's going down, if you will click on the menu item 'Enable view of raw data' (it will be marked with a "tick") of the PbxCollect.exe module - then data coming from PBX will be displayed in the main window of this module. The data line is given by PBX after finishing next call and should look "neatly" - any "odd" signs should not exsist. Here is an example:
15/ 7/09 2:49PM 211 01 05554904444 0:02'22" ....
If there are no lines at all, then it is possible:
  • PBX requires the preliminary programming. Some (as a rule, it is a high-end models for hundreds subscribers) PBX by default does not give out data about calls - for example, it is PBX Panasonic 336/500/KX-TDA/KX-TDE/NCP. To start a work, please, see PBX settings - search the 'SMDR' item or similar (but, fortunately, major part of PBX start to give data once a cable had been connected.)
  • incorrect cable RS232 for connecting to the PBX. In 99.9% the null modem cable is used (exception - some PBX LG, where the usual, 'straight' modem cable is required.) Some models can transmit data through TCP/IP network (no one model does not use the USB for call logging), but it is recommended to start with series connection by RS232
  • in the program settings the parameters of RS232 interface are not set correctly (speed, parity, etc)- see the item 'Main setup' in the PbxCollect.exe module menu. These parameters must match exactly with similar parameters in the PBX settings itself. If you do not know them, it is possible to try to guess - start with 9600,8,1,None (or 9600,8,1,Mark for the Panasonic PBX), these values is used most commonly.
  • the COM-port (COM1/COM2) is specified incorrectly, to which the PBX is connected or the computer COM-port jack is confused with printer port (!)

That's all, this are most likely causes - if data are absent the case, most probably, in that. Other causes occur more rarely - for example, PBX could be programmed for giving out only long distance ('Toll-restricted') calls, and they occur once a day.


Connect to PBX (part 2)

Data formats matching

Hurrah - PBX gives out reliable data (they are visible in the record module), but call list in the main module is empty as before! What is the problem?

Most probably, the problem is in the incorrectly chosen PBX type in Wintariff's settings. Please, take a note that some PBX models allow to choose the structure of the outputted information (for example, Avaya Definity) or the possibility of selection from several predetermined formats is present (for example, Panasonic KX-TDE). Often the case in the date format - day/month/year (D/M/Y) or month/day/year (M/D/Y). For example, if PBX gives out the date '1/15/09' (in a format M/D/Y it is corresponds to January 15, 2009), an attempt to interpret the received data according to the D/M/Y format will result in error (15th month!) and record will be refused. For similar cases WinTariff has a selection possibility from several PBX "sub-types", for example:

  • 'PANASONIC KX-TDA/TDE (format 'A',date DMY,12h)'
  • 'PANASONIC KX-TDA/TDE (format 'A',date MDY,12h)'

The similar problem arises with PBX with flexible format setting - for example, already mentioned Avaya Definity. For such PBX in the folder WinTariff32\SampleLogs the samples of 'right' logs with instructions on PBX setting are given.


Connect to PBX (part 3)

Connection to PBX - a cable and jacks

At first about connection methods:
  • serial port RS232 – in this way 99% of PBX are connected.
  • network TCP/IP - such possibility exists, as a rule, in high-end models only.
  • USB - none of modern PBX can not output the call logging data by USB (although some models have such jack - it can be only used for PBX control. Example - Panasonic KX-TDA/KX-TDE)

RS232: as a rule, the 'null modem cable' is required. An exception - some LG models, the 'straight' modem cable is used there. There are several soldered connections of 'null modem', but you should not use simplified schemes (with jumpers between contacts of one jack) - the call loss is possible because of PBX does not receive a signal of readiness from a computer (whether it is on or not?) and sends data into emptiness. The recommended schemes are:

Cable 9×9 | Cable 25×9 (left column for 25-pins jack) | Cable 25×25
2 ↔ 3 3 ↔ 2 4 ↔ 6 5 ↔ 5 6 ↔ 4 7 ↔ 8 8 ↔ 7 | 2 ↔ 2 3 ↔ 3 4 ↔ 8 5 ↔ 7 6 ↔ 4 7 ↔ 5 20 ↔ 6 | 2 ↔ 3 3 ↔ 2 4 ↔ 5 5 ↔ 4 6 ↔ 20 20 ↔ 6 7 ↔ 7

If it is required to make long (10-20 meters) cable, it is possible to use such scheme (4 core telephone cable is suited):

Cable 25×25 | Cable 9×25
(1,7) ↔ (1,7) 2 ↔ 3 3 ↔ 2 20 ↔ (5,6) | 5 ↔ (1,7) 2 ↔ 2 3 ↔ 3 4 ↔ (5,6)

Take a note that a cable is not symmetrical! (unlike the schemes given above). The left column with the contact numbers - for connection to the computer, right - to PBX. The couple of numbers in brackets (for example,(1,7)) means a jumper between corresponding jack contacts.

The only difference between a'null modem' cable and more widespread 'modem' cable is that in a modem cable similar jack pins are connected directly (i.e. 2-2, 3-3), and in the'null modem' wires in few pairs of wires are 'crossed'(2-3, 3-2, ..). Therefore it is convenient to use a modem cable as a work piece and re-solder wires in 3 pairs (for 9-pin jack it is pins 2+3, 4+6, 7+8).

For 9x9 (female-female) cable (suits for Panasonic KX-TA, KX-TES/TEM, KX-TDA/TDE) search Google for "null modem cable purchase".

Warning! When connecting to the computer do not confuse COM-ports jacks (9 or 25-pin male) and LPT-port (port for printer connection):


How to make a null-modem cable

For this purpose the blank in the form of a modem cable with sockets 25 'male' type and 9 (or 25) 'female' type is required.

Attention! Cables with 'cast' indecomposable cases-sockets (see photo below) are very frequent, but such cable is not suited for alteration!

null-modem convertor 25x9
Open the case of a 25-pin 'male' socket: null-modem convertor 25x9
Exchange wires on contacts 2 and 3 (numbers of contacts are stamped on plastic): null-modem convertor 25x9
Further repeat this operation for contacts pairs 4 and 5, 6 and 20.


Connect to PBX (part 4)

Connection to PBX - TCP/IP

Network connection is not too widespread function - it is present only in high-end models, even then not always. For example, PBX Panasonic KX-TDA has Ethernet port, but it can not give out the call logging information through network (but the port can be used for programming of PBX). The call logging through network appeared only in the next model - KX-TDE.

Usually (90% of cases) the following scheme is used - PBX serves as a server and waits for connection of a program-client. Exceptions - PBX Avaya and Ericsson, about them just below. To set up Wintariff you should know PBX network adress (you can ask network administrator) and port number opened on PBX (it should be seen in PBX settings). Although in the majority of cases for data transfer the telnet protocol is used, but standard telnet port (23), probably, will not fit - for example, in the same Panasonic KX-TDE on default a port 35300 is set.
To check a communication it is possible to connect to PBX using a standard program telnet (is a part of Windows: command line 'telnet' or use HyperTerminal in a telnet mode) The well formatted data lines should appear on a display.

You can set up WinTariff directly in the PbxCollect.exe module, in the 'Main setup' window:

  • Communication channel=TCP/IP
  • Regime='Pbx=server, PbxCollect=client'
  • IP address and port correspond to PBX settings
  • login and password - if required (for Panasonic KX-TDE is required)

Avaya and Ericsson - a picture is turned 180 degrees: PbxCollect.exe waits for PBX connection. Accordingly, in PbxCollect.exe settings you should specify IP-port only, which will be listened by a module while waiting for connecting. Naturally, it is not possible to check a performance for such scheme with the common telnet.

The last note - NEC NEAX, LG CS1000, DeTeWe OpenCom use proprietary protocols. Therefore, although PBX serves as a server, telnet will not help with setting-up, it remains to trust to correctness of settings.


Connect to PBX (part 5)

Connection to PBX through Spool folder

There are number of telephone PBX for which it is impossible to receive the call log information directly. Generally it is caused by closed character of an exchange protocol with PBX - for example, it is PBX MTA M-200 or Iskra SI2000. For such PBX generally a proprietary program is present, which receives data from PBX and writes them into a file. The same problem arises with some network routers - they send logs by FTP.
To work with such PBXs WinTariff supports a special type of the communication channel (along with RS232 and TCP/IP) - 'Spool folder'.

In this case a work scheme looks something like this:

  1. PBX (proprietary utility) stores logs in some folder on the hard disk of the computer.
  2. PbxCollect.exe module from time to time scans a given folder.
  3. If it is possible to find any files in it, the module tries to import data from them. After that the file is deleted.

Warning! The file names should correspond to a mask *.* (i.e. they should have an extension (any))!

To set up a 'Spool folder' mode it is necessary to specify a path to a folder with logs and an interval between references to a folder (in minutes).


Connect to PBX (part 6)

Connection to PBX - Asterisk and Avaya Definity

The Asterisk and Avaya Definity feature is a flexibly adjustable format of call logging data. WinTariff can be adjusted according to existing PBX format. To do this you should edit PbxCollect.ini file, section [Common]:

* Asterisk *
You should add a line of a type:

AsteriskMapping="clid","src","dst","dcontext","channel","dstchannel","lastapp","lastdata","start","answer","end","duration","billsec","disposition","amaflags","accountcode","uniqueid","userfield"

The element names repeat name of relative elements of PBX settings. All listed elements should be present in a line, and their order is important.

* Avaya Definity (custom) *
You should add a line of a type:

DefinityMapping="date-dmy=1;time=8;duration-hmmss=13;cond-code=19;code-used=20,4;in-trk-code=90,4;dialed-num=28,18;calling-num=46,10;in-crt-id=81,3;out-crt-id=84,3;acct-code=56,15;auth-code=71,7"

Individual element structure: ‘name=shift[,width]’.
The shift from a line start is counted from 1, the field width can be absent for some elements (see example above). All listed elements should be present in a line, however, in some cases there is possibility to choose from several variants:

  • Call date: either ‘date-dmy’, or ‘date-mdy’
  • Call duration: either ‘duration-hmmss’, or ‘duration-hmmd’ (hmmd - format hours-ìinutes-deciles _of_minute)
  • Account or Authorization code: you should use either ‘acct-code’, or ‘auth-code’. Only one value will be written into ‘Account code’ column.


Connect to PBX (part 8)

Avaya Communication Manager

For 'Avaya Communication Manager' format, similarly to the 'Avaya Definity (custom)' format, the structure of the receivable data line can be adjusted for certain situation. To do this you should edit PbxCollect.ini file, section [Common]:

AvayaComMngMapping="date-dmy=1;time=8;duration-hmmss=13;cond-code=19;code-used=20,4;in-trk-code=90,4;dialed-num=28,18;calling-num=46,10;in-crt-id=81,3;out-crt-id=84,3;acct-code=56,15;auth-code=71,7"

Individual element structure: 'name=shift[,width]'.
The shift from a line start is counted from 1, the field width can be absent for some elements (see example above). All listed elements should be present in a line, however, in some cases there is a possibility to choose from several variants:

  • Call date: either 'date-dmy', or 'date-mdy'
  • Call duration: either 'duration-hmmss', or 'duration-hmmd' (hmmd - format hours-minutes-deciles _of_minutes)
  • Account or Authorization code: you should use either 'acct-code', or 'auth-code'. Only one value will be written into 'Account code' column.


Avaya IP office

Until the release 6+ the scheme of interaction with Avaya IP office was as follows:

to retrieve data from the station special program is used - IP Office SMDR. It writes data to the files of CSV format (comma-separated). WinTariff periodically checks the contents of the folder with a CSV-files and import data from them (the communication chanel should be set to 'Spool folder' in the settings of the module PbxCollect.exe).

Since release 6+ task became simpler - there is no need to use intermediate CSV files. Avaya IP office output data via Ethernet directly to the billing softwere. Settings for this case:

  • model of the stations: Avaya IP office
  • commuication chanel: TCP/IP network
  • IP port number must equal the port of IPO
  • (!) regime: PBX-client, PbxCollect.exe-server (Avaya, Ericsson..)


FAQ 11

Various PBXs provide a possibility to be flexible while setting up the format for the SMDR data. How does WinTariff deal with the variable format?

Certain types of PBXs (fortunately, they are few) do not have one strictly determined data format; they allow flexibility while setting up the structure of the displayed data. In particular, this is in reference to some Siemens PBXs. SMDR data patterns (for each of the PBXs with flexible format) are specified in the WinTariff32/SampleLogs folder. When setting up the PBX you will need to get an exact coincidence of the PBX and pattern data - the relevant data need be inserted exactly to the same column/line position as it has been specified for the particular PBX within Wintariff.


Connect to PBX (part 7)

Linux and FreeBSD

The special chapter is dedicated to using of WinTariff under Linux/FreeBSD in a Readme.pdf file - see, the basic moments are described there. There are only some notes here.

At first, it is possible to install WinTariff under Linux - it is sufficient to start up an installer under Wine. You should enter into a command line:

wine Install_WinTariff.exe

and install the program as ordinary Windows application.

Upon completing all should work (except for scenarios: why - i don't know, even an installation of downloaded from Microsoft site the VB scripting shell package does not help), but selections + report generation + printing on a computer under Linux work fine.

More often a situation occurs when Linux-computer is only used as a server. In this case it is reasonable to use special versions of a record module - pbxcollect_linux and pbxcollect_freebsd (they can be found in the 'WinTariff32\Extras\NT, Linux, FreeBSD' folder). The basic idea is that these two modules read settings from the same PbxCollect.ini file as the Windows-version PbxCollect.exe - therefore the main setting can be easier carried out under Windows. (there is a graphic interface there), and then just copy ready file onto computer with Linux/FreeBSD (settings file should be located in the same folder as a executable module). However it is not prohibited to edit file manually, so much more, that it not be avoided. What should be changed:

it is mandatory to specify a path to a folder where a file with call will be located:

[Common]
CallsFileFolder=/var/wintariff_calls

Further all parameters concerns to the section [PBX 1]:

  • ChanelId - the type of the channel of communication with PBX. 0 corresponds RS232, 3 - TCP/IP
  • PbxId - determines PBX model. The PBX name and index concordance can be found in the PbxModels.txt file in the WinTariff's folder.
  • LinuxSerialDevice - the device of the serial RS232 port for communication with PBX. (here you should to specify something like '/dev/cuad1' - exact value depends on a type and operating system version and computer configuration)
  • SpeedId - speed for RS232: 0 = 1200, … , 3 = 9600
  • SpeedId - parity for RS232: 0 = None, … , 3 = Mark
  • StopBitsId - stop bits number: 0 = 1 bit, 1 = 2 bits
  • WordLenId - word length for RS232: 0 = 7 bits, 1 = 8 bits
  • IPaddress - IP address at connecting through the network (in N.N.N.N format)
  • IPport - IP port at connecting through network
  • IP_as_server - for PBX Avaya Definity and Ericsson it should be 1 here, for others - 0

Warning! When connecting through RS232 it is strongly recommended to reprogram a parity check in PBX to None! Linux 'dislikes' used in PBXs Panasonic a Mark value.

That's all - you can start a record module. If setting are made correctly, the data recording into a CALLS.DBF file will be started (it will be created in a folder specified in CallsFileFolder)

Keys which can be used together with pbxcollect_linux:
–help - dispays help
–daemon - start up of a module in a 'demon' mode
–viewraw - a module will display data lines received from PBX
–importlog SRC_FILE_NAME - used for data import for a given file. After import execution the module finishes a work.


LG_LDK and TCP/IP

LG LDK and TCP/IP (periodic lags)

When PBX LG LDK 100/300 connecting via TCP/IP call recording sometimes stops. Moreover, it is not possible to connect the PBX using telnet, or proprietary management software. But performance of the PBX is not violated.

Solution:

  • look for the file PbxCollect.ini
  • and change value of IPreconnect parameter in the section [PBX 1] to 0:

    IPreconnect=0

Explanation: PbxCollect.exe module in case of prolonged absence of calls disconnected and reconnected to the PBX. This is done to ensure that the possible outage would not lead to a significant loss of calls. However, LG LDK 'dislikes' numerous connection and it is better to disable this mode.


Service start problem

The problems with start of NT service

The problem:

... i had configured and run the PbxCollect.exe module - everything is Ok, the calls are recorded. I try to run PbxCollect_NTservice.exe service (I had been doing all as is written in documentation; I had switched off the PbxCollect.exe) - calls are not recorded. What is the problem?

The point is that all record WinTariff modules (including PbxCollect_NTservice.exe service) at start search PbxCollect.ini file and read the settings from it (PBX type, communication parameters, etc). PbxCollect.ini file should be located in the same folder as the module itself - otherwise data collect module will not find it. And that's exactly what is happening in this case - initially a PbxCollect_NTservice.exe file is (along with modules for Linux/FreeBSD) in the 'WinTariff32\Extras\NT, Linux, FreeBSD\' folder, where no settings file is present!

Solution - first copy PbxCollect_NTservice.exe file into the folder WinTariff32\ (the actual settings file created for PbxCollect.exe already exits there) and install a service now from this folder. By the way in the mentioned folder a readme.txt file exists, which offers such solution.


Panasonic KXTDA - no_outgoing calls

Panasonic KX-TDA: no outgoing calls

The problem: Panasonic KX-TDA PBX registered only incoming calls, there is no one outgoing call.
  • Please note that you can enable/disable output of SMDR data for each COS (Class of Service) - check the settings of COS, see 'KX-TDA maintenance console'
  • check whether the option is not enabled ‘Reverse circuit detection’ in the settings of CO-lines (see ‘KX-TDA maintenance console’). If this option is enabled, then KX-TDA can determine the exact duration of the call, but given that the CO-line also provide this service (when the call is finished polarity reversal occurs at CO-line). If in fact this function is not avaialble, the polarity never is revered and in terms of KX-TDA outgoing calls never end and billing are not issued.

With following models: KX-TDA/KX-TDE/NCP be sure to first turn on output of the SMDR information in the settings of the PBX - it is disabled by default! (see 'Panasonic Maintenance Console', then 'SMDR' window)


Panasonic KX-TDA and USB

Starting from version 2.9.8, WinTariff can receive SMDR data from the KX-TDA via USB (and through TCP/IP network via the CTI card)


NEC (NEAX, SV) over IP network

NEC stations allow to receive data through TCP/IP network.

Problem: PbxCollect.exe is connected to the station, but if you turn on the view of input data ('View raw data'), only repetitive lines 3000030033 are visible. In the main list no calls appear. What's this?

Data exchange protocol implemented by NEC uses parity checking for data integrity. Line 3000030033 indicates that an error has occurred - the station received a request from call accounting software but parity byte is wrong. The solution - change the method of calculating the control byte (even <-> odd) in the settings of PBX. As a result, list of calls should apper in main Tariff32.exe module.

Periodically code 300003001O may appear - it is Ok, the station reports that there is no call to send.


FAQ 04

WinTariff stops recording the calls intermittently.

If the recording is usually decreased at night or on weekend (i.e. during the periods of low activity of the calls), the reason can be as follows:

some computer motherboards are a taking away power supply from the COM-port (in order to save power), if during the long period a program does not address the port. It shall be necessary to switch off all the ‘green’ functions (power management features) both, at the level of the operation system and within the computer BIOS.


FAQ 05

Whether the temporary switch-off of the WinTariff recording module is possible? If so, will result in the call losses?

The majority of modern PBXs have an internal buffer where data concerning the calls are accumulated in case of the switch-off of call logging program. Calls from the buffer will be transferred to the program during its first launch. Normally, the buffer capacity is minimal – possibly about 100 calls, however, usually the 10-15 minutes interruptions will not cause the information losses.


Copy raw data to RS232

Copy data to another RS232 port of computer

The module PbxCollect.exe has ability to pass raw data of PBX to another serial port of PC.

The main purpose of this function is the integration with voice recording systems.


Calls of 10-15 hours

Calls of 10-15 hours were registered! How can it be?

Maybe it's the following:

some users tend to stop talking by a short putt on the lever of telephone. A short press on the lever is perceived by the PBX not as a hang up, but as a Flash signal. As result the conversation is not terminated but it is put on hold. Ie actually talk was not termianted, external CO line is not released. This problem, for example, occurs at some Panasonic models (KX-TD1232, KX-TDA/TDE/NCP). To solve the problem, you must coreect settings of your PBX - prohibit treat a short press on the lever as a Flash.

Fo example, for Panasonic KX-TDA/TDE/NCP:

  • run ‘Panasonic Maintenance console’
  • see the 'Wired extension' window, look for the parameter 'Flash mode when talking to the CO-line'. Set this parameter to 'Finish'


Licensing of WinTariff

WinTariff has no restrictions on the number or extensions, nor on the number of outer Trunk - the same version of the program can be used with PBX models of different scale.

Licensing: one license includes up to 2 PBX that are installed in the same building and belongs to the same company. Data from the two PBX will be stored in the single data file (call records from different PBX have special marks used to distinguish them). This was done in order to cope with a fairly common situation:

the company has increased in scale, available amount of phones was not enough for new employees. And then another PBX was bought (often a completely different type) and used to service the new staff. Just to not put another computer and do not duplicate call accounting system the ability to service two PBX was implemented in WinTariff.

If you have multiple PBX installed at different locations, you should buy more licenses - accordigly to the number of the PBX.


Edit form

How to edit report form

Below se and example of creation of the new report form - with calculation of additional data directly in the report. In the report we will count quantity of not answered calls (in fact, the quantity of calls with zero duration are counted).

The final report form can be downloaded here .

The file needs to be copied into the WinTariff32\Forms folder. Further, as usual, it is necessary to make selection and to choose the 'Main report (unanswered calls)' report form. Required value is displayed at the end of the report, after all Extension data blocks (why and how to fix - see below).

To calculate the quantity of not answered calls (actually - calls with zero duration) following expression is used:

SUM(IF(CallsFilteredTbl."IDuration"=0,1,0), MasterData1)

here: SUM(value_to_summarize, name_of_data_band) - built-in function to calculate sum. Following value is summarized for each record belonging to the selection of calls: IF(CallsFilteredTbl."IDuration"=0,1,0). The function IF(logical_value, value_if_true, value_if_false) in the given case returns 1 for calls with zero duration and 0 otherwise. CallsFilteredTbl."IDuration" is the field of the CallsFilteredTbl database - the database contains the calls that belongs to the selection, IDURATION - value of the call duration in seconds.

Hint - how to get the list of all available functions?
Click expression with a mouse in the report editor - the editor of expressions will be shown. Click the 'Insert a function' button on the toolbar and you will see the list of all available functions with short explanations.

Expression with SUM() function is placed on the 'Report footer' band - as a result the calculated value is displayed after all Extensions data blocks. Why? SUM() accumulates value along with movement of the generator of reports over list of selected calls, therefore at the beginning of the report, on the 'Report title' band the SUM() function will return zero. If there is a wish to see the calculated value closer by the beginning of the report:

  • remove the details for Extensions. But (!) it is necessary to leave 'Master data' band, so just assign zero height to it. Then ‘Report footer’ visually will follow the ‘Report title’ and the calculated value will be printed on the first page of the report.
  • or in an event of OnBeforePrint of 'Report footer' band assign calculated value to any variable, and display the value at 'Report title' band. The report generator makes two-pass, at the end of the first pass the calculated value will be saved in a variable, and on the second (the final) pass, the value will be shown in the report heading. In the example above the trick is not used not to shade an essence of calculations.


Adjustment of tariffs

Adjustement of prices

The basic WinTariff installation already contains complete enough database of codes of countries and cities, it is sufficient for control purposes. If it is necessary to receive exact equivalent of calculated prices with the communication statement data, you will need to adjust the tariffs.

To adjust prices:
  • open the corresponding tariff for long-distance calls
  • first you must go to the tab "Codes and prices"
  • further on the tab "Zones and prices" you must correct the value of price per minute for existing zones (or add a new zone).
    • (to see cities that belongs to the given zone you can find on the tab "Codes of towns or countries"; click on the column header "Zone" will order records by the zone number).

That's that! Now you can recalculate calls accordingly to the new prices:

  • to make a selection of all calls - see "Report->1st step - Selections", further you can make a selection "All calls"
  • then you can apply "Report->2nd step-Operations->Re-calculate prices"


FAQ 09

Our company uses the service of the commercial communication provider - long- distance calls through the insertion of a ‘pin-code’. How does WinTariff deal with this?

You will need to create a separate tariff for theses calls:

  1. Select the ‘Tariffs’ item in the menu
  2. Click the mouse at the active tariff scheme (marked out as a red letter A) - you will be transferred to the ‘Basic tariffs’ section
  3. Now, in order to create a new basic tariff, press the ‘New’ button. You will get to choose either to create an empty new tariff (with the purpose of further manual addition with codes of this tariff), or to copy data from one of the existing tariffs (long-distance or international).
  4. Last selection is more convenient, you will have need to modify tariff parameters
  5. Most important condition for the new tariff is to specify correct ‘access codes’. First digits of the dialed number which go before the area code (or country code) are called the access code. For the given tariff the access code will include pin-code, as well. For example, if you want to call Germany (code 49) and it is necessary to dial 5551234-7799-011-49-6664321, where:
    • 5551234 - local number of the telephone operator
    • 7799 - pin-code assigned to your company
    • 011 - access code for long-distance communication
    • 49 - Germany country code
    • 6664321 - number in Germany,
    In this case, the access code shall be as follows - ‘55512347799011’. If you use several pin-codes (for example, each employee have his personal code), it shall be necessary to specify all the relevant codes.
    In order to insert a code, first, initiate the tariff parameters' edit window (just click this option within the ‘Tariffs’ window, or press the 'Edit' button’) and go to the "Access codes ' page.
    If the access codes are correctly selected, Wintariff will determine correctly the direction of the given call - the name of the city where the call had been made will be displayed in the ‘Status' column. However, changes will affect only the recorded calls since the change. If it is necessary to recalculate the existing calls in the database, you have to carry out selection which will include these calls you wish recalculated and use the ‘Report->2nd Step-Operation->Re-calculate’ operation.


Edit sructure of Calls.dbf

Changing the width of the columns of the file with calls

File Calls.dbf, used to store data about calls, has some strict structure. For example, fields used to store extension (EXTENSION) and an outside line (CO) are of 6 characters in width. This is usually enough, but in some cases it is required to increase the width.
To change the width of the fields:
  1. close the data receiving module (PbxCollect.exe or PbxCollect_NTservice.exe) and main Tariff32.exe
  2. delete (better - move to the backup) Calls.dbf file. The path to the folder with Calls.dbf can be found in the program settings - see Tariff32.exe, window 'Settings-> Main Settings', then the tab 'Folders'
  3. look for the file PbxCollect.ini - depending on Windows and WinTariff versions it may be in the following folders:
    • Program files\WinTariff32
    • ProgramData\WinTariff32
    • Documents and Settings\All users\WinTariff32
  4. open it in any text editor and correct the parameter CallsDbfCorrections (remove the '*' sign in the beginning of the line!). For example, to increase the size of EXTENSION and CO fields up to 10 characters corresponding string should look like:

    CallsDbfCorrections=EXTENSION:10;CO:10

  5. save the file and restart PbxCollect.exe - it will create a new (empty) file with a modified structure.

Note 1. In some cases, the size of the fields is limited by the telephone exchange itself, not by WinTariff. For example, Panasonic KX-TDA/KX-TDE model limits dialed number by 25 digits (when format 'A' of SMDR string is selected), but WinTariff reserves for this parameter a field of 35 characters in width. In such a situation PBX should be configured to choose another format (if possible) - in the case of KX-TDA/KX-TDE formats 'B' and 'C' has wider fileds for dialed number.

Note 2. A little bit more difficult is to change width of the STATUS field (corresponds to column 'Status' of calls list; the default width of the field is 20 characters). For example, to increase the width to the 40 characters first you need to change the structure of the file Calls.dbf, as described above:

CallsDbfCorrections=STATUS:40

then edit Tariff32.ini file (contains settings for the main unit Tariff32.exe; the file can be found in the same folder as the PbxCollect.ini) to change the parameter StatusFieldWidth:

StatusFieldWidth=40

The necessity to change the STATUS field usually arises from a desire to increase the size of the column with the name of the city in the parameters of the tariff. For this purpose Codes.dbf file should be corrected (see \Prices folder; the field NAME). It is not recommended to do it yourself, it is better to write to the support of WinTariff'a, but here is a quick tutorial:
  • to change the structure of DBF-file you can use, for example, the program 'Dbf Desktop' from the Halcyon package.
  • after setting the size of the fields is required to rebuild the index file Codes.mdx You can use the same program 'Dbf Desktop', or simply run the 'Repair DBF files' from the WinTariff: on the first tab, check the path to the folder and click 'Pack & reindex'


Many PBX in the company network

Several PBX in the enterprise network

Problem: a few PBX are connected into a single network with a common numbering plan. But call to another subscriber of the network looks like an outgoing call with a short number (3-4 digits). As result, the status field contains label 'Local'. How to charge these calls accordingly to domestic tariffs?

1. Create a new long-distance tariff, call it 'inter-office'. Configure the tariff as follows:

  • length of the dialed number ranging from 3 to 3 digits
  • Access codes: no
  • city codes: add 10 pseudo-city codes '1' .. '9' (or less if the intra numbers start only with certain numbers, it is better to exclude the code '0' to avoid conflict with the long-distance calls). Name each code, for example, as 'inter-office'

Done - now 'Status' will be contain label 'inter-office' for these calls.

But that's not all - the problem is that these calls will be selected as part of 'long-distance' calls, ie if the selection parameters specify the type of call='Long-distance'. To adjust:

2. in the parameters of the tariff assign it to the 5th group (or another, that have not been used yet). If actual tariff for domestic calls exists then it also may assigned to this group. Then all inter-office calls can be selected as:

in the parameters of the selection, on the tab 'Time&Zone' specify 'Group = 5'


Hotel 1

Hotel, 'Check In/Out' variant

WinTariff has several functions intended to make easier use of a program for hotel clients service - all these functions are gathered in the 'Hotel' menu item. (and settings is in the 'Settigns->Archives and hotel').

The most simple function - 'Hotel->Check In/Out'. It allows to invoice a client for phone calls when discharging him from a hotel - in this window it is sufficient to enter the date and time of start/finishing of an accommodation, client full name and press 'Print'. The client's calls identification is carried out either by specified internal number,or by Account-code. What really will be applied depends on settings in the window 'Settings->Archives and hotel', parameter 'Client's calls are identified by...'.
Some other setting parameters also affects how this report looks:

  • number of copies to print
  • what calls should be included into the report (all/long-distance only)
  • are wrong calls and calls with zero price included into the report

Other parameters concerns to other variants of use Wintariff and will be considered in other sections.

To print a report the 'Hotel' blank is always used - it can be edited for bringing in line with a design of other hotel documents.


Hotel 2

Hotel, 'with registration' variant

The second scheme for hotel clients service - it is a 'with registration' scheme. For this mode the following 'Hotel' menu items are used: 'Check in', 'Check out', and 'Exhausted deposits'.

Difference between two schemes:

‘Check in/out’ | ‘With registration’
Data about client are entered when leaving a hotel | Data are entered at the registration in a hotel
Data about client are not saved in the WinTariff database’a | Data are saved in the Hotel.dbf file
Control of client's calls during accommodation is not supposed | Calls are controlled. For each registered client the total calls cost is calculated and compared with posted deposit. When deposit will be exhausted the list of debtors is displayed to the operator.

Please, take a note, that when deposit will be exhausted calls will not be blocked - WinTariff can not switch PBX settings, in this case, only a warning is displayed. However, there are developments of third-party companies - search Google for Blitz TAPI. With this program for some PBX Panasonic (KX-TD, KX-TDA, KX-TDE) Wintariff is able not only to warn but also can disconnect debtors from telephone communication.

The 'Check out' window can also be used to control an accounts condition of all registered clients - 'Sum' column contains the current value of the total calls cost. Here you can add to a client's deposit additional amount - see 'Deposit +' button.

To view/print a debtors list the 'Exhausted deposit' window is intended.

Settings - to start up a deposits checking you should enable a 'Periodical check overrun of deposits' option in a 'Settings ->Archives and hotel' settings window. The second important parameter in this window - 'Printing of the bill means a client's departure'. If this option is enabled, the printing of the final bill leads to discharging of a client automatically. But if this option is disabled, two individual independent button are used - 'Print' and 'Check out'. In any case after discharging data about the client are not deleted from database, they can be viewed in a "Charge out' window if you will check a "Show all clients' option.

Hint: pressing Ctrl-E in a 'Check out' window switches on/off a mode of the direct editing of data about client - sometimes it can be useful.


Hotel 3

Hotel (integration)

WinTariff can be integrated into the main hotel management system. In this case its role reduces to calls cost calculation and data transfer into the main program. Two transfer channels are possible:

  • Through additional serial RS232 port. After receiving from PBX data about a call the Tariff32.exe module calculates its cost and sends results by the serial interface onto the other computer. In the settings you can choose the 'Fidelio' and 'New hotel' formats
  • or through intermediate text file. In this case Tariff32.exe adds a line into the specified file.

In either event the quite readable data lines are transferred, so you can easily determine a line format - it contains a date, time, internal number, dialed number, and price.

The integration parameters settings you can make in the same window 'Settings->Archives and hotel': 'Hotel' tab, further 'Integration with the control program...' and 'Integration with the 'epitome PMS' system' buttons.


Request record beyond

Error 'Request record beyond..'

The message is indicative of problems with index files - *.ndx or *.mdx. How to fix the problem?
  1. firstly, delete *.ndx files in a folder /Calls (the file with calls (Calls.dbf) is there). These files will be recreated at next report generation
  2. re-index *.mdx files. For this purpose WinTariff contains separate program - 'WinTariff tools':
    • close Tariff32.exe
    • run 'WinTariff tools'
    • check paths to the folders on the first page of the program and click the 'Pack&reindex' button.


Tariff groups

For what purpose the tariff groups are needed?

In the settings of each tariff there is a 'Tariff belongs to the tariff group N' (N=1..4) parameter. 'Tariffs group' is a way to label the given tariff - further this label will be inherited by the calls calculated by this tariff.

Is this necessary? Sometimes it is difficult to separate the calls of interest using general method - by call type or by first number numerals. For instance, it is problematically (although it is possible by excluding unnecessary calls) to build a report on intercity calls (numbers start with 8***), but without international (810*) and cellular (89**) calls. But by using groups the problem is easily solved:

  • divide tariffs by different groups: 1- cellular (and other local calls), 2 - long-distance calls, 3 - international calls
  • now it is possible to choose calls from different groups individually: open selection parameters window and on the 'Time&zone' tab choose the required group.

For example, for long-distance calls in our example the group 2 should be chosen. Other selection parameters can be left without changes (unless that the date range can be specified).

The group of calls can be also used in report forms for invoice detalisation. For example, for an above example the form can be useful, in which data for each group are displayed separately (and in the report header, and for each internal phone):

  • cellular+local
  • long-distance
  • international

The example of such report can be downloaded here (you should copy the file into WinTariff32\Forms) folder. To display summarized data on each tariff group the CALLSCOUNT(TariffGroupNo), TOTALDURATION(TariffGroupNo), TOTALPRICE(TariffGroupNo) functions are applied in the report header. The values of these functions are calculated one time before preparing of a report.

The calculation of intermediate data for each internal telephone is more complicated - the SUM()function is used. Examples:

Calls quantity calculation:

SUM( IF(TrfGroup=2, 1, 0), MasterData1)

MasterData1 is the name of the band of the 'Master data' type, which displays data for each telephone. In the SUM() function this name serves to specify the boudary of summation.

IF(TrfGroup=2, 1, 0) - IF()function returns 1, if the given call belongs to tariff group 2 (if a TRFGROUP field value of the Calls.dbf file is equal 2) or 0, if for this call the other tariffs were used.

Total duration calculation:

SUM( IF(TrfGroup=2, IDuration, 0), MasterData1)

IF(TrfGroup=2, IDuration, 0) - IF() funtion returns the IDURATION field (value of the call duration in seconds) if this call belongs to the tariff group 2 or 0 in the contrary case. Function will return the value in seconds, to format into a general format HH:MM:SS further the I2TIME(SUM(..)) function is used.

Total calls cost:

SUM( IF(TrfGroup=2, IDuration, 0), MasterData1)

- similarly for total duration calculation, but the PRICE field is used instead of IDURATION.

Hint: The list of all WinTariff functions which can be used in reports, you can view in in this way:

  • open the report form in the form editor
  • further you should click on any 'text box', intended to display an information about calls - the small text editor will be opened
  • the left button on the toolbar of this editor is called 'insert a function'- press it, the window of an expression editor will be opened
  • press the 'Functions' button - the window with the list of available functions will be opened.
  • in the left list choose 'WinTariff functions' - in the right list you will see the list of interest with short comments


Export data

How to export data from WinTariff

It is possible to export data from WinTariff to another program for further processing.

  1. Export of selected calls - see 'Report->2nd step Operations->Export'. By default data are exported into the file of *.DBF format with structure identical to the original Calls.dbf file. But in 'open file' window you can select others formats - XLS/CSV/TXT. In this case resulting file will have extended structure - for example, time of the day will be presented in two forms: original (as a number of seconds from the midnight) and in 'readable' format - as HH:MM:SS. To see extra columns just scroll the list to the right.
  2. Results of statistical processing from 'Report->2nd step Operations->Statistics..'. For example, distributions of calls over internal phones may be saved into the *.XLS file (Microsoft Excel).
  3. Less evident, but interestings feature - it is possible to save total REPORT into the CSV-file (may be open in Microsoft Excel). To achive this, please prepare the report as usual. Then click button 'Save' on the toolbar of preview window and select *.CSV file type.
    It is recommended do not complicate report Form, used for this function, with unnecessary formatting. In addition, it is better to move field data to the left as far as possible - otherwise report generator can split one too 'long' report line to the pair of records in the CSV-file.


Export report

How to open the report on another computer?

WinTariff allows to export the prpared report to files of formats PDF, HTML, RTF, CSV and FRP (the last is the format of the report generator used in WinTariff). To export the report please press the button with the image of diskette at the toolbar of preview window.

Hints:

  • PDF - the popular format, for viewing Adobe Acrobat Reader is required.
  • HTML - if a strange symbils are visible in the browser, then choose the correct code table. See ‘View->Encoding’ in Microsoft Internet Explorer. Internet Explorer slowly opens big files!
  • RTF - widespread format, it is possible to open in Microsoft Word (but very slowly), WordPad (built-in editor in Windows), OpenOffice Write, etc.
  • CSV - format for Excel and other spreadsheets (contains the data divided by commas). Pay attention that the report itself, but not selection is exported! (to export the selection there is separate menu item 'Report->Operations->Export'). To get the file suitable to open in spreadsheets, it is desirable to prepare the report form - to remove excess headings and 'to press' fields with data to the left side of a page (otherwise long blocks of data can be broken into two lines).
  • FRP - format of the report genarator Fast Report. A special viewer is required.


Auto archivation

Automatic archiving of calls

There is no built-in auto archiving feature in WinTariff, however, take a look at ProgramFiles\WinTariff32\Extras\ActiveX\WT_auto_archivation.zip - this is an example (with source code) of external program that implements the desired function.

The program works as follows:

  • it is necessary to configure backup options in the module Tariff32.exe (ie, how many calls to keep in Calls.dbf file after backup; see menu item 'Settings->Archives and Hotel')
  • then start WT_auto_archivation.exe - here you can set up the shedule of archiving. This module should be started at the Windows startup.
  • WT_auto_archivation.exe module resides in the tray of the Windows (right-down corner) and runs a module Tariff32.exe in accordance with the schedule, and finally Tariff32.exe performs the required action.

Tariff32.exe module must suspend recording of the calls during backup procedure. However, communication with the module PbxCollect.exe is possible only if both modules run on the same computer. But if the connection could not be established, then nothing bad should not happen - PbxCollect.exe module puts not-saved calls in to the internal buffer (if the Calls.dbf file is not accessible during backup process) and flushes them to the hard disk as soon as possible.

It is recommended to periodically to make a backup of Calls.dbf file - it contains unique information.


PBX load

PBX load analysis

WinTariff can evaluate whether sufficient number of CO-lines is available. For example, it may be useful if you can not call periodically access the outer number.

To analyze the workload see 'Report->2nd step Operations->Statistics->Overlapped calls'. To use it:

  1. Select all calls for one day. Do not analyze several days - the data will be averaged and the picture will distorted.
  2. Then go to 'Report->2nd step Operations->Statistics->Overlapped calls'. A table similar to the following will be shown:
Calls count | Percentage
0 | 66,04%
1 | 18,26%
2 | 8,47%
3 | 4,17%
4 | 1,81%
5 | 0,9%
6 | 0,28%
7 | 0,07%

The meaning of the table: N-th row shows the percentage of time when N-users were busy talking to N external (city) lines. Ie, this example shows that ~18% of the time was used only one outgoing line, about 8% of the time took place two outgoing calls, etc.

The percentages are calculated with respect to the duration of one day (24 hours), with respect to the operating time (8 hours) the figures are approximately three times higher than.

Dissatisfaction of users will start when a significant fraction of the time will be used almost all the CO-lines - the PBX will be unable to execute the next request for an outgoing call.

Amount of lines in the table can be slightly higher than the number of available CO-lines - this is due to the rounding error, caused by the fact that the duartion of the conversation is rounded to the the nearest integer number of minutes (seconds are discarded). For the same reason, small values in the lower row (7th in the example) can be ignored.


UnAnswewred calls

Analysis of unanswered calls

WinTariff allows to analyze the number of unanswered calls, that is the incoming call to a subscriber who did not answer. These calls usually look like incoming calls with zero duration. However, by default WinTariff records only calls with a duration of more than 5 seconds, so the unanswered calls are not saved to the database .

Firstly you have to enable writing of short calls:

in the main module Tariff32.exe please go to the window 'Settings->Main Settings', then the tab 'Pre-filters' and change the parameter 'Store only calls longer than N seconds' to 0 seconds. The same can be done in the module PbxCollect.exe - see menu 'Extra setup', option 'Store calls longer than N sec'

Ok, now calls with zero duration should be registered. To calculate the number of unanswered calls:

select desired calls (see 'Report-> 1st step - Selections', then button 'New') with the following parameters:

  • ‘Call type’ = ‘incoming’ (the tab ‘Main’)
  • you can limit the duration of calls - see the tab 'Time&Zone', set the parameter 'Call duration' to the range '0:00-0:00'

Click 'Execute' button. Second window with requested calls should appear. Now it is possible:

  • prepare an ordinary report - use the report form 'Main Report' (see 'Report->2nd step - Operations-> Report' window)
  • or see the results of statistical processing - for example, the distribution of unanswered calls on weekdays (see '2nd step - Operations->Statistics->by date') or internal phone numbers(see '2nd step - Operations->Statistics->by Extension' window)

What else could be used for the analysis of incoming calls? Some PBX(eg, Panasonic TDA/TDE/NCP) can report a time before the call is connected - this value is displayed in the column 'Ring before' of calls list. If this column is not visible, it can be enabled in the window 'Settings->Appearance->Colors and columns'.

Take a look at the special form of the report - 'Incoming Statistics - Summary' It allows you to view a summary of incoming calls - for each Extension following values are displayed: max/min/average values of the call duration and time to answer.

To use this feature:

  1. select incoming calls (all - answered and unanswered)
  2. and then use report form 'Incoming Statistics - Summary' (see 'Report->2nd step Operations->Report')

In addition, it is possible to export to Microsoft Excel (click 'Report->2nd step Oprations->Export->Call Centre Statistics' ) statistics on incoming calls - in the resulting file contains hourly activity data (the total number of calls received, the number of unanswered calls, and so on) for each internal phone.


Periodicaly send reports

Periodic reports generation

Problem:it is required to create periodically the same reports - say, once a week a summary of the number of calls to all extensions. How it may be implemented?

The basic idea is to pass the name of the script to the main module Tariff32.exe in the command line. In this case Tariff32.exe will run the script and exit. For example, create a script that performs the required action - makes a selection for for the desired period, prepares a report, saves it to a file and possibly sends a report on e-mail (see 'Report->1+2=Scripts'). Suppose that such a script is saved as MyScript1. Then use the Windows scheduler to run (with required intervals - daily, weekly) the following command:

C:\Program Files\WinTariff32\Tariff32.exe MyScript1

As a result, we shall obtain the required reports on a regular basis (in pdf-format) in a given folder, or by e-mail


FAQ 10

Is it possible to save the WinTariff report to the disk?

Yes, it is possible. You have to initiate the window for the report pre-view (naturally, after you have already selected the required calls) - see the ‘Report->2nd Step-Operation->Report’ menu option, and then press the ‘Preview’ button. Within the preview window on the toolbar there is a button with a floppy disk image - press it. Regular window for file selection will be displayed – after that it will be necessary to select the name and file format. Select the *. Html format - it will be possible to view saved reports later with the aid of any Internet-browser, for example, Microsoft Internet Explorer.