Design of LAN IP Phone Based on ARM

Publisher:楼高峰Latest update time:2011-07-07 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Preface

As computer network technology develops and updates faster than PBX, and equipment prices have dropped significantly, establishing an Internet (or Intranet)-based IP telephone network to replace traditional telephone equipment systems has become a goal for enterprises.

LAN IP Phone

LAN IP Phone uses unified network communication equipment and wiring to transmit voice and data. In the traditional PBX (Private Branch Exchange) system, voice calls enter the office through a series of standard voice lines connected to the office PBX, that is, voice traffic is received and channeled on standard telephone wiring through a dedicated device. However, in the LAN telephone voice network, voice calls are received and channeled through an IP-based PBX, which is connected to the existing data network. IPPBX can be an independent solution or it can be decomposed into several decentralized devices. The specific functional block diagram is shown in Figure 1.

The main advantages of this IP phone:

· It can easily move and add terminal equipment;

· Support multimedia terminals;

· It is conducive to the development of computer telephone integration technology;

Figure 1 LAN IP Phone Functional Module Diagram


Figure 2 AT75C220 block diagram


Figure 3 IP phone architecture

Hardware platform

The basic design requirements of hardware are usually: high density, low power consumption and low cost. Many of the performance of VoIP corresponds to specific application requirements, such as: (1) system segmentation, including packet aggregation and routing; (2) software performance that defines product functions; (3) network management capabilities that meet high availability. LAN

telephone products work in pure IP mode, so after the phone is connected to the wide area network, it should be compatible with network management. The VoIP phone in this solution is a gateway-down terminal product. This device can be directly connected to the Ethernet without going through a gateway and can be used after configuring the relevant address information. It is developed based on Atmel's AT75C220 development board. AT75C220 is a high-performance processor chip designed for various Internet applications. Its core component, the ARM7TDMI microprocessor, has an operating capacity of 40MIPS, and the OakDSPCore coprocessor (the voice processing chip in Figure 2) specifically used for voice processing has an operating capacity of up to 60MIPS. The information exchange between the two uses an efficient dual-port mailbox mechanism. This determines that AT75C220 can integrate the control function of general-purpose CPU and the information processing function of special-purpose CPU, improve the integration of the system, and at the same time, the operation instructions of ARM processor are relatively simple, which reduces the complexity of development.

In addition to the standard serial interface for connecting to the computer and the RJ11 interface for connecting to the phone handle, the AT75C220 development board also has two standard RJ45 Ethernet interfaces for connecting to the gatekeeper. The ARM7TDMI core processor controls the operation of the entire VoIP phone and provides a general I/O interface for connecting the dial keyboard, LCD display and ringing circuit. The block diagram of the AT75C220 is shown in Figure 2.

The AT75C220 development board is equipped with flash memory (flash) for storing application programs. The computer can use the hyperterminal program to interact with the AT75C220 chip through the serial interface on the development board to realize the application programming of the flash and other software management functions. The PC for developing AT75C220 application software must start and run the siap-mClinux operating system. After the application is developed, the img file containing the application and the operating system kernel is downloaded to the flash on the 220 development board through the tools provided by the 220software set, and the system development is finally completed.

The structure of the VoIP phone is shown in Figure 3. Its user interface is the same as that of an ordinary phone. The display is used to display relevant information, such as the number dialed when initiating a call, caller ID, etc. In addition, the VoIP phone can be connected to a personal digital assistant (PDA) device through a serial port to achieve functions such as software upgrades and automatic dialing. The function of the voice interface is to realize the mutual conversion between voice analog signals and standard 64Kbit/s PCM signals. The network interface is responsible for the sending and receiving of voice packets and the exchange of various call signaling. The VoIP phone is connected to the gatekeeper on the local area network through an RJ45 plug.

Software Implementation

This implementation relies on a network protocol stack and a real-time operating system (RTOS). Most application systems require an RTOS to handle multiple processes and calls simultaneously. The RTOS used should have the following characteristics to meet the complexity of the communication protocol: small system kernel; short interrupt processing time; long continuous running time; and the processing capability of multiple millisecond or microsecond timers. ARM-mClinux is a very good embedded real-time operating system. It provides a variety of functions for real-time system development, debugging, and operation, such as multi-tasking mechanism, kernel scalability, network functions, real memory management strategy, etc. At the same time, the kernel source code of Linux is completely open, which is undoubtedly very beneficial to reducing development costs and improving the reuse of software development.

For the network protocol stack, this solution uses the standard H.323 protocol stack to interconnect with the public network. From the perspective of TCP/IP layering, H.323 is an application layer protocol family that includes protocols suitable for various media communications and signaling control, and is based on TCP or UDP protocols. According to the actual use requirements, the protocols discussed in this article include G.723.1, G.711, etc. in voice coding and H.225 and H.245 in call control signaling. Under the normal design capacity of the CPU, all processes in the system will be blocked in their respective message queues, and only the lowest IDLE process is in the running state, and the total number of messages in the message queue is at a relatively low level. Adding processes may increase the shared data area and internal messages, and correspondingly introduce complex management mechanisms. Based on the above software requirements, the VoIP phone should be able to communicate with the gateway and gatekeeper that conform to the H.323 standard, and realize the voice communication function between VoIP phones and VoIP phones and between VoIP phones and ordinary phones carried by the gateway. In addition, the VoIP phone should also have certain recording and playback capabilities.

For IP phones, the main software realizes the communication between the phone and the gatekeeper and the communication between phones. The call flow is shown in Figure 4.

The channel implementation mechanism of the above process is TCP or UDP. After the IP phone successfully logs in to the gatekeeper, its connection process is completely similar to the connection between ordinary phones. After picking up the phone, it sends a "call request" (udp) to the gatekeeper. After receiving it, the gatekeeper sends "whether to run the calling party dialing" (tcp). If it is not allowed, it prompts to hang up; if it is allowed, the caller starts dialing after receiving the dial tone, sends a "dial information" message (tcp) to the gatekeeper, and the gatekeeper sends a "called party idle information" message (tcp) to the caller, and then sends a ringing tone and a ringing tone to the caller and the called party respectively. After waiting for the called party to pick up the phone, the called party sends a "called party picks up the phone" message (udp) to the gatekeeper, and the gatekeeper sends a "stop ringing" (tcp) message to the called party. The gatekeeper sends a "called party picks up the phone" message (tcp) to the calling party, and enters the call (udp) state. The processing of voice involves the 220 voice processing module.

Messages sent by the gateway to the gatekeeper: Whether it is a login message sent by the high-level user end to the gatekeeper, or a call processing message sent by the IP phone or switch side to the gatekeeper, it will first be placed in a message queue named mqRecvBottom, and then sent to the following three queues according to the transmission method used by the message: TCP transmission of signaling_mqSendTCP; UDP transmission of signaling_mqSendUDP; voice transmission_mqSendData (can be forwarded by the gatekeeper or sent directly between two gateways), and then sent out through the socket.

Solution to several key issues

Pickup and hangup detection and dial number reception

AT75C220 provides several user-defined general I/O interfaces. Only through certain hardware connections and software programming, the detection of the on-hook and off-hook status and the reception of the user's dialed number can be realized.

Incoming call ringing

There is a bit in the internal register of AT75C220 that specifically indicates whether there is an incoming call. The application software periodically detects this bit. Once an incoming call is found, a ringing indication signal is immediately sent through a pre-programmed general I/O port. This signal can be used as an enable signal for the ringing circuit.

Voice processing module The

voice processing functions are all completed by ARM7TDMI controlling OakDSPCore.

When making an IP call, the 64Kbit/s PCM digital voice signal sent by the analog front-end circuit is compressed and sent to the network interface module; at the same time, the compressed voice signal sent by the network interface module is decompressed to form a 64Kbit/s PCM digital voice signal and sent to the analog front end.

Through the flexible programming of OakDSPCore, the VoIP phone can easily realize the recording and playback functions of voice messages.

When the user dials from the number dial, the DTMF signal generator function of OakDSPCore is started through programming to generate the corresponding dual-tone multi-frequency signal in the user's handset. If necessary, the DTMF signal can also be sent out after compression and encoding like a voice signal.

Voice compression and decompression adopt the G.723.1 algorithm. In order to perform effective speech compression, many important factors must be considered. First, when all channels are working, it must be ensured that there is no performance degradation. The data packet must be configurable to ensure maximum flexibility. In addition, the G.723.1 algorithm used in this project adopts voice activation detection technology. VAD technology is the basis of adaptive gain control, which can further realize bandwidth compression function and can be used together with adaptive noise generator. VAD technology enables the transmitter to detect the gap of local voice and no longer send complete voice frames during this period. Instead, it replaces it with a static insertion description frame with less bits. This frame only contains the parameters required to generate noise at the decoder input, so that the receiver can generate appropriate background noise based on this, so that the call effect is close to the real conditions and further reduce the coding rate. The determination of the VAD threshold value is a key factor in accurately judging voice/silence. For example, long-term continuous speech will increase the estimated value of background noise and the corresponding threshold, so that the low-amplitude speech that occurs immediately afterwards is not detected. One solution is to change the cutoff frequency of the low-pass filter when voice is detected, that is, different methods are used to estimate noise energy when voice/silence is present.

Voice quality

Network delay and jitter are key factors affecting voice quality. Packing is also an important factor affecting delay. The real-time nature of packing and the efficiency of packing are a contradiction. The amount of information gathered before packing is closely related to the bandwidth, and an appropriate threshold must be found. "Jitter" is a unique phenomenon of packet switching. The way to eliminate jitter is that the receiver uses a "jitter buffer" to compensate for the unreliability of the packet network. This buffer can be a dynamic queue. The receiver determines the network traffic status based on the RTP timestamp, so as to change the size of the buffer in a timely manner. In the specific implementation, a circular queue pointer table can be established to manage the occupied buffer area. If you want to implement it simply, you can set a fixed number of arrays, and then identify several flags for management and control. In addition, echo cancellation is also one of the important aspects. A good echo canceller should have a short convergence time and a small residual echo, reliably detect accents, and be able to handle background noise and narrowband signals. In this project, the G.165 algorithm in DSP is used to eliminate voice echo to the maximum extent.
Conclusion

As a new communication terminal product, LAN IP phone has a lot of room for development. At present, there are many sample forms, but the general trend is: simple hardware, high integration, good real-time and reliability of software, and support for multiple business types. The design proposed in this article has a good grasp of this trend. The device can not only maintain the operation process of traditional telephones for users, but also seamlessly connect with the wide area network, greatly reducing the communication cost and having strong practicality.

Reference address:Design of LAN IP Phone Based on ARM

Previous article:Design of Micro Inertial Measurement Device Based on ARM and MEMS Devices
Next article:Design of wireless home gateway based on ARM-Clinux

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号