In recent years, with the increasing development of broadband networks and IP technology, the application of VoIP (Volee over Internet Protoc01) technology has become more and more widespread. Gateways are important devices in VoIP networks. According to the application field, they can be divided into telecom-grade gateways and user-side gateways. User-side gateway devices are mainly used in communities and enterprises. They are the bridge connecting terminal phones and IP networks. Their main functions are voice encoding and decoding, signaling processing, VoIP protocol processing, and routing protocol processing. The position of user-side gateway devices in the VoIP network is shown in Figure 1. It can be seen that the gateway is at the end of the user telephone line part and the beginning of the IP network part.
"Dual-mode" refers to the two modes of VoIP and PSTN. A dual-mode gateway is a user-side gateway device that connects to both the PSTN network and the VoIP network and can automatically switch between the two. The dual-mode gateway can use the VoIP network to save a lot of call costs, and can also use the PSTN network to ensure that the telephone line is always open when the VoIP network is unavailable (power outage or route unreachable). In addition, the use of the dual-mode gateway does not require any changes to the PBX switch. Users can also freely choose or the gateway automatically chooses to use the VoIP network or the PSTN network, which has good practicality and flexibility.
1 Working Principle of VoIP Dual-mode Gateway
Gateway plays the main role of protocol conversion, control and gatekeeping in VoIP network, such as call control and call management. Dual-mode gateway adds switching between VoIP and PSTN on the basis of ordinary VoIP gateway. Dual-mode gateway system can be divided into dual-mode switching module, FXS interface circuit module, voice processing module and software control module from the functional point of view. Its system block diagram is shown in Figure 2.
The FXS (Foreign eXchange Subscdber) interface and the FXO (Foreign eXchange Office) interface are two very important interfaces in the VoIP gateway. In the traditional PSTN telephone connection, the telephone center exchange provides power supply and ring current, and the phone itself completes the Tip/Ring circuit to request service or answer calls on the PSTN. In the VoIP telephone connection, the FXS circuit simulates the function of the telephone center exchange, provides power supply and ring current and detects the loop current. The FXO circuit is equivalent to simulating the function of the telephone, providing loop closure and detecting the ring current. The FXS interface circuit is directly connected to the
analog telephone, providing dial tone, power supply, and ring current voltage, and can detect the on-hook and off-hook of the telephone and the loop closure, completing the mutual conversion between analog signals and digital signals. The FXS interface circuit includes a codec CODEC and a subscriber line interface circuit SLIC (Subscriber Line Interface Circuit). The CODEC includes an analog-to-digital converter (ADC) and a digital-to-analog converter (DAC). The SLIC circuit simulates the PSTN voltage. It must be able to detect the on/off of the phone and generate a ringing current voltage of up to 120V. [page]
The dual-mode switching module mainly includes the FXO interface circuit, which is composed of a CODEC and a data processing array DAA (Data Access Arrangement). The CODEC is the same as that in the FXS circuit; the DAA simulates a telephone and removes the high-voltage DC component by providing a loop closure of the PSTN, allowing only the analog AC signal on the PSTN line to pass. The use of the FXO interface circuit in the gateway can achieve the following functions:
(1) Keep the line open during power outages: When the gateway loses power and cannot connect to the VoIP network, the line is switched to the PSTN line.
(2) Call redirection: When the VoIP network is unavailable due to congestion or other reasons, the line can be switched to the PSTN, and the dialed number can be remembered and automatically redialed.
(3) Remote VoIP call: VoIP users can make VoIP calls by dialing in from PSTN in other places. The FXO interface first receives the telephone dial tone (analog signal) on the PSTN, and then converts it into a digital signal and sends it out, which is equivalent to extending the dial tone from one FXO to multiple local FXS.
The voice processing module of the gateway is responsible for compressing and decompressing the PCM digital voice signal. The compression algorithm standards include G.711, G.723.1 and G.729. Different algorithms have different compression ratios and occupy different bandwidths. The compression algorithm can be implemented by hardware DSP or pure software. The
software control module implements the gateway's protocol stack processing and routing processing functions. The protocol stack is responsible for encapsulating the compressed data stream and adding the IP protocol header to form an IP data packet that can be transmitted in the VoIP network. At present, the VoIP protocol stack is mainly based on the H.323 and SIP standards. After the protocol stack converts the data stream into an IP data packet, it selects an appropriate route and sends it to the VoIF network through the Ethernet interface. After receiving the IP data packet, the receiving gateway decompresses the data packet and decodes the decompressed PCM digital signal to restore the original voice signal.
2 VoIP dual-mode gateway system design
This section proposes a system design scheme for a dual-mode gateway based on H. 323. The scheme supports 4-way voice and uses an economical and practical "fake FXO interface" method to achieve dual-mode switching. It can detect incoming calls on the PSTN line during VoIP calls and switch to answer by pressing the spring or Flash key of the phone.
In order to effectively utilize resources, the system uses a three-phase adapter to combine the telephone line and the PSTN line into an RJ11 interface, and each voice channel uses a three-phase adapter. The connection method of the three-phase adapter is shown in Figure 3.
The use of three-phase adapters can simplify the implementation of dual-mode switching and reduce the number of physical ports of the device.
The system design adopts the overall architecture of "hardware + embedded operating system + application layer software".
2.1 Hardware Design
The hardware part of the system mainly includes dual-mode switching module, FXS interface circuit, voice processing module circuit, CPU module and Ethernet module. The hardware design schematic diagram is shown in Figure 4.
The dual-mode switching module uses a "fake FXO interface" approach. The circuit uses relays to control the dual-mode switching between the VoIP and PSTN channels of each voice channel. When the gateway is not powered on, the relay defaults to the state of connecting the telephone line with the PSTN line. After power-on, a FPGA programmable logic chip controls the switching of the relay. The FPGA chip is a key component for the gateway to achieve intelligent switching. The control logic implemented includes logic such as ring current detection on the PSTN line and telephone spring action detection, and controls the relay to switch accordingly. The interface between the FPGA and the CPU can implement the logic of switching to the PSTN network when the VoIP network route is unreachable. The dual-mode switching module implements some functions of the FXO interface, but it is not a real FXO interface, so it is called a "fake FXO interface". The
FXS interface circuit module is mainly composed of SUC chip and Codee chip, which are Le79R70 chip and Le58Q021 chip of Legerity Company respectively. Le58Q021 is a 4-channel Codec chip that can control the working state of the SLIC chip (Le79R70), select the coding scheme (linear, a-law, μ-law), and support software-programmable SLIC input impedance, balanced impedance and frequency response characteristics. The system uses 1 Le58Q021 and 4 Le79R70 chips to work together to support 4-way voice, provide power to the phone, generate ringing signals, detect phone pick-up and hang-up, etc., and is responsible for completing the conversion between telephone analog signals and PCM digital signals.
The voice processing DSP chip uses AudioCodes' AC483, which can simultaneously support 4-channel voice codecs, support G. 729A, G. 723.1, G. 727, G. 726, G. 711 and other compression algorithm standards, and can complete real-time voice compression, DTMF signal detection, generation and echo cancellation. [page]
The system CPU chip uses Samsung's ARM7TDMI series S3C4510B, which has an operating frequency of 50NHz. It integrates a variety of general modules, including an Ethernet controller that supports 10M/100M adaptive transmission, and can directly lead to the Ethernet interface through the PHY chip. The Ethernet PHY chip uses Intel's LXT972A chip, which has 1OM/100M adaptive transmission and reception functions and supports full-duplex operation. In addition, the system also uses 2MB Flash, 16MB SDRAM and 512KB SRAM as memory.
2.2 Software Design
The software part is mainly composed of an embedded operating system and application layer software, which completes protocol stack processing, routing processing and other control functions. The software solution hierarchy is shown in Figure 5.
The embedded operating system uses μCLinux. μCLinux is an embedded operating system customized for processors without memory management units. It has rich network functions, open source code, customizable content and easy porting. According to the characteristics of the hardware platform, it is also necessary to develop drivers that adapt to the hardware platform, including Bootloader, serial port driver and Ethernet driver. Among them, Boofloader is the key to porting the uCLinux operating system. When the system is powered on, Bootloader is responsible for hardware initialization, interrupt processing and hardware clock management, and loads the operating system image into the memory. To facilitate system network upgrades, Bootloader can implement TFTP network functions. The serial port and Ethernet port drivers are relatively simple, and they only need to realize the correct transmission and reception of data.
The software of the application layer is mainly composed of H. 323 protocol stack processing module, routing processing module and DSP control module. H. 323 protocol stack is responsible for call control and signaling, audio processing and real-time media transmission. The system uses the relatively mature open source OpenH323 protocol stack as a reference, and the functional modules on the application layer are all developed based on this protocol stack. The routing addressing module is mainly responsible for routing addressing and routing management, determining the IP address of the destination gateway, and selecting the best route to transmit the IP data packet to the destination gateway through the IP network. The DSP control module mainly controls the behavior of the DSP chip AC483 by writing corresponding control programs according to the call flow in the application. The network management module provides Web network management and CLI command line interface, which makes it easy to configure and maintain the dual-mode gateway.
3 Application Solution
As a user-side gateway device, the system can be widely used in communities and enterprises. For communities with a relatively small number of users, the phone can be directly connected to the gateway, as shown in Figure 6. For enterprises with a relatively large number of users, it can be connected to a PBX switch, as shown in Figure 7.
The system is designed based on the H.323 protocol stack. At present, the basic functions of the system have been realized, and it can communicate with other gateway devices and the operator's Gatekeeper. Based on this design, more channels can be supported by selecting chips with stronger processing capabilities, the SIP protocol stack can be added to support the dual protocol stack architecture, and the real FXO interface circuit can be implemented to support remote VoIP calls. These are all areas where the system can be improved in the future.
Previous article:A method for embedding gigabit network function in U-BOOT
Next article:Design and Implementation of MPEG-4 Digital Video Recorder Based on S3C2410
Recommended ReadingLatest update time:2024-11-16 17:43
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【Development Kit for nRF52840】+ Hardware Review
- [Repost] Comparison between aluminum electrolytic capacitors and tantalum capacitors
- Programming example: CPU card response data command
- How to use multiple devices to study radiation signals - Part 1
- Tianjin - Recruiting embedded software and hardware engineers - fresh graduates preferred
- Flash memory failure characteristics
- [RVB2601 Creative Application Development] User Experience 05 -- TCP Client
- CXA-L10A Tube Lamp Inverter
- Transistor User Manual
- How do pressure sensors work at high temperatures?