Skip to main content

SailFin V1: Step by step guide to get started.

Posted by binod on February 10, 2009 at 8:05 AM PST

SailFin V1 is released. This post explains the basic steps by which you can get started with SailFin V1 and write a simple sip application.

Required software.

 1. Download SailFin V1.

 2. Download netbeans 6.5 from here.

 3. Install netbeans SIP plugin available in /lib/tools/netbeans directory. More details are here.

Ok, now you have the required software to start writing a sip application. On netbeans, make sure that you have selected SIP category when you create a project. Add a new SipServlet to the project.

The example, in this entry, is a proxy sipservlet. A sip proxy is a server that route the messages to another sip entity. So, all sipservlet need to do is to proxy the request appropriately.

I will explain two snippets from the application, that are very important.

 1. Registration: Each SIP phone, when it comes up, registers with the server. So, sip servlet need to handle it.

    protected void doRegister(SipServletRequest req) throws IOException, ServletParseException {
        saveContact(req); // Save the contact information (i.e address/port etc).

In this case, the application accepts the register request, saves it and sends back a response.

 2. Actual Proxying
    protected void doInvite(SipServletRequest req) throws TooManyHopsException {
        Proxy p = req.getProxy();

Here, the application sets up the proxy so that all messages get proxied. Full netbeans project is available here to try out. It is basically one sipservlet file. Build and deploy the application from netbeans.

How do you actually test this application?

There are many ways to test this application. There are tools like sipp which you can use for automating the tests. There is a test agent in netbeans for doing a quick message level testing. Here I am explaining how to test the application with X-Lite SIP softphone.

The image here explains the configuration needed in the X-Lite.

For actually testing the communication, you need one more SIP phone. To start one more X-Lite, in linux/mac you can open another shell, login as another user and then bring up the second phone. Setup another user in the new X-Lite phone.


To make a call, simply click on the display box of the X-Lite, type the other user name and click on the green button. Thats it, it is your first VOIP call with SailFin.

Related Topics >>


<p>&nbsp;Thanks for this detailed tutorial on SailFin to ...

Thanks for this detailed tutorial on SailFin to write simple sip application. I will write my first sip application using SailFin and will post my progress here or even i get into any difficult.

Regards Frank Ramirez

Nice Blog. Thanks for sharing this info. -Servesh