Chapter 8: Creating the Auto Answering Machine Application


 Download CD Content

The Java API provides the javax.speech, javax.speech.synthesis, javax.telephony, and javax.telephony.media packages to develop an interactive voice response system application, which helps end users to auto-reply to the calls received.

This chapter describes how to use the Java Speech API with Java Telephony API (JTAPI) to develop the Auto Answering Machine application. The Auto Answering Machine application uses a telephone line to reply to a call. The telephone line is connected to a modem. The application checks the status of a call and reads out a welcome message to answer the call.

Architecture of the Auto Answering Machine Application

The Auto Answering Machine application provides an interface that allows end users to select a modem from the list of providers installed on the computer. The modem is connected to a telephone line. The application establishes a connection with the modem and listens for a call.

The Auto Answering Machine application uses the following files:

  • AutoAnswerGUI.java: Allows you to select the provider to establish a modem connection and listens for a call.

  • AutoAnswerObserver.java: Checks the status of the incoming call. If the status is RINGING, the AutoAnswerObserver class answers the incoming call by changing the status to ACTIVE. If the status is ACTIVE, the AutoAnswerObserver class reads out a welcome message.

  • AnswerText.java: Reads out a welcome message to the receiver.

Figure 8-1 shows the architecture of the Auto Answering Machine application:

this figure shows the files that the auto answering machine application uses and the sequence in which the application uses them.
Figure 8-1: Architecture of the Auto Answering Machine Application

The AutoAnswerGUI.java file provides the main user interface that contains the combo box to select the provider to establish a connection with the modem. The user interface also contains two buttons , Start Service and Exit.

The Select the Provider combo box allows end users to select the provider to establish a connection with the modem. Click the Start Service button to start the Auto Answering Machine application.

The AutoAnswerGUI.java file calls the AutoAnswerObserver.java file when a call is made and checks the status of the call. The AutoAnswerObserver.java file also reads out a welcome message if the status of the call is ACTIVE.

The AutoAnswerGUI.java class calls the AnswerText.java class to read out a welcome message to the caller.




Java InstantCode. Developing Applications using Java Speech API
Java InstantCode. Developing Applications using Java Speech API
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 46

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net