Appendix A. Source Code

All the source code for the practices and projects included in the book can be downloaded from the book’s web site at http://books.elsevier.com/companions/9780123743008.

In order to run the code, readers need:

  1. A computer with a soundcard and a webcam. The webcam is needed only if readers want to use video transmission/reception features in the soft-phone.

  2. The Java Standard Platform (JSE), version 1.4 or later, installed in their computer. The Java platform can be freely downloaded at http://java.sun.com.

  3. The JAIN SIP and JAIN SDP libraries. See Section A.1.

  4. The JMF libraries. See Section A.2.

  5. The code of the book’s practices and projects. See Section A.3.

A.1 Obtaining the JAIN SIP and JAIN SDP Libraries

The NIST implementation of JAIN SIP and JAIN SDP can be obtained from https://jain-sip.dev.java.net. However, we also need other support libraries in order for JAIN SIP and JAIN SDP to work properly. So the best way to get all the needed libraries in just one shot is to download them from the SIP-communicator web page: http://sip-communicator.org. The sip-communicator project is an open-source initiative to build a fully featured and complex audio/video Internet phone and instant messenger. The sip-communicator project also uses JAIN SIP. After having understood the practices in this book, we encourage readers to take a look at the source code in the sip-communicator project. In order to download the JAIN SIP and SDP libraries, we have to download the whole project first, and then go to the lib folder and obtain the following jar files:

  • JainSipApi1.2.jar and JainSipRi.1.2.jar (JAIN SIP libraries)

  • nist-sdp-1.0.jar (JAIN SDP library)

  • concurrent.jar, log4j-1.2.8.jar, jakarta-regexp-1.3.jar, and junit-3.8.1.jar (support libraries)

We will need to include these libraries in the classpath of our computer.

A.2 Obtaining the JMF Libraries

The JMF libraries can be downloaded at http://java.sun.com/products/java-media/jmf. The installation package installs the JMF libraries, some native libraries, and also the JMF Studio, an application that allows us to manage the JMF configuration and test the JMF implementation. Once installed, we can get the following jar files from the lib directory:

  • jmf.jar

  • customizer.jar

  • mediaplayer.jar

  • multiplayer.jar

  • sound.jar

We will need to include these in the classpath.

A.3 The Book’s Source Code

All throughout the book, the reader is guided to build six programming examples, several components, and four full-blown projects. These are:

All the examples and practices (except for Example1, which is not truly a complete program) are composed of three Java classes. These are:

  • NameApp: For instance, Example3App or Softphone1App. This is the class that contains the main() method, which we need to invoke in order to run the complete application.

  • NameGUI: For instance, Example3GUI or Softphone1GUI. This is the class that contains the actual GUI.

  • NameListener: This is the class that implements the SipListener interface and where the core application logic resides.

In addition to these, the soft-phone applications (1, 2, and 3) also use a number of other generic classes that were built throughout the book and that are grouped under the package called “splibraries.” These classes are:

These need to be imported by the soft-phone applications. We need to include the splibraries in the classpath of our computer.

In addition to these homemade classes, the applications also need to import the external libraries for SIP, SDP, and JMF.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.218.84