Essential JTAPI
Authors: Spencer Roberts
Venue:  (1998)

From the Book: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 Microsystemshavedeveloped 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 ...