Ee 549 Undergraduate Project Ii: "Voip To PSTN Converter"
Ee 549 Undergraduate Project Ii: "Voip To PSTN Converter"
E/04/332 E/04/337
CHAPTER 1 INTRODUCTION
1.1 BACKGROUND
Embedded system is an intelligent system that has the capability of processing, monitoring and controlling. It may comprise of Coders, Telephones, Microcontrollers, FPGA, ASIC, etc. It typically has a specialized function with programs stored on ROM. Examples of embedded systems are automatic environmental systems, security systems, and entertainment systems. An added feature in any embedded system is its ability to communicate. The communication can be via Bluetooth, WI-FI, GSM, or Ethernet cables. The TCP/IP protocol is a widely used standard for modern digital communication. The project we have undertaken is VoIP to PSTN Converter. It includes the three concepts we discussed earlier viz. embedded systems, UDP/IP communication, DTMF decoding and Pulse Code Modulation. It provides real time voice data to remote locations through a network.
1.2 OBJECTIVE
Main objective of our project is designing and fabricating a Voice over Internet Protocol (VoIP) to Public Switched Telephone Network (PSTN) converter. When a normal PSTN phone is connected to the Ethernet LAN through this convertor the phone will be identified as a standard SIP phone by a VOIP service provider such as a soft switch or an IP-PBX system. The PSTN phone will be detected automatically by the VoIP phone system. By using the phone keypad User will be able to dial other VoIP clients .The calling party and the connection status should be displayed on the display of the converter.
The PIC18F452 microcontroller is used to process data and the IIM7010A is used to connect the microcontroller to the LAN. User can dial the destination number using the push button number pad and the DTMF (Dual-Tone Multi frequency) signals coming out from the phone according to the pushed button are decoded by the CM8870 DTMF decoder. The microcontroller can identify the dialed number by the DTMF decoder output. The LCD displays necessary information such as dialed number, call duration in operating mode and system configuration data in configuration mode.
The PCM Codec IC TP3057B samples the analog voice encodes it and feed to microcontroller and decodes the sampled voice data into analog voice.
The encoded voice data is converted to VoIP using IIM7010A Ethernet controller and sends to destination. The converter is automatically detected by the soft switch configured in the computer network when it plugged.
IIM7010A Ethernet controller PIC18F452 microcontroller PCM Codec IC (TP3057B) DTMF Decoder (CM8870) 2W/4W Converter (MH88500) LCD (LMV202D)
Features
Hardware Internet protocols included: TCP, IP Ver.4, UDP, ICMP, ARP Hardware Ethernet protocols included: DLC, MAC Internal ICMP responds to PING commands Protocol processing speed: full-duplex 4~5 Mbps Intel/Motorola MCU bus Interface I2C Interface Internal 16Kbytes Dual-port SRAM for data buffer Wide operating voltage: 3.3V internal operation, 5V tolerant 3.3V IOs
b.
IP (Internet Protocol) The first software layer above the network drivers is IP and its partner
ICMP. Above these, there is a split: connection-oriented applications use transmission control protocol (TCP), whereas connectionless applications use user datagram protocol (UDP). An IP packet is known as a "datagram. IP is a protocol for routing packets through a network from origination to destination. A packet of data is equipped with an IP header, which contains information about the originator and the destination address. The data packet with the IP header is known as an IP datagram.
c.
TCP (Transmission Control Protocol) TCP is connection oriented and reliable protocol. TCP helps to do
several jobs at once. It initiates a connection between two nodes and sends data bi directionally between those two nodes. It handles the network failure, network datagram loss. It closes the connection between those two nodes as well.
d.
UDP (User Datagram Protocol) UDP is connectionless unreliable protocol. Unlike TCP, UDP provides
no acknowledgment functionality. Therefore, no guarantee exists that anything sent from an application that uses UDP will actually get to the desired destination.
Fig 2.2: UDP Header e. RTP (Real-Time Transport Protocol) It provides network transport services required for the support of realtime applications, such as voice and video. UDP does nothing in terms of avoiding packet loss or even ensuring ordered delivery. RTP, which operates on top of UDP, helps address some of these functions. For example, RTP packets include a sequence number, so that the application using RTP can at least detect the occurrence of lost packets and can ensure that received packets are presented to the user in the correct order. RTP packets also include a timestamp that corresponds to the time at which the packet was sampled from its source media stream. The destination application can use this time stamp to ensure synchronized play-out to the destination user and to calculate delay and jitter.
f.
SIP (Session Initiate Protocol) SIP is a signaling protocol that handles the setup, modification, and
teardown of multimedia sessions. SIP, in combination with other protocols, is used to describe the session characteristics to potential session participants. Although, SIP is written such that the media to be used in a given session could use any transport protocol, the media will commonly be exchanged using the Real-Time Transport Protocol (RTP) as the transport protocol.
1. It has high memory space. 2. It has built in AD Converter 3. It is developed using nanoWatt TECHNOLOGY that reduces power consumption during operation.
The PIC18F452 has 5-ports. They are A, B, C, D, E. Port A, B, C, D are of 8-bits in length but port E is of only 4-bits length. All these ports are in digital I/O besides A6 and A7. The oscillator is connected to these pins. The analog input pins are in A0,A1,A2,A3,A5,E0,E1,E2,B0,B1,B2,B3,B4. The serial port data to the computer is transmitted from C6 and received form C7. The serial data to the Ethernet chip is transmitted from C5 and received from C4. If pin no. 1 is set to low the data memory of microcontroller will be reset.
Features Operating frequency Program memory Temporary data memory(Ram) Permanent data memory(EEPROM) I/O Ports Serial communication
PIC 18F452 PIC18F452 DC up to 32MHz(HS PLL) 64kb 1536bytes 256bytes Ports A,B,C,D,E MSSP,USART 11
Table 2.1: Features of PIC18F452 There are three types of memory in PIC18 Enhanced microcontroller devices: Program Memory Data RAM Data EEPROM As Harvard architecture devices, the data and program memories use separate busses; this allows for concurrent access of the two memory spaces. The data EEPROM, for practical purposes, can be regarded as a peripheral device, since it is addressed and accessed through a set of control registers.
12
Features
Complete CODEC and filtering system including: o Transmit high-pass and low-pass filtering o Receive low-pass filter with sin x/x correction o Active RC noise filters o A-law compatible Coder and Decoder o Internal precision voltage reference o Serial I/O interface o Internal auto-zero circuitry 5V operation Low operating power - typically 50 mW Power-down standby mode - typically 3 mW
13
Description of MT8870
The MT8870 is a complete DTMF receiver integrating both the band split filter and digital decoder functions. The filter section uses switched capacitor techniques for high and low group filters; the decoder uses digital counting techniques to detect and decode all 16 DTMF tone pairs into a 4-bit code. External component count is minimized by on chip provision of a differential input amplifier, clock oscillator and latched threestate bus interface.
14
Features
Complete DTMF Receiver Low power consumption Internal gain setting amplifier Adjustable guard time
15
Four wires are used for longer distance trunks between Exchange Branches to isolate the transmitted and received signals, because repeaters (i.e. signal amplification) are usually required for long distances and to facilitate the transmission of both digital data and voice.
Description of MH88500
The Mitel MH88500 Subscriber Line Interface Circuit provides a complete interface between the telephone line and a speech switch requiring only single bidirectional switch per cross point. The functions provided by the MH88500 include bidirectional differential to single ended conversion in the speech path, line battery feed, ringing feed and loop and dial pulse detection. The device is fabricated as a thick film hybrid in a 20-pin single-in-line package allowing optimum circuit board packing density.
Features
Differential to single ended conversion No transformers required Minimum installation space Off-Hook detection and LED indicator drive Dial pulse detection Voltage surge protection
Calls are sent as data packets over the computer data network instead of via the traditional phone network. Phones share the network with computers and separate phone wiring can therefore be eliminated.
With the use of a VOIP gateway, you can connect existing phone lines to the IP PBX and make and receive phone calls via a regular PSTN line. The 3CX phone system uses standard SIP software or hardware phones, and provides internal call switching, as 17
well as outbound or inbound calling via the standard phone network or via a VOIP service.
Components of the C language such as comment definition, constants definition, variable definition, function declaration, operators usage, program control statements, arrays, strings, pointers, structures, and unions are similar to the ANSI C standards.
Some of the keywords used in the MCC18 language are shown in table.
_asm _endasm Auto Break Case Char Const Continue Default Do Double Return
Extern Far Float For Goto If Int Long Near Ram Volatile While
Short Signed Sizeof Static Struct Switch Typedef Union Unsigned Void Else Enum
The processor-specific library files contain definitions that may vary across individual members of the PIC18 family. This includes all of the peripheral routines and the Special Function Register (SFR) definitions. The peripheral routines that are provided include both those designed to use the hardware peripherals and those that implement a peripheral interface using general purpose I/O lines. The functions included in the 18
processor-specific libraries include Hardware Peripheral Functions and. Software Peripheral Library.
Advantages of C language in embedded systems: 1. It is easier to code and requires less effort. 2. It has many built in functions
Disadvantages of C language in embedded systems: 1. It occupies more memory space. 2. It is inconvenient for time critical applications.(We managed to solve this by
19
CHAPTER 3 METHODOLOGY
20
The MCC18 functions are designed to allow the control of a LMV202D LCD controller using I/O pins from a PIC18 microcontroller. The LCD could be used in 4 bit or 8 bit mode. We used the 8 bit mode and display the Phone number, configuration data such as IP, port numbers in configuration mode.
21
Fig 3.2: Interfacing Ethernet controller Circuit was designed using IIM7010A Ethernet controller, PIC18F452 as MCU and 3.3 V power supply which is designed using LM317.
22
Final design of VoIP to PSTN Converter is shown above. Normal PSTN phone is connected to Converter using RJ11 port. Then the phone is powered by power supply and ring generator. DTMF output of the PSTN phone is decoding using DTMF decoder circuit and fed to Microcontroller. For AD and DA conversion of voice, the 4W/2W converter separate receive and transmit signals. AD and DA conversion of voice is done by using PCMA codec circuit. Sample and quantized digital voice gives to microcontroller. Microcontroller sends that sampled voice data through the network to the destination VoIP client using IIM7010A Ethernet controller and received data is fed to PCM codec circuit for decoding.
24
Fig 3.6 Top Silk plate of the Converter Units We have used Eagle software for routing and optimizing the PCB design purposes.
25
26
The written Mikro-C code was compiled and program to Ethernet controller, which is configure to transfer the SIP and UDP packets to the Computer with 3CX VoIP server. Then sent and received packets were analyzed in a client computer using the Wireshark network analyzer software tool. The following shows the output.
Fig 3.8: Captured SIP packets using Wireshark software tool Power supply unit was designed to get +3.3, +5, -5 and +24 Volts, and supplying to Ethernet controller, all the ICs, Codec IC and PSTN phone respectively. Measured output voltages are within 0.05 V. The voltage levels of the each output pin of the DTMF receiver IC were measured when dial the push buttons in normal PSTN phone. The values were within +3.6V to 5.0V. The second stage of the testing was focused to the system compatibility and performance when adding all the units to the main control unit.
27
CHAPTER 4 PERORATION
28
1 Submit Project Proposal 2 Initial Literature Survey 3 Cost Estimation 4 Acquiring Components 5 Project Design & Simulation 6 Project Implementation 7 Testing 8 Error Handling 9 Develop a Finish Product
Item Computer Centre and LAB usage Component cost Cost of professionally skilled persons (Rs 250 Per hour) Cost of supervisor (Rs 2000 per hour) Total cost
Cost Rs. 31 500.00 Rs. 10 000.00 Rs.90 000.00 Rs. 28 000.00 Rs. 149 500.00
29
REFERENCES
1. 2. 3. 4. 5. 6. IIM 7010A Data Sheet W 3100 Data Sheet
Carrier Grade Voice over IP Second Edition - By Daniel Collins ITU-T Recommendation Q.23, Q.24 & Q.25 Series Data and Computer Communication (8th Edition) by William Stallings
Papers about Telephone ringing circuits and Telephone line audio interface
30