Home > Store

Essential JTAPI

Register your product to gain access to bonus material or receive a coupon.

Essential JTAPI

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 1999
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-080360-X
  • ISBN-13: 978-0-13-080360-3


8036K-7

Build industrial-strength telephony applications on industry-standard platforms!

With the Java Telephony API (JTAPI), telecom vendors and service providers can leverage the full power of Java to build next-generation applications on virtually any hardware and software platform. Essential JTAPI is the first nuts-and-bolts, task-oriented tutorial and reference for getting results with JTAPI fast-regardless of your level of telephony applications experience.

Telephony development consultant Spencer Roberts introduces the JTAPI architecture, showing how JTAPI cooperating classes and core packages can serve as call models for building virtually any telephony application. You'll review JTAPI's object model, modular components, and class hierarchy-and discover how these can be used to construct advanced telephony applications with carrier-class reliability.

Roberts walks you step-by-step through building real-world telephony applications and Win32-JTAPI bindings. You'll learn how to use JTAPI extension packages for call control, media, private data, and more. Roberts shows you how to sidestep the key pitfalls of JTAPI development, optimize JTAPI performance in real-world applications, and much more. Essential JTAPI delivers:

  • Complete lifecycle coverage: planning, architecture, implementation, and more.
  • Extensive sample code, thoroughly explained.
  • High-performance Windows telephony techniques using J/Direct and Microsoft's SDK for Java 2.0.
  • Implementing asynchronous notification using threads, events, and callbacks in Java.
  • No-punches-pulled coverage of when NOT to use Java.

Sample Content

Downloadable Sample Chapter

Click here for a sample chapter for this book: 013080360X.pdf

Table of Contents

I. TELECOM PROGRAMMING.

1. An Overview of Computer Telephony.

Telecom Fundamentals. The Telephony Problem Space. JTAPI to the Rescue. Telephony Implementations. Telephony Support in Hardware. Remote Communication. Telephony Configurations. Data Transport Protocols. Telephony Protocols. Summary.

2. Telephony Bus Architectures.

Bus Architectures. Telephony Bus Architectures. The Espresso Approach. Trans-Bus Communication. Summary.

II. TELEPHONY APIS.

3. Java's Suitability to Telecom Programming.

Toys and Tools of the Trade. Selecting a Programming Language. Smalltalk. Ada. C/C++. Java. Why Java for Telecom? Packages. Interfaces. Java's Thread Model. Portability. The Reflection API. Java Event Management Models. Remote Method Interface (RMI). Native Methods. Why Not Java for Telecom? Garbage Collection. Performance. Summary.

4. A Close Look at JTAPI.

JTAPI — Sun's Java Telephony Application Programming Interface. The Java Standard Extension APIs. The JTAPI Specification. JTAPI Architecture. JTAPI Security. JTAPI Package Hierarchy. JTAPI — A Modular API. JTAPI Packages. JTAPI Interface Specification Practice. JTAPI Core Components. Observable Core Telephony Interfaces. Observer Core Telephony Interfaces. Peer Core Telephony Interfaces and Classes. JTAPI Capabilities. Static and Dynamic Capabilities. JTAPI — An Object-Oriented API? Implementing JTAPI Using Extension. A Possible Object Diagram for javax.telephony. Implementing JTAPI Using Linked Interfaces. A Small Soapbox. JTAPI — An Event-Driven API. JTAPI Events. States, Events, and State Transitions. JTAPI Core Events. Is a Connection Event a Call Event? JTAPI — An Exception-Aware API. JTAPI Exceptions. Summary.

III. IMPLEMENTING JTAPI.

5. Telephony API Overview.

What Is a Standard API? Why Use Standard APIs? The Problem with Standards. The Benefits of Standards Compliance. Design Requirements for an API. General API Requirements. Telephony-Specific API Requirements. A Survey of the Leading Telephony APIs. Enterprise Computing Telephony Forum APIs. Novell and AT&T's Telephony Services Application Programming Interface. A Dialogic Application Programming Interface. Microsoft's Telephony Application Programming Interface. Does JTAPI Measure Up? JTAPI and General API Requirements. JTAPI and Telecom-Specific API Requirements. Summary.

6. Construction of a JTAPI Library.

A Library Design Methodology. Deciding Upon a Design Approach. JTAPI Library Architectural Components. The Infrastructure Layer. The API Layer. Summary.

IV. TELEPHONY PROGRAMMING WITH JTAPI.

7. Application Programming with JTAPI.

Hello World in JTAPI. Implementing the Observer Interfaces. Revisiting the Phone Dialer Application with JTAPI-Lite. Running the Application. Glitches. Summary.

8. Standard Extensions to the Core Package.

Call Control Packages. Call Control Core Components. CallControlAddress. CallControlCall. CallControlConnection. CallControlTerminal. CallControlTerminalConnection. The Call Control Observer Interfaces. CallControlAddressObserver. CallControlCallObserver. CallControlTerminalObserver. Call Control Events. Call Control Capabilities. Phone Packages. Phone Core Components. PhoneTerminalObserver. Component. Component Group. PhoneTerminal. PhoneButton. PhoneDisplay. PhoneGraphicDisplay. PhoneHookswitch. PhoneLamp. PhoneMicrophone. PhoneRinger. PhoneSpeaker. Phone Capabilities. ComponentCapabilities. ComponentGroupCapabilities. Phone Events. Media Packages. Media Core Components. Media Events. Call Center Packages. Call Center Core Components. Call Center Capabilities. Call Center Events. Private Data Packages. Private Data Core Components. Private Data Events. Private Data Capabilites. Summary.

V. REAL WORLD TELEPHONY PROGRAMMING.

9. Event Management in Java.

Event Management in a Nutshell. A Brief Illustration. A Set of Event Management Model Design Requirements. Dependency — The Java Observation Model. Understanding the Observation Model. Implementing the Observation Model. Swallowing the Pill. Requirements Satisfaction Using the Observation Model. Delegation — The Java Event Model. Understanding the Delegation Model. Trouble on the Horizon. An Important Bunny Trail — True Events. The Smalltalk Event Mechanism. The Java Event Mechanism. Requirements Satisfaction Using the Delegation Model. Morphing the Delegation Model into the Observation Model. Requirements Satisfaction Using Morphed Delegation. Enhancing the Observation Model. Asynchronous Notification. A Java Message Management Idiom. Understanding the Message Management Model. Implementing the Message Management Model. Asynchronizing the Message Management Model. Is it Soup Yet? The CORBA Event Services. Event Management in a Bombshell. Summary.

10. Idioms and Patterns in Telephony.

Idioms. Idioms in Java. Patterns. Java Component Patterns Useful in Telephony. Server Telephone Patterns. Implementing Persistent Graph Structures. Summary.

11. Organizing a Large-Scale Telecom Development Project.

Project Management in a Nutshell. Requirements, Architecture, and Fabrication: The RAF Project Management Model. Requirements Discovery. Product Development. Documentation Requirements. A Programmer's Perspective. Distributed Programming. Application, Library, and Systems Programming. Planning a Telecom Project. Summary.

VI. FUTURE TELEPHONY PROGRAMMING IN JAVA.

12. Alternative Java Telephony Environments.

Java and Consumer Devices. The Web Phone and Other Consumer Devices. Putting the Pedal to the Metal. Where Does JTAPI Fit In? Alternative Java Execution and Development Environments. PersonalJava. EmbeddedJava. Java Sits on Top. Java and IP Telephony. Who's Afraid of IP — and Why? How IP Telephony Works. Where JTAPI Plugs into IP Telephony.

Appendix A: TAPI Source Code.
Index.

Preface

Preface

Background

Telephony/telecom programming is essentially the practice of programming telephone services and integrating telecom devices with a computer. It is also known as Computer Telephony Integration (CTI) and other such terms. This application discipline encompasses everything from simple modem processing to the management of complex call routing strategies and switching systems used by the big carriers. Telecom programming involves using the largest distributed networks throughout the world.

By this definition, the major phone companies have been involved in telephony programming since their inception. For the workstation and midrange programmer, however, telephony programming has only recently moved from somewhat of a black art to more of a mainstream software engineering field. This has occurred as telephone service providers compete to deliver customized desktop systems to their clients. The phenomenal growth of the Internet in the 1990s has blurred the distinction among many of these types of services. This trend is likely to continue into the foreseeable future.

This book is about telephony programming. It is also about Application Programming Interfaces (APIs). APIs facilitate the development of robust software. As platforms, operating systems, and even programming languages converge, the requirement for universal vertical market APIs grows. To answer this perceived demand, a handful of companies have stepped up to the plate to offer their telephony API sets as potential de facto standards to the industry at large. Most notably, Microsoft Corporation, the ECTF, and Sun Microsystems have developed API sets and standards for the vertical telephony market. There are other players, but these three dominate the field.

Lastly (and probably most significantly), this book is about identifying and solving advanced programming issues that come up in a typical telephony environment, particularly using the telephony extensions of the Java programming language. This book is about the Java Telephony Application Programming Interface (JTAPI).

Overview

This is not a book championing a particular programming language or product over any other. Rather, it is written to address practical programming issues that arise in the design and construction of large and small telecom programs using Java. Its primary focus is to provide detailed coverage of implementing telephony applications using JTAPI, version 1.2. Along the way, related topics, and complementary and competing APIs are addressed and contrasted in an effort to aid the programmer in better understanding JTAPI. We actually implement a subset of a JTAPI telephony library. The techniques used here may be helpful to programmers implementing Java extension packages on Windows platforms.

What is JTAPI? JTAPI (Java Telephony Application Programming Interface) is Sun's telephony API implemented in the Java programming language. It is designed to ease platform-independent telephony software development. To this end, it is largely successful from the perspective of the application programmer. To the library programmers of the world, it presents much opportunity for employment! The first version of the JTAPI specification was released to the public on November 1, 1996. The updated specification, version 1.1, was released on February 1, 1997. The latest version 1.2 was released in October 1997. Further revisions are expected. However, they are not expected to change dramatically.

Why focus on JTAPI? There are three compelling reasons in no particular order. First, JTAPI is implemented in Java. Java is a modern object- oriented programming language that allows for the creation of quality software components. In addition, it provides for the development of platform-independent implementations and is designed to operate with software written in other programming languages, which is necessary in a telephony environment. Second, JTAPI is an API written for a vertical market. Standard software written for vertical markets hold the promise of software reuse and commonality not previously achieved. Third, the API itself is extremely well designed for the most part. Included are specifications for entities intuitively obvious in the telephony problem space. Therefore, telephony programming can be simplified if these standardized domain objects are used.

Approach

This is a different kind of programming book because JTAPI is a different kind of API. We approach the subject matter from a programmer's perspective as opposed to that of a "telephony expert's." We make every attempt to simplify complex (necessary, yet conceptually insignificant) details into common software abstractions. We agree with the approach taken by Sun Microsystems and others before them — that large segments of vertical markets can and should be modeled with standard software libraries that can be reused by large segments of the programming population.1 We believe that telephony is a vertical market to be conquered by programmers. Although it is often presented that way, there is nothing inherent in a telephony solution that cannot or should not be expressed purely in software terms (as opposed to proprietary hardware, such as many PBX systems). We advocate the conversion of telephony systems from proprietary hardware to open software.

First, the book describes basic telephony programming by determining a set of fundamental services required of telephony applications. Standard telephony configurations are presented. It also covers general criteria for evaluating the suitability of any API and the ensuing design/usability tradeoffs. The Java language is explored and compared to other suitable programming languages in an effort to aid the reader in determining if Java is a practical alternative for them to more traditional telephony programming approaches.

Second, this book describes existing telephony API sets, particularly Microsoft's TAPI. Microsoft's Windows NT is fast becoming the telephony platform of choice and the TAPI API is the industry standard for that platform. This "bunny trail" is a necessary prerequisite to discussing JTAPI in depth because JTAPI is designed so it may be implemented "on top of" TAPI, among other API sets.

Third, this book explores the JTAPI architecture in some detail and how well it satisfies typical telephony programming requirements. Telephony programming is currently a specialized field generally relying on homegrown code solutions, but Java can change all that for applications not requiring the speed of a compiled language. JTAPI vastly simplifies telephony programming by providing a protocol that is much simpler than most competing APIs. It also provides some level of portability in the form of a platform-neutral API. There are drawbacks in that Java itself is interpreted; not to mention that JTAPI is usually layered upon TAPI on Windows platforms; other APIs on other platforms. And so, for some types of telephony applications, the Java approach may not be suitable due to performance considerations as well as nondeterministic garbage collection. But for the vast majority of applications, it will likely suffice, especially as both client and server-side processing power increases by orders of magnitude in shorter periods of time.

The portion of this book dealing with JTAPI is designed to be a companion to the online documentation provided by Sun Microsystems, not a copy of it. The Sun documentation is not required; this book is all that is necessary to gain a working and complete knowledge of JTAPI. However, Sun Microsystems has done an outstanding job documenting both the API and the design concepts behind the JTAPI architecture. And so this documentation is a nice complement to the book. However, we believe the background information and analysis as provided herein are still necessary for most programmers in order to properly understand how to make effective use of the product. If you are near a terminal, put down this book right now and download the JTAPI documentation and the specification itself from http://www.javasoft.com. Run a site search on the keyword "JTAPI" or "Java Media APIs" and follow the directions.

Fourth, a portion of this book describes what we are calling "real world" telephony programming issues. Although JTAPI makes code more understandable and simpler to use and maintain, it is designed using fairly advanced programming techniques and idioms. Although coding is easier once the API is understood, the learning curve may be a bit steep for those unfamiliar with advanced object-oriented design techniques. This excursion leads into both fundamental and advanced design topics and a thorough discussion of modern software engineering architectures. We even throw in some practical project management techniques tailored to telecom projects. This book is intended as a design guide as well as a practical reference for more advanced programming using Java and JTAPI.

Content

This book is organized in six principal parts:

  • Part I — Telecom Programming
  • Part II — Telephony APIs
  • Part III — Implementing JTAPI
  • Part IV — Telephony Programming with JTAPI
  • Part V — Real World Telephony Programming
  • Part VI — Future Telephony Programming in Java

Part I introduces telecom programming. Chapter 1 covers fundamental aspects of telephony processing environments, industry terminology, and provides an overview of the most popular API sets. We introduce JTAPI, the extension package to the Java programming language, developed by Sun Microsystems. In Chapter 2, we look at one important aspect of what distinguishes telecom programming from other types — namely, the hardware that programs control. Fundamental to how this hardware operates is an understanding of bus architectures.

Part II contains Chapters 3 and 4. Here, we provide an examination of the Java programming language. Issues surrounding the use of Java are explored as they pertain to telephony programming. Chapter 4 is an in-depth coverage of JTAPI. Featured is an exhaustive analysis of the JTAPI API, including sample code and the complete software definition of the core packages.

In Part III, we look at what it takes to create a JTAPI library. Although most implementations will leverage existing platform APIs such as TAPI, JTAPI is equally suitable for native implementations. In Chapter 5, we examine the importance of APIs; first in general, and then as they pertain to telecom programming. A few simple telephony applications are created using Microsoft's TAPI API. In Chapter 6, an approach to providing a Win32-JTAPI binding is presented and a partial JTAPI implementation is produced.

In Part IV, we finally begin application programming in JTAPI. We use the library we created in Chapter 6 to produce a simple JTAPI application in Chapter 7. Chapter 8 introduces the remaining packages provided with JTAPI — namely, the subpackages that are to provide capability beyond the core functionality of placing and receiving calls.

Part V covers real world telephony programming. In Chapter 9, we take an excursion into an area that is critical to providing a JTAPI implementation — the production of message management models. These models are used for providing registration and subsequent asynchronous notification of events. Chapter 10 draws on Doug Martin's extensive experience in the telephony field coupled with Spencer's application of some of these idioms and patterns in Java. Implementing a specification is not always as straightforward as understanding one. And so this section deals with these kinds of issues. In Chapter 11, we approach project life cycle and management issues as they relate to a typical telephony project and present a telecom design methodology.

Part VI, the final section, covers future telephony programming in Java. Chapter 12 provides a brief examination of related API sets as proposed for Java as standard extension packages. It discusses how these APIs may be used to complement and extend the use of JTAPI for consumer devices such as Web phones.

Audience

The primary audience for this book is experienced programmers familiar with object-oriented design concepts and programming languages. Some telephony background is helpful, but not required. However, the focus is on advanced Java programming and telephony programming issues. What we mean by advanced is that the material is not advanced in the sense that low-level telephony programming is advanced. We do not delve into programming RS-232 interfaces and UARTs; that is great advanced material but is not the focus of this book. Nor do we delve much into the complexity resulting from nonstandard Computer Telephony Integration (CTI) product integration efforts (this seems to be the focus of most computer-telephony books). Instead, the material is advanced in three other senses.

First, we do not cover general telephony programming concepts except in a cursory sense in Chapters 1 and 2. Second, no fundamental programming material is presented. It is assumed that the reader is proficient with Windows programming as well as the C/C++ and Java programming languages. Discussions about the Java programming language focus on its strengths and weaknesses as a telephony programming and design language as well as those features of the language that may be capitalized on to gain maximum benefit in a telephony environment. Third, the material goes beyond programming into design concepts, which may be foreign to those not formally trained in software methodologies. In this sense, readers with exposure to operating system concepts and data modeling probably will not find the material challenging; but we hope to hold their interest as we apply it to the subject matter.

About the Author

This book is born of a collaboration between two programmers — one a contract application programmer and mentor (Spencer Roberts), and the other a domain expert telephony programmer and architect (Doug Martin).

Spencer Roberts aced his first computer class in 1976 at the University of California at San Diego, California in UCSD Pascal, FORTRAN, and COBOL with the help of a very smart friend, Charles Dahms. (Chuck, wherever you are, thanks.) He later went on to obtain a bachelor's degree in economics there, and a master's degree in software engineering with distinction at National University in San Diego. Mr. Roberts has been programming professionally since 1985 and is president of Titus Corporation, a freelance contract programming and consulting firm. He has worked with a wide range of both DoD and commercial systems ranging from engineering applications to business systems, C3 satellite systems, telecom systems, and medical systems. Mr. Roberts specializes in the design and construction of object-oriented distributed systems and concurrent programming in multiple languages with companies like MCI, ICS, and Micromedex. He may be reached at spencer.roberts@titusoft.com or through Prentice-Hall.

Although not an official author of this book, Doug Martin provided extensive input and feedback to the book. Without Doug's help, we never would have taken on the task! Doug earned a bachelor of science degree at the University of Colorado and a master's degree in computer science from the CIBAR Systems Institute. He is the chief technical officer and a principal of Interactive Communication Systems (ICS), Inc. Mr. Martin has been the primary system architect for some 50 different computer telephony systems developed by ICS. Prior to joining ICS, Mr. Martin held senior development engineering positions at TRW, where he developed applications and system software for command, control, communications, and intelligence systems used in major Air Force intelligence centers. He may be reached at dmartin@icstelephony.com.

The Essential JTAPI FTP Site

Source code for all of the examples in the book are available from the Prentice Hall ftp site, ftp.prenhall.com. This site is accessible via anonymous ftp.

A single ZIP file named examples.zip contains the source code for all of the examples in the book. After logging in, change directories to the essential_jtapi directory as described below and download examples.zip to your hard drive.

cd /pub/ptr/professional_computer_science.w-022/roberts/essential_jtapi

If you have any problem downloading the file, you can also access the source code for the examples via the Prentice Hall website. Go to www.phptr.com, search for Essential JTAPI, and follow the appropriate links to download the examples.zip file.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.