This is The SIP Servlet Tutorial, a tutorial that describes how to develop telecommunications applications that use the session initialization protocol (SIP) on the Java EE platform. This tutorial also covers how you can integrate SIP applications with other Java EE technologies, like web applications and enterprise beans.
This tutorial is intended for programmers who are interested in developing and deploying SIP applications on the Sun Java System Communications Application Server 1.5, a Java EE server that integrates a SIP servlet container. Communications Application Server 1.5 is based on the open-source GlassFish and SailFin projects.
This tutorial is intended for the following readers:
Java programming language developers interested in learning about how to create SIP applications.
SIP application developers who are new to server-side Java programming language development.
Anyone interested in how SIP applications work, and how they can be integrated in with traditional web applications and Java EE components.
This tutorial assumes you are conversant in reading Java programming language source code, and you have a basic understanding of client/server network applications.
This section tells you everything you need to know to install, build, and run the examples included in the tutorial bundle.
The following software is required to run the examples.
To build, deploy, and run the examples, you need a copy of Java Platform, Standard Edition 5.0 (Java SE 5.0) or higher. You can download the Java SE 5.0 software from http://java.sun.com/javase/downloads/index_jdk5.jsp. Download the current JDK update that does not include any other software (such as the NetBeans IDE or Java EE).
Communications Application Server 1.5 is targeted as the build and runtime environment for the tutorial examples. Communications Application Server 1.5 is based on the GlassFish and SailFin open-source projects.
The NetBeans integrated development environment (IDE) is a free, open-source IDE for developing Java programming language applications, including enterprise applications. NetBeans IDE supports the Java EE 5 platform. You can build, package, deploy, and run the tutorial examples from within NetBeans IDE.
Integrate the SailFin plug-in modules, which add SIP application development functionality to NetBeans IDE. The modules are bundled with Communications Application Server 1.5.
In NetBeans IDE, select Tools->Plugins.
Click the Downloaded tab and click Add Plugins.
Navigate to the Install/tools/netbeans directory and select all the files in this directory.
Click Install, then Next.
Select I Agree in the License Agreement window and click Install.
Click Continue to install the unsigned modules, then click Finish.
The tutorial uses several sample applications available on the SailFin website.
Go to the following URL: http://wiki.glassfish.java.net/gfwiki/Wiki.jsp?page=SipExamples.
Follow the instructions to download the SipProxy and SIP Servlet 1.1 Click-To-Dial sample applications.
SIPp is an application to test SIP clients and servers. It is available from http://sipp.sourceforge.net/.
X-Lite is a free multi-platform soft phone used in the examples. It is available from http://www.counterpath.com/x-lite.html&active=4.
Ant is a Java technology-based build tool developed by the Apache Software Foundation (http://ant.apache.org), and is used to build, package, and deploy the tutorial examples. Ant is included with the Communications Application Server 1.5. To use the ant command, add JAVAEE_HOME/lib/ant/bin to your PATH environment variable.
The tutorial examples are distributed with a configuration file for either NetBeans IDE or Ant. Directions for building the examples are provided in each chapter. Either NetBeans IDE or Ant may be used to build, package, deploy, and run the examples.
To run the tutorial examples in NetBeans IDE, you must register your Communications Application Server 1.5 installation as a NetBeans Server Instance. Follow these instructions to register the Communications Application Server 1.5 in NetBeans IDE.
Select Tools-->Server Manager to open the Server Manager dialog.
Click Add Server.
Under Server, select Sun Java System Application Server and click Next.
Under Platform Location, enter the location of your Application Server installation.
Select Register Local Default Domain and click Next.
Under Admin Username and Admin Password, enter the admin name and password created when you installed the Application Server.
Click Finish.
To facilitate iterative development and keep application source separate from compiled files, the tutorial examples use the Java BluePrints application directory structure.
Each application module has the following structure:
build.xml: Ant build file
src/java: Java source files for the module
src/conf: configuration files for the module, with the exception of web applications
web: JSP and HTML pages, style sheets, tag files, and images
web/WEB-INF: configuration files for web applications
nbproject: NetBeans IDE project files
The Ant build files (build.xml) distributed with the examples contain targets to create a build subdirectory and to copy and compile files into that directory; a dist subdirectory, which holds the packaged module file; and a client-jar directory, which holds the retrieved application client JAR.
Third-party URLs are referenced in this document and provide additional, related information.
Sun is not responsible for the availability of third-party web sites mentioned in this document. Sun does not endorse and is not responsible or liable for any content, advertising, products, or other materials that are available on or through such sites or resources. Sun will not be responsible or liable for any actual or alleged damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods, or services that are available on or through such sites or resources.
The Sun web site provides information about the following additional resources:
The following table describes the typographic conventions that are used in this book.
Table P–1 Typographic Conventions
Typeface |
Meaning |
Example |
---|---|---|
AaBbCc123 |
The names of commands, files, and directories, and onscreen computer output |
Edit your .login file. Use ls -a to list all files. machine_name% you have mail. |
AaBbCc123 |
What you type, contrasted with onscreen computer output |
machine_name% su Password: |
aabbcc123 |
Placeholder: replace with a real name or value |
The command to remove a file is rm filename. |
AaBbCc123 |
Book titles, new terms, and terms to be emphasized |
Read Chapter 6 in the User's Guide. A cache is a copy that is stored locally. Do not save the file. Note: Some emphasized items appear bold online. |
The following table shows the default UNIX® system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.
Table P–2 Shell Prompts
Shell |
Prompt |
---|---|
C shell |
machine_name% |
C shell for superuser |
machine_name# |
Bourne shell and Korn shell |
$ |
Bourne shell and Korn shell for superuser |
# |