Select your language

Sometimes you may need to record information about using telephone line: the dialed number, time and duration of the call. This is especially true with the introduction of hourly pay telephone conversations and with frequent long-distance and international calls. The described device intended to record outgoing phone calls in the database computer.

The device allows you to record all the telephone number being dialed, date and time call, its duration, to billing and produce some statistical processing of the stored information. Also provides protection from unauthorized connection to the line and the ability to block long-distance calls separately for each of the five connected phone.

The system described consists of a dialed number recorder and computer installed program. The logger is connected to the telephone line. He reads the dialed number and transmits it to the computer via the serial port. If, at the time of the call the computer was off, or manufacturing program is not running, the registered data is temporarily stored in non-volatile the device memory.

The basis of the device - PIC-controller DD3 (Fig. 1), the cheapest of the offered by Microchip. Data on calls and configuration are stored in non-volatile memory DD2. Telephones (SLT) can be connected as directly in-line, or via the Registrar. In the latter case, the Registrar will be able to determine which model was discussed. This feature is convenient use, for example, to separate bills for long-distance negotiations between multiple users are sharing one phone line. Communication with PC through the optocoupler U5. that allows isolating galvanically the computer and the telephone line. The device is powered by the telephone line.

(click to enlarge)

In the initial state (i.e. when the handset lying on all devices, connected to the line controller monitors the sensor voltage in line - divider R4R6. produces the current time and about every half a minute cause the processing computer program. If the computer is on and the program is running, the Registrar checks the internal clock with the clock of the computer and, if necessary, transmits the stored information about the calls.

After removal of the tube, the controller determines by measuring the voltage on the collectors of transistors optocouplers U1.1 - U1.44 what exact device removed the handset. If the phone is connected directly to the line, it is considered that the tube was removed with TA1. Then the information about the occupation line and the number of the specific apparatus is transmitted to the computer, which is reflected in the status bar of the program and in its icon on the taskbar. Further, the device reads the number to be dialed and simultaneously transmits it to a computer for further indication. After dialing each digit in the controller software reset the time counter, which allows you to define the end of dialling.

If after dialing the numbers more than 5 and the number of dialled digits more than five, it is considered that the dialed number. Thus on the control electrode of the key K1 a high level, the key is opened and connects the comparator DA1 to a common wire. However, the controller continues to monitor the state of the voltage sensor in the line R4R6 in case the dial will be resumed. Got it will happen, the comparator again switches off again and reset the time counter.

After dialing, the device starts to measure the duration of the conversation. The salient point here is to register early for connection, as telephone stations do not send user devices are no signs of the beginning of the conversation. In most phone sets or PBX with built-in recorders of this problem is solved as follows, after dialing the last digit is counted a specified time, after which the conversation is started. This causes the database of outgoing calls enter data, conversations on really was not conducted (for example, when a caller waited more than a predetermined time, and then hung up).

Because of such cases is quite a lot, the resulting database can be "clogged" incorrect information. If the home environment is may be acceptable, for organizations where a day is a lot calls, wrong information is greatly complicate the processing of the received data. To also count the total value of these conversations will certainly be inaccurate.

To minimize this problem in the Registrar beginning of the conversation is determined tracking signal ringback (CMP) station. For this is the the comparator DA1. As already mentioned, after dialing the comparator connects to the line. He eats through a resistor R5, and the signal line comes with at him through the capacitor C3 and resistor R10. The program controller analyzes the signal from the output of the comparator, comparing it with the frequency of the signal the ringback. This frequency must be 425±2 Hz.

Once you are connected, the caller will hear a signal CPV, called to sound the call signal, and the controller will detect the signal frequency 425 Hz. The duration of the parcel signal CPV for about 1 second and pause between parcels - not more than 5 s. Thus, by registering the absence of signal CPV for more than 5 s, we can assume that on the other end picked up the phone (started conversation). In the actual device, this time taken a little more than (10), and through the duration of the conversation begins with 5 s. i.e. the accuracy is ±5 s.

However, the frequency of the CPW is not always equal to 425±2 Hz. it can vary significantly in depends on what kind of PBX calls. The controller program allows you to detect a frequency in the range of 410...440 Hz. but this is not always happens enough. If the frequency of the signal ringback beyond these the extent of the conversation is considered to be started after 20 seconds after the last set the numbers in the case of the city through the ringer and 40 - in the case of long-distance.

The Registrar then counts the duration of the call and waits for the tube is placed on the apparatus. Once this happens, the controller will record the information in memory and pass it to the program of the computer (if it is running). The volume of non-volatile memory enough to remember about 100 intercity calls. After that, the controller returns to wait state on hook.

It was already mentioned that the connection with the computer through the opto-coupler U5.1, U5.2 Receiving data back from the collector of the optocoupler U5.2. For transmission lights up the led of the optocoupler U5.1. the findings of the port of the computer and RTS DTR is programmatically exposed, respectively, positive and negative levels for power transistors VT2, VT3. When the led of the opto-coupler U5.1 is extinguished, its the transistor is closed. Therefore, the transistor VT2 is closed, a VT3 is open and receiving a R. o port receives a negative level. When you turn on the optocoupler U5.1 the transistor VT2 open, VT3 is closed and the computer enters a positive level.

To enable optocoupler U5.1 requires a relatively high current (more than the current. which can be consumed from the telephone line). Therefore, after the transmission of each byte controller pauses for charging the storage capacitor C1, whereby the data transfer rate will be small, of the order of 100 bits/s. But and that is enough for these purposes. If powering the device from the battery battery cells, the speed can be increased to 300 bps. For this it is necessary in the attached firmware program content addresses 0x01C-0x01F changed to zero.

Quartz resonator ZQ1 sets the frequency of operation of the internal clock controller DD3. Multivibrator elements DD1.1 and DD1.2 is designed to the work of the internal clock of the controller, the time which is adjusted each time the data exchange with the computer. To save time when short-term disconnections from the line serves as an electric double-layer capacitor C2. He is charged through the resistor R3 with high resistance (100 kω). so as not to shunt the voltage supply controller at the moment of switching devices. Therefore, charging ioniser C2 lasts a for a long time, about 5...6 hours, and its capacity is enough for 20 to 30 minutes of work Registrar, which is enough to maintain work hours exposure the voltage drops.

Instead of ioniser C2 is permissible to install a battery of electrochemical cells with voltage 3...4.5 V. If you are sure that the phone line is disconnected will not, can not install any of the ultracapacitor. neither the battery.

The device does not require networking and should work immediately after Assembly. Bits configuration for flashing: LP generator. the watchdog timer can be enabled or off.

The Registrar works well on a standard telephone lines with a voltage of 48...60 V On the coupled lines and PBX type "Kvant" it will not work.

The manufacturing program is developed in the environment of C++Builder V1.0 and is a standard multi-window program for the Windows operating system (Fig. 2).

The program uses the BDE (Borland Database Engine), which partially included in the distribution. Therefore, its volume turned out to be rather large and is 2.3 MB. The installation process is simple: from user you only need to set the folder for the program files. By default, the program will installed in "Program Files". After installation, the program places a shortcut to menu "startup". If each time you turn on the computer, no need to start, this label is removed manually.

The work program is based on the analysis obtained from the Registrar of digits dialed number. On it she can determine whether the call intracity, intercity or international, to find in its database the corresponding city and the caller's name (if defined in advance), to calculate the cost of the call. The program is supplied with a detailed context-sensitive help, most teams duplicate keyboard shortcuts and corresponding buttons, have pop-up tips. In order to know the function of that other buttons, you just hold your cursor over it.

After the first start the program, open the window "settings" (in main menu) and in the tab "Location" indicates the country code for "7") code and the city where the Registrar. If access to the city is via an extra digit, it should also be mentioned. Then you need to click on click "Yes". Then you need to communicate with the Registrar. Via the menu "Logger -> Select port specify the serial port to which connects through the Registrar and the Registrar -> Add connection" check communication with the Registrar. After installation, connection, perform the initial reset all settings non-volatile memory of the data logger via the menu "recorder -> Reset". Now the device is ready for operation.

How does the process work in the device? Once you remove the handset from apparatus, in the status bar and in the program icon on the taskbar will be written by: the tube is removed and the number of this phone. Then type some room. While typing in the status bar and the icon of the program you see the dialed digits. After the processor Registrar determines that the dial is finished, you will see "Set over" and detection signal ringback will be written "Connection", and by the disappearance this message - "the Conversation". At the beginning of the conversation will turn on the meter the duration of the negotiations. When the conversation is over, the data of this call will be transferred to the computer.

To see this data, you must open the table of outgoing calls - "Open -> Calls". Here will be presented to all incoming database calls. For each of them there are fields indicating the date and time of the end conversation, the country code, city and telephone number of the subscriber, which was addressed to the call, phone number, phone (one of five), names of countries, cities, subscriber's name, length of call, the unit price used time and the total cost of the meeting. After opening this table the main menu will be replaced with the menu of the table calls.

Given that records of calls over time builds up quite a lot, the possibility of narrowing the scope of their view. For example, using the command "Sort -> For the period, you can view data about calls for a certain the period of time, say, for the last month. And using commands simultaneously "Sort -> long-distance and international" and "Tools -> Amount per period" you can determine the approximate amount of long distance calls per month. Through the menu item "View -> ..." looking at the calls made with specific phone. Since the program multiwindow, the same table you will be able to simultaneously open multiple times and viewed in different ways. Conclusion printing is done via "Tools -> Print". Display the form preview (QuickReport). from which by pressing the "Print report" form is displayed on the printer.

In addition to the table of received calls in the program there are two tables. One of them called "the Notebook" (Fig. 3), and the other "rate table" (Fig. 4). In the first contains country and area codes, numbers and names of subscribers. From this the table information is transferred to the table of outgoing calls in accordance with obtained from the Registrar number. "Notebook" can be edited, to add new numbers and names of subscribers or remove unnecessary ones. There the ability to search the desired information.

Billing is done on the basis of the information contained in "Table tariffs". Her rates are set separately for each direction, which tied to a specific code of the city or country. Then they are put in compliance adopted from the Registrar to the room and placed in the table calls. This approach to pricing somewhat simplified, but it allows subscribers to use information about tariff zones, the acquisition of which the connection to the program can be difficult. The user is required just ask rates for those cities to which it can call.

The setting of tariffs is as follows. The rate table you want to add a new line by pressing the "+". Then enter the country code and the city and the name of the destination. CIS can be set only code country and city code - not necessarily. You must also specify the date of entry tariff in force. Due to the fact. the rates change periodically, at a specified the date the program will determine which of the existing tariffs for this item valid at the time of a particular call. Suppose that for a particular the city was asked to rate valid as of 01.01.99. Then we introduced a new tariff with 01.06.99. Thus, for this town must be set both tariff. When this calls made in the period from 01.01.99 on 01.06.99. will be taken into calculations the first tariff, and later on the second. If the call was made to 01.01.99. then it will be assumed that its value is zero.

After creating a new row in the table of tariffs need to click on "Save" button the edit string", i.e. to remember a new entry in the database. You then double-click on that line. When this dialog box appears tasks the rate (Fig. 4). It allows you to enter several different tariffs for of the day (e.g. day and night), ask some tariffs, applicable to workers days. and others on weekends and holidays.

Let's ask daily rate operating from 07:00 to 23:00. and night for the rest of the time. First you need to go to the first window "Time:" and ask "06:59:59". In the "Rate G ask the nightly rate. While in the second window Time from:" will appear 07:00:00. Then in the second window "Time:" set time "23:00:00", and in the "Tariff 2" - daily rate. In the third box, "Time:" will appear time "23:00:01". Next, you need to specify in the "Rate 3" "Time: "23:59:59" and the night rate.

If weekends and holidays there is a separate rate, we should go on the "Advanced" tab and check the ' Separate tariff on weekends and holidays". After that, the tab Weekends and holidays" will become available you can set the appropriate fare. Also in the Advanced tab is visible table of holidays that can be edited. When the checkbox is selected "Second by second" program believes that the rate is given per second. If after compounds payment is taken once a a while, it will be set in the window "To consider... the first minute (seconds)".

Besides the basic functions of the proposed system can perform a number the subsidiary. In the window "settings" tab in the "Lock" can be set the boxes ban long-distance calls separately for each phone. In this case, if the first digit dialed number is "8", a further set becomes impossible. Also blocked a set of any number from the first phone (TA1). Since this phone is the one. which is directly connected to the line then this option is equivalent to the protection from unauthorized use the line.

After any changes to the check boxes in the "Lock" and clicking "Yes" there is a transfer of information about the settings in the logger. In the case where the logger is not connected to the computer, the user will receive an appropriate message.

If the shortcut is in the startup folder, it is convenient to select the "Start minimized" in the Advanced tab window "Setting". This will allow the program to run in the background, and the user will be able to monitor the status of the phones, not expanding the program, by the messages on the program icon in the taskbar.

The program and the firmware for the PIC controller.

Author: V. Kulakov