dev@glassfish.java.net

Question regarding SIP Registration/UnRegistration in Sailfin.

From: amith nambiar <voicestreams_at_yahoo.com>
Date: Thu, 30 Apr 2009 02:15:54 -0700 (PDT)

Hi All,

I was trying to build a Registrar with Sailfin. I have a class which looks like :

@javax.servlet.sip.annotation.SipServlet
@javax.servlet.sip.annotation.SipListener
public class RegistrarServlet extends javax.servlet.sip.SipServlet
                                                implements SipSessionListener, SipSessionBindingListener


Following are the implementations of SipSessionListener interface.

public void sessionCreated(SipSessionEvent se)
{
      System.out.println(" ************ SESSION CREATED ***************** " + DmTime.getDateTime() + " : " + se.getSession().getCallId());
}

public void sessionDestroyed(SipSessionEvent se)
{
     System.out.println(" **************** SESSION DESTROYED ************" + DmTime.getDateTime() + " : " + se.getSession().getCallId());
}

Now, when i get REGISTER messages my doRegister function gets called. I'm able to handle explicit un-REGISTER messages as well i,e the UA sending
REGISTER with expires = 0.

 ************ SESSION CREATED ***************** 2009/04/30 11:58:03 : 588267750_at_192.168.1.137
 ************ SESSION CREATED ***************** 2009/04/30 11:58:34 : 588267750_at_192.168.1.137
 ************ SESSION CREATED ***************** 2009/04/30 11:59:04 : 588267750_at_192.168.1.137
 ************ SESSION CREATED ***************** 2009/04/30 11:59:35 : 588267750_at_192.168.1.137
 **************** SESSION DESTROYED ************2009/04/30 12:01:03 : 588267750_at_192.168.1.137
 **************** SESSION DESTROYED ************2009/04/30 12:01:34 : 588267750_at_192.168.1.137
 **************** SESSION DESTROYED ************2009/04/30 12:02:04 : 588267750_at_192.168.1.137
 **************** SESSION DESTROYED ************2009/04/30 12:02:35 : 588267750_at_192.168.1.137

I see that whenever a refresh message is received for a REGISTER, sessionCreated(SipSessionEvent se) gets called.
1) Is this expected behaviour ?. I thought the container looks at the call-id in the refresh message and ascertains that
it is a refresh as opposed to a new session ?

2) My expires interval is 60 seconds why does sessionDestroyed(SipSessionEvent se) get called after 180 seconds ?
Does'nt the container look into the 200 OK to REGISTER to calculate session expiry time ?
Note that the session actually expires 60 seconds from :
************ SESSION CREATED ***************** 2009/04/30 11:59:35 : 588267750_at_192.168.1.137
because i powered off the SIP device after the message.

3) Why is session destroyed being called so many times ?
4) Can someone help me by pointing to docs in setting up a testbed so that i can go through the code for sailfin (any docs would be great ).

Thanks.

Best,
Amith