Anda di halaman 1dari 35

Interactive Voice Response System

1. INTRODUCTION

Embedded system is a system that lives inside an other device and act as a hardware
component of that device. An embedded system can be desirable once consisting of a
processor, associated peripherals and software used for a specific purpose. The embedded
system defined as the set of hardware controlled by software. Like any computing system
an embedded system is a combination of software and hardware.

1.1 Detailed Problem Definition

A data base is used for the purpose of data storage. It would contain the details of all the
students and details of their attendance. When a user makes a call to the IVRS phone
number, micro-controller would detect the ring and receive the call. When the user dials
the student’s registration number on his phone, it would be detected by the micro-
controller and sent to PC via serial port. PC would make a search depending on the
registration number, and his attendance details would be played as voice which will be
transmitted via the telephone line to the user.

Department of Computer Science, Christ University 1


Interactive Voice Response System

1.2 Block diagram

Telephone Line

Voltage
DTMF Decoder Converter

Ring Detector
Serial port
Micro
Controller PC
ON/OFF Hook
switch

PC Speaker

Department of Computer Science, Christ University 2


Interactive Voice Response System

2. ANALYSIS
2.1 System Architecture-Flow Chart

Department of Computer Science, Christ University 3


Interactive Voice Response System

2.2 Functional Specification

DTMF (Dual-tone multi-frequency) Decoder

Dual-tone multi-frequency signaling (DTMF) is used for telecommunication signaling


over analog telephone lines in the voice-frequency band between telephone handsets and
other communications devices and the switching center. These signals are given as input
to the DTMF decoder and it generates a 4 Bit output which varies from 00H to FFH. One
common DTMF Decoder IC is the MT8870 that is widely used in electronic
communications circuits.

Ring Detector

When the telephone is in on-hook state the voltage is at about 0v. Telephone company
sends a ringing signal which is an AC waveform. The voltage at the subscribers end
depends upon loop length and number of ringers attached to the line; it could be between
40 and 150 Volts. Ring detector circuit is the one which detects this voltage variation and
sends a signal to the micro-controller.

ON/OFF Hook switch

Hook switch is a switch on a telephone set that operates when the receiver is placed on
the hook or removed from it. In the circuit micro-controller will control the action of
receiving or disconnecting the call using this hook switch.

Micro-Controller

A microcontroller is a small computer on a single integrated circuit containing a


processor core, memory, programmable input/output peripherals. Program memory in the

Department of Computer Science, Christ University 4


Interactive Voice Response System

form of NOR flash is also often included on chip, as well as a typically small amount
of RAM. Microcontrollers are designed for embedded applications, in contrast to
the microprocessors used in personal computers or other general purpose applications.

Voltage Converter

Output of the micro-controller is a TTL voltage which has to be converted to serial port
compatible voltage. MAX232 is an integrated circuit that converts signals from an RS-
232 serial port to signals suitable for use in TTL compatible digital logic circuits or vice
versa. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS
and RTS signals.

Serial port
In computing, Serial port is a serial communication physical interface through which
information transfers in or out one bit at a time. RS-232 (Recommended Standard 232) is
a standard for serial binary single-ended data and control signals connecting between a
DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating Equipment)
which is used in serial port communication.

2.3 Requirement Specification

• Windows XP and later versions


• VB.NET
• My Sql
• Telephone
• Telephone Jack

Department of Computer Science, Christ University 5


Interactive Voice Response System

2.4 Estimation

Components Cost
Micro controller 250
DTMF decoder 200
opto coupler 100
Transistor 50
Female RS232 50
DPDT relay 75
CRYSTAL 50
Zener diode 50
Diode 50
Capacitor 50
Resistor 50
Bread board 90
Circuit board 80
IC Base 50
Lead 30
Flux 10
Soldering iron 200
Wires 50
Soldering Stand 75
USB to serial converter 200
TOTAL 1760

Department of Computer Science, Christ University 6


Interactive Voice Response System

3. SYSTEM DESIGN

3.1 Modular Specification

DTMF Decoder

This is the most important task for our project. As the number pressed by the caller is
needed to be decoded before sending it to the microcontroller, a DTMF decoder is
needed.

For our project, we have used DTMF decoder MT8870.Its features are :-
• Complete DTMF Receiver
• Low power consumption
• Internal gain setting amplifier
• Adjustable guard time
• Central office quality
o Power-down mode

Microcontroller

To achieve this task we first analyzed our needs. Those were..


• To achieve fast operation
• To achieve great sensitivity
So for these we decided to select microcontroller. As it is having sufficient amount of
RAM for such simple operations of reading. It supports high speed operation and has
greater sensitivity when put into scanning mode of its inputs.

Department of Computer Science, Christ University 7


Interactive Voice Response System

Relay

Relays available are HK, PLA, OEN and GOODSKY. These are the different
manufacturers of relays. Also, according to the DC voltages, relays available are 5V, 6V,
12V, 18V AND 24V. According to the type, relays available are SPST, DPDT and
SPDT.Also, relays can be PCB mountable and Panel mountable.

MAX 232

MAX 232 is used because we wanted to have serial communication between


microcontroller and computer. This supports short distance serial communication. we are
using MAX 232 in IC format due to ready made availability of this. Some capacitors
have to arrange along peripherals pins of this IC which we have connected in our actual
circuit. Need of these capacitors is due to fact that MAX 232 datasheet shows need of
such capacitors in order to pull data from one point to another point.

Department of Computer Science, Christ University 8


Interactive Voice Response System

3.2 Hardware Circuit Design

Department of Computer Science, Christ University 9


Interactive Voice Response System

3.3 Component Description

Micro-controller (AT89C2051)

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with


2K bytes of Flash programmable and erasable read-only memory (PEROM). The device
is manufactured using Atmel’s high-density nonvolatile memory technology and is
compatible with the industry-standard MCS-51 instruction set. By combining a versatile
8-bit CPU with Flash on a monolithic chip, the Atmel AT89C2051 is a powerful
microcomputer which provides a highly-flexible and cost-effective solution to many
embedded control applications.

The AT89C2051 provides the following standard features: 2K bytes of Flash, 128 bytes
of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt
architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator
and clock circuitry.

RS232 Connector

It is a standard for serial binary single-ended data and control signals connecting
between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating
Equipment). It is commonly used in computer serial ports. The standard defines the
electrical characteristics and timing of signals, the meaning of signals, and the physical
size and pin out of connectors.

DTMF Decoder (MT8870)

The MT8870 is a state of the art single chip DTMF receiver incorporating switched
capacitor filter technology and an advanced digital counting/averaging algorithm for

Department of Computer Science, Christ University 10


Interactive Voice Response System

period measurement. To aid design flexibility, the DTMF input signal is first buffered by
an input op-amp which allows adjustment of gain and choice of input configuration.

The input stage is followed by a low pass continuous RC active filter which performs an
anti-aliasing function. Dial tone at 350 and 440Hz is then rejected by a third order
switched capacitor notch filter. The signal, still in its composite form, is then split into its
individual high and low frequency components by two sixth order switched capacitor and
pass filters. Each component tone is then smoothed by an output filter and squared up by
a hard limiting comparator.

Optocoupler (MCT2E)

Optocoupler is an electronic device designed to transfer electrical signals by utilizing


light waves to provide coupling with electrical isolation between its input and output. The
main purpose of an optocoupler is to prevent high voltages or rapidly changing voltages
on one side of the circuit from damaging components or distorting transmissions on the
other side. An optocoupler contains a source (emitter) of light, almost always a near
infrared light-emitting diode (LED), that converts electrical input signal into light, a
closed optical channel , and a photosensor, which detects incoming light and either
generates electric energy directly, or modulates electric current flowing from an external
power supply.

Transistor

A transistor is a semiconductor device used to amplify and switch electronic signals. It is


made of a solid piece of semiconductor material, with at least three terminals for
connection to an external circuit. A voltage or current applied to one pair of the
transistor's terminals changes the current flowing through another pair of terminals.

Department of Computer Science, Christ University 11


Interactive Voice Response System

Because the controlled (output) power can be much more than the controlling (input)
power, the transistor provides amplification of a signal.

Diode

A diode is a two-terminal electronic component that conducts electric current in only one
direction. The most common function of a diode is to allow an electric current to pass in
one direction (called the diode's forward direction) while blocking current in the opposite
direction (the reverse direction).

Zener diode

A Zener diode is a type of diode that permits current not only in the forward direction
like a normal diode, but also in the reverse direction if the voltage is larger than the
breakdown voltage known as "Zener knee voltage" or "Zener voltage". A conventional
solid-state diode will not allow significant current if it is reverse-biased below its reverse
breakdown voltage. When the reverse bias breakdown voltage is exceeded, a
conventional diode is subject to high current due to avalanche breakdown. Unless this
current is limited by circuitry, the diode will be permanently damaged. In case of large
forward bias (current in the direction of the arrow), the diode exhibits a voltage drop due
to its junction built-in voltage and internal resistance. The amount of the voltage drop
depends on the semiconductor material and the doping concentrations.

A Zener diode exhibits almost the same properties, except the device is specially
designed so as to have a greatly reduced breakdown voltage, the so-called Zener voltage.
By contrast with the conventional device, a reverse-biased Zener diode will exhibit a
controlled breakdown and allow the current to keep the voltage across the Zener diode at
the Zener voltage.

Department of Computer Science, Christ University 12


Interactive Voice Response System

Relay

A relay is an electrically operated switch. Relays use an electromagnet to operate a


switching mechanism mechanically. Relays are used where it is necessary to control a
circuit by a low-power signal (with complete electrical isolation between control and
controlled circuits), or where several circuits must be controlled by one signal.

Crystal oscillator

A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance
of a vibrating crystal of piezoelectric material to create an electrical signal with a very
precise frequency. The most common type of piezoelectric resonator used is the quartz
crystal, so oscillator circuits designed around them became known as "crystal oscillators."
Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of
megahertz.

Resistors

A resistor is a two-terminal electronic component designed to oppose an electric current


by producing a voltage drop between its terminals in proportion to the current. The
primary characteristics of resistors are their resistance and the power they can dissipate.

Capacitors

A capacitor or condenser is a passive electronic component consisting of a pair of


conductors separated by a dielectric. An ideal capacitor is characterized by a single
constant value, capacitance. This is defined as the ratio of the amount of electric charge
in each conductor to the potential difference between them.

Department of Computer Science, Christ University 13


Interactive Voice Response System

3.4 Embedded Program Design

Algorithm

Step 1: Start the program


Step 2: Check whether ring signal is present or not.
Step 3: If ring signal is present, make telephone OFF HOOK and send FF to Personal
Computer, else go to STEP 2.
Step 4: Get the DTMF signal through the DTMF decoder.
Step 5: Check whether# is pressed or not. If# is pressed, then disconnect the phone and
go to STEP 2.
Step 6: If# is not pressed, then send the DTMF data to the pc through the serial port and
go to STEP 4.

Department of Computer Science, Christ University 14


Interactive Voice Response System

Flow Chart

Department of Computer Science, Christ University 15


Interactive Voice Response System

3.5 Interface Design

ATTENDANCE SYSTEM
REGISTER NUMBER
NAME
ATTENDANCE

3.6 Database Design

In the database, there is one table which holds the register number, name, total
attendance. When the microcontroller sends the register number to the PC it searches the
database for the register number, if found then the attendance would be transmitted in
voice by the PC.

REGISTER NUMBER NAME ATTENDANCE

3.7 Test Plan

Department of Computer Science, Christ University 16


Interactive Voice Response System

Fundamentals

Error refers to the difference between the actual output of software and the correct
output. It is also used to refer to human action those results in software containing a
defect or a fault. Fault is a condition causing the software to fail to perform its required
function. It is the basic reason for software malfunction and is synonymous with the word
‘bug’. Failure is the inability of a system or a component to perform a required function
according to its specifications. A software failure occurs if the behavior of the software is
different from the specified behavior. Failures may be caused due to functional as well as
performance reasons. A failure is produced only when there is a fault in the system. But a
fault does not always produce a failure.

The software reliability is the probability that the software will not undergo a failure
for a specified time under specified conditions. Reliability is basically the level of
confidence one can place in the software, and this level is dependent on time. Reliability
can also be defined in terms of MTTF which specifies the average time between the
occurrences of two failures. We put our system to tests which proved its reliability under
conditions specified in the SRS.

Levels of Testing

The basic levels are:


a) Unit Testing:
The different modules are tested against the specifications produced during design
for the modules, and verify the code produced during the coding phase.
b) Integration Testing:
Many tested modules are combined into subsystems and then tested.
c) System Testing:
The entire system is tested with the reference document being the SRS and the goal
being to meet its requirements. This is basically a validation exercise.
d) Acceptance Testing:

Department of Computer Science, Christ University 17


Interactive Voice Response System

It is for showing that the software is working satisfactorily with realistic data.

These different levels try to detect different types of faults. The different levels
are shown below.

User Needs Acceptance Testing

Requirements System Testing

Design Integration Testing

Code Unit Testing

Approaches for testing

There are two approaches for testing. They are:

i) Top-down approach
In top-down strategy, we start by testing the top of the hierarchy, add modules that
it calls & then the new combined system. This approach requires stubs to be written. A
stub is a dummy routine that simulates a module. To allow the modules to be tested
before their subordinates have actually been coded, stubs simulate the behavior of the
subordinates.

ii) Bottom-up Approach

Department of Computer Science, Christ University 18


Interactive Voice Response System

The bottom-up approach starts from the bottom of the hierarchy. First the modules
at the very bottom are tested. Then these modules are combined further with higher level
modules for testing. To perform bottom-up testing, drivers are needed, to set up the
appropriate environment & invoke the module. It is the job of the driver to invoke the
module under testing with different set of test cases.

Functional Testing:
In functional testing, the structure of the program is not considered. Test cases are
decided in the basis of the requirements of the program or module & the intervals of the
module are not considered for the selection of the test cases. Due to its nature, functional
testing is called “Black Box Testing”.

Structural Testing:
The intent of structural testing is not to exercise all the different input or output
conditions, but to exercise different programming & data structures used in the program.
For testing the structure of a program, structural testing aims to achieve test cases that
will force the desired coverage of different structures, to determine if the coverage is
sufficient, we have to define some coverage criteria “Glass Box Testing”.

Modules to be tested

1. Hardware part

a) DTMF Decoder : The number pressed by the caller is needed to be


decoded before sending it to the microcontroller, a DTMF decoder is
needed.
b) Optocoupler : To detect the ring signal.
c) Voltage Converter : To convert TTL to RS232.
d) Serial Port : To transfer data from the microcontroller to the PC.
e) Interfacing Circuit : To interface the audio signal from PC to
telephone.

2. Software part

The program written must also be tested, in order to get an efficient program
which can perform the required task.

Department of Computer Science, Christ University 19


Interactive Voice Response System

4. IMPLEMENTATION

4.1 Coding Standards

Programming style refers to a set of rules or guidelines used when writing the source
code for a computer program. It is often claimed that following a particular programming
style will help programmers quickly read and understand source code conforming to the
style as well as helping to avoid introducing faults.

A classic work on the subject was The Elements of Programming Style, written in the
1970s, and illustrated with examples from the Fortran and PL/I languages prevalent at the
time.

The programming style used in a particular program may be derived from the coding
standards or code conventions of a company or other computing organization, as well as
the preferences of the author of the code. Programming styles are often designed for a
specific programming language (or language family), but some rules are commonly
applied to many languages. (Style considered good in C source code may not be
appropriate for BASIC source code, and so on.)

Elements of good style

Good style, being a subjective matter, is difficult to concretely categorize; however, there
are several elements common to a large number of programming styles. The issues
usually considered as part of programming style include the layout of the source code,
including indentation; the use of white space around operators and keywords; the
capitalization or otherwise of keywords and variable names; the style and spelling of
user-defined identifiers, such as function, procedure and variable names; the use and style
of comments; and the use or avoidance of programming constructs themselves (such as
GOTO statements).

Department of Computer Science, Christ University 20


Interactive Voice Response System

Code appearance

Programming styles commonly deal with the appearance of source code, with the goal of
improving the readability of the program. However, with the advent of software that
formats source code automatically, the focus on appearance will likely yield to a greater
focus on naming, logic, and higher techniques. As a practical point, using a computer to
format source code saves time, and it is possible to then enforce company-wide standards
without debates.

4.2 Screen Shot

Department of Computer Science, Christ University 21


Interactive Voice Response System

4.3 Sample Source Code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.IO.Ports;

namespace SerialPortCommTest1
{
public partial class tester : Form
{
delegate void SetTextCallback(string text);

string regNo = "";

public tester()
{
InitializeComponent();
// Nice methods to browse all available ports:

string[] ports = SerialPort.GetPortNames();

// Add all port names to the combo box:

foreach (string port in ports)

Department of Computer Science, Christ University 22


Interactive Voice Response System

{
cmbComSelect.Items.Add(port);
}
}
private void tester_Load(object sender, EventArgs e)
{
}
private void cmbComSelect_SelectionChangeCommitted(object sender, EventArgs e)
{
if (port.IsOpen) port.Close();
port.PortName = cmbComSelect.SelectedItem.ToString();
// stsStatus.Text = port.PortName + ": 9600,8N1";
// try to open the selected port:
try
{
port.Open();
}
// give a message, if the port is not available:
catch
{
MessageBox.Show("Serial port " + port.PortName + " cannot be opened!",
"RS232 tester", MessageBoxButtons.OK, MessageBoxIcon.Warning);
cmbComSelect.SelectedText = "";
//stsStatus.Text = "Select serial port!";
}
}
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
string dataFromSerialPort = port.ReadExisting();
if (dataFromSerialPort == "A")
{

Department of Computer Science, Christ University 23


Interactive Voice Response System

winMediaPlayer.URL = Application.StartupPath +
@"\Voice\welcome_to_christ_uni.mp3";
}
else if (dataFromSerialPort == "#")
{
winMediaPlayer.URL = Application.StartupPath +
@"\Voice\thanks_for_calling.mp3";
}
else //if( (Convert.ToInt16(dataFromSerialPort) >=0) &&
(Convert.ToInt16(dataFromSerialPort) <=9) )
{
// wat you have to do is
// get digits one by one
// check if the length is 7.
// if there is a time out of say 5 seconds then play reenter..
// if u get 7 digits then check database and play voice
regNo = regNo + dataFromSerialPort;
//timerForRegNoTimeOut.Start();
// check if length is less than 7..
if (regNo.Length < 7)
{
//MessageBox.Show("size chikdu");
//timerForRegNoTimeOut.Stop();
//timerForRegNoTimeOut.Start();
}
else // if length is 7 stop the clock and do the processing
{
//MessageBox.Show(regNo);
SetText("\n");
SetText(regNo);

Department of Computer Science, Christ University 24


Interactive Voice Response System

string sql = "select attendance from attendancesystem.details where


regnum="+regNo+";";
string dataFromSql = ConnectToDb.getSingleDataFromRow(sql);
//MessageBox.Show(dataFromSql);
if (dataFromSql =="")
{
winMediaPlayer.URL = Application.StartupPath +
@"\Voice\invalid_re_enter.mp3";
//textBox1.Text = "Invalid Registration Number";
SetText("Invalid Registration Number");
string toWriteInLog = "Invalid Reg No "+regNo+" was entered";
maintainLog.writeInvalidNumbLog(toWriteInLog);
regNo = "";
}
else
{
string toWriteInLog = "Details of Reg No " + regNo + " enqueried";
maintainLog.writeEnquiredNumbLog(toWriteInLog);
winMediaPlayer.URL = Application.StartupPath +
@"\voice\your_attendance_is.mp3";
delay(1.75f);
playVoice(dataFromSql);
delay(1.5f);
winMediaPlayer.URL = Application.StartupPath +
@"\voice\percentage.mp3";
}
//MessageBox.Show(regNo);
//timerForRegNoTimeOut.Stop();
}
// comment this after testing
// get data from database and call the play function

Department of Computer Science, Christ University 25


Interactive Voice Response System

}
}
private void SetText(string text)
{
// InvokeRequired required compares the thread ID of the
// calling thread to the thread ID of the creating thread.
// If these threads are different, it returns true.
if (this.textBox1.InvokeRequired)
{
//this.textBox1.Clear();
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
else
{
this.textBox1.Clear();
this.textBox1.Text += text;
}
}
private void timerForRegNoTimeOut_Tick(object sender, EventArgs e)
{
//MessageBox.Show("5 sec aytu");
winMediaPlayer.URL = Application.StartupPath +
@"\Voice\no_data_re_enter.mp3";
regNo = ""
}
private void playVoice(string data)
{
//winMediaPlayer.play
try
{

Department of Computer Science, Christ University 26


Interactive Voice Response System

winMediaPlayer.settings.volume = 100;
//if (int.Parse(data) >= 20)
//{
if (int.Parse(data) == 1)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\one.wav";
// winMediaPlayer.URL =
//MessageBox.Show("jai");
//Application.StartupPath
}
else if (int.Parse(data) == 2)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\two.wav";
}
else if (int.Parse(data) == 3)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\three.wav";
}
else if (int.Parse(data) == 4)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\four.wav";
}
else if (int.Parse(data) == 5)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\five.wav";
}
else if (int.Parse(data) == 6)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\six.wav";
}
else if (int.Parse(data) == 7)

Department of Computer Science, Christ University 27


Interactive Voice Response System

{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\seven.wav";
}
else if (int.Parse(data) == 8)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\eight.wav";
}
else if (int.Parse(data) == 9)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\nine.wav";
}
else if (int.Parse(data) == 10)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\ten.wav";
}
else if (int.Parse(data) == 11)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\eleven.wav";
}
else if (int.Parse(data) == 12)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\twelve.wav";
}
else if (int.Parse(data) == 13)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\thirteen.wav";
}
else if (int.Parse(data) == 14)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\fourteen.wav";
}

Department of Computer Science, Christ University 28


Interactive Voice Response System

else if (int.Parse(data) == 15)


{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\fifteen.wav";
}
else if (int.Parse(data) == 16)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\sixteen.wav";
}
else if (int.Parse(data) == 17)
{
winMediaPlayer.URL = Application.StartupPath +
@"\Voice\seventeen.wav";
}
else if (int.Parse(data) == 18)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\eighteen.wav";
}
else if (int.Parse(data) == 19)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\nineteen.wav";
}
else if (int.Parse(data) == 20)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\twenty.wav";
}
else if (int.Parse(data) == 30)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\thirty.wav";
// winMediaPlayer.URL =
//MessageBox.Show("jai");
}

Department of Computer Science, Christ University 29


Interactive Voice Response System

else if (int.Parse(data) == 40)


{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\fourty.wav";
}
else if (int.Parse(data) == 50)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\fifty.wav";
}
else if (int.Parse(data) == 60)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\sixty.wav";
}
else if (int.Parse(data) == 70)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\seventy.wav";
}
else if (int.Parse(data) == 80)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\eighty.wav";
}
else if (int.Parse(data) == 90)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\ninty.wav";
}
else if (int.Parse(data) == 100)
{
winMediaPlayer.URL = Application.StartupPath + @"\Voice\hundred.wav";
}
else
{
int CompleteNumber = int.Parse(data);

Department of Computer Science, Christ University 30


Interactive Voice Response System

int unitPlace = CompleteNumber % 10;


int tenPlace = CompleteNumber - unitPlace;
playVoice(tenPlace.ToString());
//MessageBox.Show(winMediaPlayer.playState.ToString());
//timer1.Start();
delay();
//MessageBox.Show(tenPlace.ToString());
//winMediaPlayer.URL = Application.StartupPath + @"\Voice\blank.wmv";
//MessageBox.Show(unitPlace.ToString());
playVoice(unitPlace.ToString());
}
regNo = "";
}
catch (Exception ex)
{
regNo = "";
MessageBox.Show("invalid");
}
}
private void delay()
{
DateTime dt1 = DateTime.Now;
float diff = 0;
while (diff < 1.5)
{
DateTime dt2 = DateTime.Now;
TimeSpan ts = dt2.Subtract(dt1);
diff = (int)ts.TotalSeconds;
Application.DoEvents();
}
}

Department of Computer Science, Christ University 31


Interactive Voice Response System

private void delay(float value)


{
DateTime dt1 = DateTime.Now;
float diff = 0;
while (diff < value)
{
DateTime dt2 = DateTime.Now;
TimeSpan ts = dt2.Subtract(dt1);
diff = (int)ts.TotalSeconds;
Application.DoEvents();
}
}
}
}

Department of Computer Science, Christ University 32


Interactive Voice Response System

5. TESTING

5.1 Test Cases

Testing is done for both the Hardware and Software part. First we checked whether the
connections made in all circuits are correct.

After testing the circuit manually, it was time to check the circuit using the software.
While testing with software we checked whether the data sent to the computer or received
by the computer to the hardware is correct or not. We also checked whether the data send
by the computer to the hardware was the desired one.

5.2 Test Reports

Department of Computer Science, Christ University 33


Interactive Voice Response System

6. CONCLUSION

Embedded system plays a major role in advanced communication system. Embedded


system is the current technology and has a bright future. Any real time apply can be
controlled . Our project will be very obliging to the parents to be acquainted with their
son’s /daughter’s recital in the college . Presentation in the class and out come of the
university are made reachable to the parents by our project. Moreover, the time spending
for college officials in attempting phone calls from outsiders will be reduced .

We have successfully executed our project “Interactive Voice Response System for
College Attendance System” by using our college telephone line .

6.1 Advantages and Disadvantages

Advantages
• Save time and money – answering the phone calls takes a lot of time.
• Available 24 hours a day to field register number and get the attendance
percentage.

Disadvantages

• Many people dislike talking to machines.

6.2Future Works

• Our project should be modified to know the profile and marks of the student
• Access the college database for the execution of our project .

Department of Computer Science, Christ University 34


Interactive Voice Response System

7. BIBLIOGRAPHY
BOOKS

1. Thiagarajan Vishwanathan/Telecommunication Switching System & Networks /


India PRI Pvt.ltd/Second Edition.
2. Kenneth J.Ayala/The 8051 Microcontroller Architecture ,Programming and
Applications /India/PRI Pvt.ltd/Second Edition.
3. Douglas V.Hall/Microcontroller and Interfacing/New York/TMH Publishing
Company Pvt Ltd/Second Edition.

WEBSITES

• http://en.wikipedia.org/wiki/Interactive_voice_response
• http://web.cmc.net.in/products/ivrs/ivrs.asp
• http://www.blissit.org/ivrs.htm
• http://www.kleward.com/ivr_solutions.htm
• http://en.wikipedia.org/wiki/Special:Search?search=information+on+IVR+system

Department of Computer Science, Christ University 35