Donnerstag, 31. Januar 2008

Create a SIP Application for Sailfin (Part 1 Database)

I will go step by step through creating a simple SIP application using the NetBeans IDE for the Sailfin Sip application server. In part 1 we will setup the user database where the Sip users will register themselves.

  1. get the NetBeans IDE from and the NetBeans Sip application development from (in the appdevnb section).
  2. follow the installation instructions in
  3. The sources are available in cvs using
    cvs -d:pserver:[your account] co sailfin/sailfin-tests and then can be found then in community/samples/b2bua, or send an email to to get them.

Preparing the database:

  1. Open the database settings in NetBeans with "Tools->Java DB Database->Settings" and select your Java DB installation (normally in sailfin/javadb) and the database location (normally in sailfin/databases).
  2. Start the DB server with "Tools->Java DB Database->Start Server".
  3. Create a new database with "Tools->Java DB Database->Create Database", then enter the database name (b2bua), the username (APP) and password (APP).
  4. You can then connect to the database from the Servers tab. Click on the database connection, right click and then Connect.

The application itself is a simple Sip back-to-back user agent which allows to build up a communication between two Sip phones and acts as a Registrar which handles the registration of the Sip users.

Creating the Data Storage

  1. Create a new project with "File->New Project" and choose Sip and Converged Servlet Application as project type. The project name of our sample is b2bua.
  2. In the project view select Source Packages, right click and choose "New->Sip Servlet", enter RegisterSipServlet as class name and b2bua.sip as package name.
  3. In the project view select Source Packages, right click and choose "New->Entity Class", enter UserData as class name and b2bua.model as package name. In the same dialog box click on "Create Persistence Unit".
  4. Choose "New Data Source" and in the next dialog box set jdbc/b2bua as JNDI name and select the prevously created database connection to b2bua.
  5. Look at the downloaded source code for You will see that the attribute sipURI and its getter and setter methods were added. In sipURI the URI of the registered user is stored.

Deployment of Part 1

  1. Open the projects properties, go to the "Run" page, select Java System Application Server as server and uncheck the "Display Browser on Run" checkbox.
  2. Select "Run->Run Main Project" to deploy the application. Depending on the sailfin version you are using there might be some warnings during deployment. Important is the output line "Enable of b2bua in target server completed successfully".
  3. Check the deployment on the sailfin admin console. Point your browser to http://localhost:4848/ and check "Applications->Sip->Converged Sip Modules" entries. b2bua should be visible as deployed.
  4. Connect to the database, open the USERDATA table, right click and select "View Data". The table should be empty. Add data by entering "insert into USERDATA values ('', ''); in the SQL window, right click and select "Run Statement".
  5. You can also another SQl client, e.q Squirrel (download from, good instructions can be found in Squirrel allows to directly modify the database without using SQL statements

Donnerstag, 17. Januar 2008

Welcome to my Devlog


This weblog tells you about the private development projects I am involved in, currently this are:
  • PinTheGlobe: a GoogleMaps based website ( which allows to view and add georeferenced information (so called geotags) to the map, e.g. you can add favorite places you want to share with others. I created this website mainly to learn new website development techniques like javascript and Ajax.

  • Sailfin: participating in sample applications and testing for the sailfin project. Sailfin ( is an open source converged SIP and HTTP application server based on glassfish.