Research and System Design of VoIP Dual-mode Gateway

Publisher:SparkStar22Latest update time:2013-04-06 Source: dzscKeywords:VoIP Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    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.

Keywords:VoIP Reference address:Research and System Design of VoIP Dual-mode Gateway

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

Design and implementation of high performance MCU based on H.323
0 Introduction With the continuous improvement of computer hardware, especially CPU main frequency, the efficiency of audio and video encoding based on software is getting higher and higher. Therefore, considering the cost and various factors, software MCU will inevitably become the mainstream direction in
[Embedded]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号