7 The Application Generator Tool

The ECharts for SIP Servlets development kit includes a handy tool for quickly generating the directories and files necessary for developing and testing a SIP servlet application: either a back-to-back user agent or proxy. After installing the development kit, set the environment variable EDK_HOME to the development kit’s path and modify the system executable search path to include the development kit’s bin directory. The bin directory contains the appgen executable. For example, on a Unix-based system running BASH use the commands:


export EDK_HOME=/usr/local/share/EChartsSipServlet_DK_2.5-beta
export PATH=$EDK_HOME/bin:$PATH

Then run the appgen command in the directory you wish to create your application directory in. The appgen tool will prompt you to answer a short series of questions and then generate a skeleton application directory. Here’s an example of using it to generate a back-to-back user agent application:


% appgen
SIP ECharts APPLICATION CREATION WIZARD

Application type: b2bua or proxy?  [b2bua]
----> b2bua

Enter fully-qualified package name (last component is app name)
E.g., com.example.sipecharts.features.myApp
----> examples.features.myApp

Enter class name for main Machine
E.g., MyAppFSM
----> MyAppFSM

Enter a title for Javadocs
E.g., My Application
----> My Application

Creating source tree ...

APPLICATION CREATED in myApp directory

In this example, a subdirectory called myApp is created in the directory appgen was run in. The myApp directory contains a skeleton ECharts machine called MyAppFSM.ech, located in the application directory’s src/examples/features/myApp directory, that is ready for you to customize. The myApp directory also contains the ant build files required to compile the application, generate a war file and, optionally, deploy the application. To customize the build to suit your environment edit the build.properties and env.properties files in the top-level application directory, and the sip.xml and web.xml files in the application’s SarContent/WEB-INF directory. appgen also generates KitCAT-based test case templates and associated build files under the myApp/test directory. These test cases are JUnit-based and can be built and run by invoking ant test from the command line.