Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

System for registration and billing of outgoing calls. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Telephony

Comments on the article Comments on the article

Sometimes it becomes necessary to record information about the use of a telephone line: the dialed number, time and duration of the conversation. This is especially true with the introduction of time-based payment for telephone conversations and with frequent long-distance and international calls. The described device is intended for registration of outgoing telephone calls in the computer database.

The device allows you to record all dialed telephone numbers, the date and time of the conversation, its duration, conduct billing and perform some statistical processing of the accumulated information. There are also protection against unauthorized connection to the line and the ability to block long-distance calls separately for each of the five connected phones.

The described system consists of a dialing number recorder and a computer with a program installed on it. The recorder is connected to a telephone line. It reads the dialed numbers and transmits them to the computer via the serial port. If at the time of the call the computer was turned off, or the processing program was not running, then the registered data is temporarily stored in the non-volatile memory of the device.

The basis of the device is the DD3 PIC controller (Fig. 1), the cheapest one offered by Microchip. Call and setup data is stored in non-volatile memory DD2. Telephone sets (SLT) can be connected both directly to the line and through the registrar. In the latter case, the registrar will be able to determine from which device the conversation was conducted. This feature is convenient to use, for example, to split bills for long-distance calls between several users of the same telephone line. Communication with the computer is carried out through the U5 optocoupler. which allows you to galvanically isolate the computer and the telephone line. The device is powered by the telephone line.

System for registration and billing of outgoing calls
(click to enlarge)

In the initial state (that is, when the handsets are on all devices connected to the line), the controller monitors the state of the voltage sensor in the line - the divider R4R6. calculates the current time and calls the computer processing program approximately every half a minute. If the computer is turned on and the program is running, the registrar compares its internal clock with the computer's clock and, if necessary, transmits the accumulated information about calls.

After picking up the handset, the controller determines, by measuring the voltage on the collectors of the transistors of the optocouplers U1.1 - U1.44, from which device the handset was picked up. If this phone is connected directly to the line, then it is considered that the handset has been picked up from TA1. Then information about the occupation of the line and the number of a certain device is transmitted to the computer, which is reflected in the status bar of the program and in its icon on the taskbar. Next, the device reads the dialed number and simultaneously transmits it to the computer for further indication. After dialing each digit in the controller, the program time counter is reset, which allows you to determine the end of dialing.

If more than 5 seconds have passed since dialing a digit and the number of dialed digits is more than five, it is considered that the number has been dialed. In this case, a high level enters the control electrode of the K1 key, the key opens and connects the DA1 comparator to the common wire. However, the controller continues to monitor the status of the voltage sensor in line R4R6 in case the dialing is resumed. If this happens, the comparator will turn off again and the time counter will reset again.

After the end of dialing, the device starts to measure the duration of the conversation. The most difficult moment here is the registration of the beginning of the connection with the subscriber, since the city telephone exchanges do not send any signals to the subscriber devices about the beginning of the conversation. In most telephones or PBXs with built-in registrars, this problem is solved as follows: at the end of dialing the last digit, the specified time is counted, after which the conversation is considered to have begun. This causes the database of outgoing calls to contain data about conversations that were not actually conducted (for example, when the caller waited for an answer for more than a specified time, and then hung up).

Since there are quite a lot of such cases, the resulting database can be heavily "clogged" with incorrect information. If for home conditions this can still be acceptable, then for organizations where many calls are made per day, incorrect information will greatly complicate the processing of the received data. In addition, the calculation of the total cost of calls, of course, will be inaccurate.

To minimize this problem in the registrar, the start of a conversation is determined by monitoring the station's ringback signal (RPC). For this, the comparator DA1 serves. As already mentioned, after dialing is completed, the comparator is connected to the line. It is fed through resistor R5, and the signal from the line is fed to it through capacitor C3 and resistor R10. In this case, the controller program analyzes the signal from the output of the comparator, comparing it with the frequency of the ring back signal. This frequency should be 425±2 Hz.

After the connection is made, the caller will hear a dial tone, the called party will hear a call tone, and the controller will detect a 425 Hz tone. The duration of sending the CPV signal is about 1 s. and the pause between parcels is no more than 5 s. Thus, having registered the absence of a callback signal for more than 5 s, we can assume that the other end picked up the phone (a conversation began). In a real device, this time is taken a little longer (10 s), and the call duration count starts from 5 s. i.e. the accuracy is ±5 s.

However, the CPV frequency is not always equal to 425±2 Hz. it can differ significantly depending on which PBX the call is made to. The controller program allows you to detect the frequency within 410...440 Hz. but this is not always enough. If the ring back tone frequency goes beyond these limits, the conversation is considered started 20 seconds after the end of the last digit in the case of a city call and after 40 seconds - in the case of a long-distance call.

Then the registrar counts the duration of the conversation and waits for the handset to be laid on the device. As soon as this happens, the controller will fix the received information in memory and transfer it to the computer program (if it is running). The amount of non-volatile memory is enough to memorize about 100 intracity calls. After that, the controller returns to the off-hook waiting state.

It has already been mentioned that communication with the computer is carried out through optocouplers U5.1, U5.2. Data is received from the collector of optocoupler U5.2. For transmission, the LED of the optocoupler U5.1 is lit. at the same time, positive and negative levels are set programmatically at the terminals of the computer port RTS and DTR, respectively, to power the transistors VT2, VT3. When the LED of optocoupler U5.1 is off, its transistor is closed. Therefore, the transistor VT2 is closed, and VT3 is open, and a negative level is supplied to the receiving output of port R. When the optocoupler U5.1 is turned on, the transistor VT2 opens, VT3 closes and a positive level is supplied to the computer.

The optocoupler U5.1 requires a relatively large current to turn on (more than the current that can be drawn from the telephone line). Therefore, after the transfer of each byte, the controller pauses to charge the storage capacitor C1, as a result of which the data transfer rate will be small, about 100 bps. But this is quite enough for these purposes. If you power the device from a battery of galvanic cells, then the speed can be increased to 300 bps. To do this, in the attached firmware program, the contents at addresses 0x01C-0x01F must be changed to zero.

The quartz resonator ZQ1 sets the frequency of the internal clock generator of the controller DD3. The multivibrator on the elements DD1.1 and DD1.2 is designed to operate the internal clock of the controller, the time on which is adjusted during each data exchange with the computer. To save the clock readings during short-term disconnections from the line, an ionistor C2 is used. It is charged through a high resistance resistor R3 (100 kΩ). so as not to shunt the power supply circuit of the controller at the moment the device is turned on. Therefore, charging the C2 ionistor lasts quite a long time, about 5 ... 6 hours, and its capacity is enough for 20 ... 30 minutes of recorder operation, which is quite enough to maintain the clock with a short power failure.

Instead of ionistor C2, it is permissible to install a battery of galvanic cells with a voltage of 3 ... 4.5 V. If you are sure that the telephone line will not be turned off, you can not install either an ionistor. no battery.

The device does not require adjustment and should work immediately after assembly. Configuration bits for firmware: LP generator. watchdog timer can be enabled or disabled.

The registrar is operable on standard telephone lines with a voltage of 48...60 V. It will not work on paired lines and on automatic telephone exchanges of the "Kvant" type.

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

System for registration and billing of outgoing calls

The program in its work uses BDE (Borland Database Engine), which is partially included in the distribution. Therefore, its volume turned out to be relatively large and is 2.3 MB. The installation process is simple: the user only needs to specify a folder for the program files. By default, the program will be installed in "Program Files". After installation, the program will place its shortcut in the "startup" menu. If there is no need to launch it every time you turn on the computer, this shortcut is removed manually.

The operation of the program is based on the analysis of the digits of the dialed number received from the registrar. Based on it, she can determine whether the call is intracity, long distance or international, find the corresponding city and subscriber name (if they are set in advance) in her database, and calculate the cost of the call. The program is provided with detailed context-sensitive help, most commands are duplicated by shortcut keys and corresponding buttons provided with tooltips. In order to find out the purpose of a particular button, you just need to hold the cursor over it.

After the first launch of the program, the "Settings" window is opened (via the main menu) and in the "Location" tab indicate the country code (for Russia - "7") and the code of the city where the registrar will be located. If the exit to the city is through an additional digit, then it should also be indicated. After that, you need to click on the "Yes" button. Then you need to establish a connection with the registrar. Through the menu "Registrar -> Port selection" specify the serial port to which the registrar is connected and through "Registrar -> Establish communication" check the connection with the registrar. After the connection is established, perform an initial reset of all settings of the recorder's non-volatile memory through the "Registrar -> Reset" menu. Now the device is ready for use.

How does the process of the device work? As soon as you lift the handset from the device, the status bar and the program icon on the taskbar will say: the handset is off-hook and the number of this phone is indicated. Then dial some number. During dialing, you will see the dialed numbers in the status bar and in the program icon. After the recorder processor determines that the dialing is completed, the message "Dialling completed" will appear and when a ringback tone is detected, it will say "Connecting", and when this message disappears, it will say "Conversation". At the moment the conversation starts, the counter of the duration of the conversation will turn on. When the conversation ends, the data about this call will be transferred to the computer.

To see this data, you need to open the table of outgoing calls - "Open -> Calls". The entire database of incoming calls will be presented here. For each of them there are fields indicating the date and time of the end of the conversation, country code, city, subscriber number to whom the call was addressed, telephone number from which the call was made (one of five), country name, city, subscriber name, call duration, prices per unit of time used and the total cost of the conversation. After opening this table, the main menu of the program will be replaced by the call table menu.

Considering that quite a lot of records of calls accumulate over time, it is possible to narrow the scope of their viewing. For example, using the "Sort -> For period" command, you can view data on calls for a certain period of time, say, for the last month. And using the commands "Sort -> Long distance and international" and "Service -> Amount for the period" at the same time, you can determine the approximate amount of payment for long distance calls per month. Through the "View -> ..." menu items, you can view calls made from a specific phone. Since the program is multi-window, you can open the same table several times at the same time and view it in different versions. Printing is carried out through the "Service -> Print". This item displays the preview form (QuickReport). from which, by pressing the "Print report" button, the form is output to the printer.

In addition to the table of received calls, the program has two more tables. One of them is called "Notebook" (Fig. 3), the other - "Tariff Table" (Fig. 4). The first contains codes of countries and cities, numbers and names of subscribers. Information from this table is transferred to the table of outgoing calls in accordance with the number received from the registrar. "Notebook" can be edited, add new numbers and names of subscribers or delete unnecessary ones. You can search it for the information you need.

System for registration and billing of outgoing calls

System for registration and billing of outgoing calls

Tariffication is carried out on the basis of the information contained in the "Tariff Table". It sets tariffs separately for each direction, which is tied to a specific city or country code. Then they are put in accordance with the number received from the registrar and placed in the call table. This approach to billing is somewhat simplified, but it allows subscribers not to use information about tariff zones, which may be difficult to acquire and connect to the program. The user is only required to set tariffs for those cities to which he can call.

Tariffs are set in the following way. In the tariff table, you need to add a new line by pressing the "+" button. After that, enter the country and city code and the name of the destination. For non-CIS countries, only the country code can be specified, and the city code is optional. You must also specify the effective date of the tariff. Because. that tariffs change periodically, then by the specified date the program will determine which of the current tariffs for this point is valid at the time of a particular call. Let's say that for a certain city a tariff was set, effective from 01.01.99/01.06.99/01.01.99. Then a new tariff was introduced from 01.06.99/01.01.99/XNUMX. Thus, both tariffs must be set for this city. At the same time, calls made between XNUMX/XNUMX/XNUMX and XNUMX/XNUMX/XNUMX. will be calculated according to the first tariff, and later - according to the second one. If the call was made before XNUMX. then it will be considered that its value is equal to zero.

After creating a new line in the tariff table, you need to click on the "Save line change" button, i.e. save the new entry in the database. Then you need to double-click on this line. In this case, a dialog box for setting the tariff itself will appear (Fig. 4). It allows you to enter several different tariffs during the day (for example, day and night), set one tariff that is valid on weekdays. and others on weekends and holidays.

Suppose you want to set a daily rate that is valid from 07:00 to 23:00. and night for the rest of the time. First you need to go to the first window "Time to:" and set "06:59:59". In the "Tariff G" window, set the night tariff. In this case, 07:00:00 will appear in the second "Time from:" window. Then, in the second "Time to:" window, set the time "23:00:00", and in the "Tariff 2" - daily rate. In this case, the third window "Time from:" will display the time "23:00:01". Next, you need to set in the window "Tariff 3" "Time to: "23:59:59" and the night rate.

If there is a separate tariff for weekends and holidays, then go to the "Advanced" tab and check the box "Separate tariff for weekends and holidays". After that, the "Weekends and holidays" tab will become available and you can set the appropriate tariff. Also in the "Advanced" tab you can see the table of holidays, which can be edited. If the "Per second" checkbox is checked, the program considers that the tariff is set per second. If after the connection the payment is taken immediately for some time, then it is set in the "Take into account ... the first minutes (seconds)" window.

In addition to the main functions, the proposed system can perform a number of auxiliary functions. In the "Settings" window in the "Blocks" tab, you can set the flags for prohibiting long-distance calls separately for each phone. In this case, if the first digit of the dialed number is "8", further dialing becomes impossible. It also blocks dialing any number from the first phone (TA1). Since this phone is considered one. connected directly to the line, this feature is equivalent to protection against unauthorized use of the line.

After any change in the checkboxes in the "Locks" tab and pressing the "Yes" button, information about the settings is transferred to the registrar. In the event that the recorder is not connected to the computer, the user will receive a corresponding message.

If the program shortcut is located in the Startup folder, it is convenient to check the "Run this program minimized" box in the "Advanced" tab of the "Options" window. This will allow the program to run in the background, and the user will be able to monitor the state of the phones without expanding the program, according to the messages on the program icon in the taskbar.

Distribution of the program and firmware of the PIC controller.

Author: V.Kulakov

See other articles Section Telephony.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Hypersonic wind tunnel JF-22 26.08.2021

China is building a JF-22 hypersonic wind tunnel that can simulate Mach 30. To be more precise, we are talking about a speed of 10 km / s at an altitude of 40-100 km.

JF-22 will be the most modern and fastest wind tunnel in the world. The construction is planned to be completed next year. The object will be used to create hypersonic and aerospace aircraft, as well as for weapons.

The construction of the facility started in 2018. At the same time, they talked about a pipe length of 245 meters and a speed of up to Mach 25, but by now it has been possible to raise the predicted figures.

Other interesting news:

▪ New series CKR relay Crydom

▪ Road traffic can exacerbate allergies

▪ space fire extinguisher

▪ NCP4589 Auto Power Saving LDO Regulator

▪ Freecom Hard Drive XS 3.0 - external hard drive with USB 3.0

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ Telephony site section. Article selection

▪ article State machine. Popular expression

▪ article How old are the youngest stars? Detailed answer

▪ article The functional composition of Nova TVs. Directory

▪ article Equivalence of electric and magnetic antennas. Encyclopedia of radio electronics and electrical engineering

▪ article Let's silver the mirror. Chemical experience

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024