A non-trivial example application, called TimeBomb, is included in the examples/timeBomb directory of the development kit. This application allows two parties to talk for at most 5 seconds. TimeBomb is a back-to-back user agent application which, prior to timing out, modifies the Request-URI of the outgoing INVITE and then acts transparently.
The TimeBomb application makes use of several other general-purpose ECharts machines, either directly or indirectly, also included in the ECharts for SIP Servlets development kit.
As you can see, by reusing the B2BUA logic it becomes a simple matter to provide default B2BUA behavior (which handles SIP errors setting up the call, CANCEL messages sent by the caller, re-INVITEs, etc.) while specifying an override for non-default behavior.
The TimeBomb application directory structure, build files and deployment descriptors were created using the appgen tool described in Section 7. In this example we will show how to build the application and test it using the KitCAT test framework included with the E4SS development kit.
Prior to building the sample, change to the test subdirectory and then modify build.properties and env.properties as desired. In particular, you should modify the ext.classpath property in env.properties to include the two jar files necessary to build the example. The first jar file includes the classes defined in the javax.servlet package. The second jar file includes the classes defined in the javax.servlet.sip package. These jar files are included with any SIP servlet container. You must also either modify the edk.home property to point to your ECharts for SIP Servlets development kit location, or set the EDK_HOME environment variable to point to its location.
To build the sample type ant fatsar. This will build a war file with the name specified in build.properties. This war file can be deployed to your JSR 289-compliant container (for information on configuring a container to use E4SS, see Appendix A).
Prior to testing the sample, modify the file test.properties as necessary. Then to test the sample, type ant test. This will run the application test cases defined in test/src/testcases/examples/timeBomb/test/TimeBombFSMTest.java. For more information on application testing see Section 6.
Assuming E4SS logging is configured for your container (see Appendix A), then the application’s log will contain a complete record of the SIP messages input and output by the application as well as a transcription of the transitions that fired during the execution of the application’s ECharts machine.
To generate javadoc documentation for the example, you need to install the open source graphviz package, available from the graphviz.org website. This package is used to generate a graphical representation of application machines and integrates them with the javadoc pages. Then enter the command ant javadoc. This will generate the documentation in the doc/api directory. See the ECharts User Manual [2] for more information related to generating and viewing javadoc documentation generated this way.