org.mobicents.servlet.sip.core.session
Class SipSessionImpl

java.lang.Object
  extended by org.mobicents.servlet.sip.core.session.SipSessionImpl
All Implemented Interfaces:
SipSession, SipSessionExt, MobicentsSipSession

public class SipSessionImpl
extends java.lang.Object
implements MobicentsSipSession

Implementation of the SipSession interface. An instance of this sip session can only be retrieved through the Session Manager (extended class from Tomcat's manager classes implementing the Manager interface) to constrain the creation of sip session and to make sure that all sessions created can be retrieved only through the session manager

As a SipApplicationSession represents a dialog, the call id and from header URI, from tag, to Header (and to Tag to identify forked requests) are used as a unique key for a given SipSession instance.

Author:
vralev, mranga, Jean Deruelle

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.servlet.sip.SipSession
SipSession.State
 
Field Summary
protected  java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Boolean> acksReceived
           
protected  B2buaHelperImpl b2buaHelper
           
protected  boolean copyRecordRouteHeadersOnSubsequentResponses
           
protected  long creationTime
          Creation time.
protected  long cseq
           
protected  java.util.concurrent.ConcurrentHashMap<java.lang.String,MobicentsSipSession> derivedSipSessions
           
protected  MobicentsSipSessionFacade facade
           
protected  java.lang.String handlerServlet
          The name of the servlet withing this same app to handle all subsequent requests.
protected  boolean invalidateWhenReady
           
protected  boolean isSessionCreatingTransactionServer
           
protected  boolean isValid
           
protected  java.util.concurrent.atomic.AtomicBoolean isValidInternal
          Is the session valid.
protected  SipSessionKey key
           
protected  long lastAccessedTime
          Last access time.
protected  Address localParty
           
protected  SipApplicationRouterInfo nextSipApplicationRouterInfo
          AR router info for the next app in chain
protected  boolean okToByeSentOrReceived
           
protected  java.util.Set<javax.sip.Transaction> ongoingTransactions
           
protected  java.lang.String originalMethod
           
protected  java.lang.String outboundInterface
          Outbound interface is one of the allowed values in the Servlet Context attribute "javax.servlet.ip.outboundinterfaces" This one is not serialized, it has to be reset by the app on sessionActivated listener method
protected  MobicentsSipSession parentSession
           
protected  ProxyImpl proxy
           
protected  boolean readyToInvalidate
           
protected  Address remoteParty
           
protected  int requestsPending
           
protected  SipApplicationRoutingRegion routingRegion
          Routing region per session/dialog.
protected  java.util.concurrent.Semaphore semaphore
           
protected  javax.sip.Dialog sessionCreatingDialog
          We use this for dialog-related requests.
protected  SipServletRequestImpl sessionCreatingTransactionRequest
          We use this for REGISTER or MESSAGE, where a dialog doesn't exist to carry the session info.
protected  MobicentsSipApplicationSession sipApplicationSession
           
protected  SipApplicationSessionKey sipApplicationSessionKey
           
protected  SipFactoryImpl sipFactory
           
protected  java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap
           
protected  SipSessionSecurity sipSessionSecurity
           
protected  SipSession.State state
          Current state of the session, one of INTITIAL, EARLY, ESTABLISHED and TERMINATED.
protected  java.io.Serializable stateInfo
          AR state info
protected  java.lang.String subscriberURI
          Subscriber URI should be set for outbound sessions, from requests created in the container.
protected  java.util.Set<javax.sip.header.EventHeader> subscriptions
           
protected  java.lang.String transport
           
protected  java.security.Principal userPrincipal
           
 
Constructor Summary
protected SipSessionImpl(SipSessionKey key, SipFactoryImpl sipFactoryImpl, MobicentsSipApplicationSession mobicentsSipApplicationSession)
           
 
Method Summary
 void access()
          Update the accessed time information for this session.
 void acquire()
           
 void activate()
          Perform internal processing required to activate this session.
 void addDerivedSipSessions(MobicentsSipSession derivedSession)
          Add the derived sip session it will be identified by the To tag from its key
 void addOngoingTransaction(javax.sip.Transaction transaction)
          Add an ongoing tx to the session.
 void addSubscription(SipServletMessageImpl sipServletMessageImpl)
          
protected  void cleanupAcksReceived(long remoteCSeq)
          We clean up the stored acks received when the remoteCSeq in param is greater and that the ackReceived is true
 SipServletRequest createRequest(java.lang.String method)
           
 boolean equals(java.lang.Object obj)
           
 MobicentsSipSession findDerivedSipSession(java.lang.String toTag)
          Find the derived sip session identified by its to tag
 SipApplicationSession getApplicationSession()
           
 java.lang.Object getAttribute(java.lang.String name)
           
protected  java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()
           
 java.util.Enumeration<java.lang.String> getAttributeNames()
           
 B2buaHelperImpl getB2buaHelper()
          
 java.lang.String getCallId()
           
 boolean getCopyRecordRouteHeadersOnSubsequentResponses()
           
 long getCreationTime()
           
 long getCseq()
           
 java.util.Iterator<MobicentsSipSession> getDerivedSipSessions()
           
 java.lang.String getHandler()
          Retrieve the handler associated with this sip session
 java.lang.String getId()
           
 boolean getInvalidateWhenReady()
           
 SipSessionKey getKey()
          get the internal Mobicents Sip Session Key
 long getLastAccessedTime()
           
 Address getLocalParty()
           
 SipApplicationRouterInfo getNextSipApplicationRouterInfo()
           
 java.util.Set<javax.sip.Transaction> getOngoingTransactions()
           
 java.lang.String getOutboundInterface()
           
 MobicentsSipSession getParentSession()
           
 ProxyImpl getProxy()
          Retieves the proxy of the sip session if any
 SipApplicationRoutingRegion getRegion()
          
 SipApplicationRoutingRegion getRegionInternal()
          
 Address getRemoteParty()
           
 int getRequestsPending()
           
 java.util.concurrent.Semaphore getSemaphore()
           
 javax.servlet.ServletContext getServletContext()
          
 MobicentsSipSessionFacade getSession()
           
 javax.sip.Dialog getSessionCreatingDialog()
           
 SipServletRequestImpl getSessionCreatingTransactionRequest()
           
 MobicentsSipApplicationSession getSipApplicationSession()
           
 java.util.Map<java.lang.String,java.lang.Object> getSipSessionAttributeMap()
           
 SipSessionSecurity getSipSessionSecurity()
           
 java.lang.String getSipSubscriberURI()
           
 SipSession.State getState()
           
 java.io.Serializable getStateInfo()
           
 URI getSubscriberURI()
          
 java.lang.String getTransport()
           
 java.security.Principal getUserPrincipal()
           
 int hashCode()
           
protected  boolean hasOngoingTransaction()
          Removed from the interface in PFD stage so making it protected
 void invalidate()
           
 void invalidate(boolean bypassCheck)
           
protected  boolean isAckReceived(long cSeq)
          check if the ack has been received for the cseq in param it may happen that the ackReceived has been removed already if that's the case it will return true
 boolean isReadyToInvalidate()
           
 boolean isReadyToInvalidateInternal()
           
 boolean isSupervisedMode()
           
 boolean isValid()
           
 boolean isValidInternal()
           
 void notifySipSessionListeners(SipSessionEventType sipSessionEventType)
          Notifies the listeners that a lifecycle event occured on that sip session
 void onDialogTimeout(javax.sip.Dialog dialog)
           
 void onReadyToInvalidate()
          This method is called immediately when the conditions for read to invalidate session are met
 void onTerminatedState()
           
 void passivate()
          Perform the internal processing required to passivate this session.
 void release()
           
 void removeAttribute(java.lang.String name)
           
 void removeAttribute(java.lang.String name, boolean byPassValidCheck)
           
 MobicentsSipSession removeDerivedSipSession(java.lang.String toTag)
          Removes the derived sip session identified by the To tag in parameter
 void removeOngoingTransaction(javax.sip.Transaction transaction)
          Remove an ongoing tx to the session.
 void removeSubscription(SipServletMessageImpl sipServletMessageImpl)
          
 void scheduleAsynchronousWork(SipSessionAsynchronousWork work)
           
 void setAckReceived(long cSeq, boolean ackReceived)
          Setting ackReceived for CSeq to specified value in second param.
 void setAttribute(java.lang.String key, java.lang.Object attribute)
           
 void setB2buaHelper(B2buaHelperImpl helperImpl)
          
 void setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
           
 void setCseq(long cseq)
           
 void setHandler(java.lang.String name)
           
 void setInvalidateWhenReady(boolean arg0)
           
 void setKey(SipSessionKey key)
           
 void setLocalParty(Address localParty)
           
 void setNextSipApplicationRouterInfo(SipApplicationRouterInfo routerInfo)
           
 void setOutboundInterface(java.net.InetAddress inetAddress)
           
 void setOutboundInterface(java.net.InetSocketAddress inetSocketAddress)
           
 void setOutboundInterface(SipURI outboundInterface)
           
 void setParentSession(MobicentsSipSession mobicentsSipSession)
           
 void setProxy(ProxyImpl proxy)
          
 void setReadyToInvalidate(boolean readyToInvalidate)
           
 void setRemoteParty(Address remoteParty)
           
 void setRequestsPending(int requests)
           
 void setRoutingRegion(SipApplicationRoutingRegion routingRegion)
          This method allows the application to set the region that the application is in with respect to this SipSession
 void setSessionCreatingDialog(javax.sip.Dialog dialog)
           
 void setSessionCreatingTransactionRequest(SipServletMessageImpl message)
           
protected  void setSipApplicationSession(MobicentsSipApplicationSession sipApplicationSession)
           
 void setSipSessionAttributeMap(java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap)
           
 void setSipSessionSecurity(SipSessionSecurity sipSessionSecurity)
           
 void setSipSubscriberURI(java.lang.String subscriberURI)
           
 void setState(SipSession.State state)
           
 void setStateInfo(java.io.Serializable stateInfo)
           
 void setTransport(java.lang.String transport)
           
 void setUserPrincipal(java.security.Principal userPrincipal)
           
 void setValid(boolean isValid)
           
 java.lang.String toString()
           
 void updateStateOnResponse(SipServletResponseImpl response, boolean receive)
          Update the sip session state upon sending/receiving a response Covers JSR 289 Section 6.2.1 along with updateStateOnRequest method
 void updateStateOnSubsequentRequest(SipServletRequestImpl request, boolean receive)
          Update the sip session state upon sending/receiving a subsequent request Covers JSR 289 Section 6.2.1 along with updateStateOnResponse method
 boolean validateCSeq(SipServletRequestImpl sipServletRequest)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

sipApplicationSessionKey

protected transient SipApplicationSessionKey sipApplicationSessionKey

sipApplicationSession

protected transient MobicentsSipApplicationSession sipApplicationSession

proxy

protected ProxyImpl proxy

b2buaHelper

protected B2buaHelperImpl b2buaHelper

requestsPending

protected transient int requestsPending

sipSessionAttributeMap

protected volatile java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap

key

protected transient SipSessionKey key

userPrincipal

protected transient java.security.Principal userPrincipal

cseq

protected long cseq

transport

protected java.lang.String transport

creationTime

protected long creationTime
Creation time.


lastAccessedTime

protected long lastAccessedTime
Last access time.


routingRegion

protected transient SipApplicationRoutingRegion routingRegion
Routing region per session/dialog.


stateInfo

protected transient java.io.Serializable stateInfo
AR state info


nextSipApplicationRouterInfo

protected transient SipApplicationRouterInfo nextSipApplicationRouterInfo
AR router info for the next app in chain


state

protected SipSession.State state
Current state of the session, one of INTITIAL, EARLY, ESTABLISHED and TERMINATED.


isValidInternal

protected java.util.concurrent.atomic.AtomicBoolean isValidInternal
Is the session valid.


isValid

protected transient boolean isValid

handlerServlet

protected java.lang.String handlerServlet
The name of the servlet withing this same app to handle all subsequent requests.


subscriberURI

protected transient java.lang.String subscriberURI
Subscriber URI should be set for outbound sessions, from requests created in the container.


outboundInterface

protected transient java.lang.String outboundInterface
Outbound interface is one of the allowed values in the Servlet Context attribute "javax.servlet.ip.outboundinterfaces" This one is not serialized, it has to be reset by the app on sessionActivated listener method


sessionCreatingDialog

protected transient javax.sip.Dialog sessionCreatingDialog
We use this for dialog-related requests. In this case the dialog directly corresponds to the session.


sessionCreatingTransactionRequest

protected transient SipServletRequestImpl sessionCreatingTransactionRequest
We use this for REGISTER or MESSAGE, where a dialog doesn't exist to carry the session info. In this case the session only spans a single transaction.


isSessionCreatingTransactionServer

protected transient boolean isSessionCreatingTransactionServer

ongoingTransactions

protected transient java.util.Set<javax.sip.Transaction> ongoingTransactions

derivedSipSessions

protected transient volatile java.util.concurrent.ConcurrentHashMap<java.lang.String,MobicentsSipSession> derivedSipSessions

sipFactory

protected transient SipFactoryImpl sipFactory

invalidateWhenReady

protected boolean invalidateWhenReady

readyToInvalidate

protected boolean readyToInvalidate

parentSession

protected transient MobicentsSipSession parentSession

localParty

protected transient Address localParty

remoteParty

protected transient Address remoteParty

subscriptions

protected transient volatile java.util.Set<javax.sip.header.EventHeader> subscriptions

originalMethod

protected transient java.lang.String originalMethod

okToByeSentOrReceived

protected transient boolean okToByeSentOrReceived

copyRecordRouteHeadersOnSubsequentResponses

protected transient boolean copyRecordRouteHeadersOnSubsequentResponses

semaphore

protected transient java.util.concurrent.Semaphore semaphore

facade

protected transient MobicentsSipSessionFacade facade

acksReceived

protected transient java.util.concurrent.ConcurrentHashMap<java.lang.Long,java.lang.Boolean> acksReceived

sipSessionSecurity

protected transient SipSessionSecurity sipSessionSecurity
Constructor Detail

SipSessionImpl

protected SipSessionImpl(SipSessionKey key,
                         SipFactoryImpl sipFactoryImpl,
                         MobicentsSipApplicationSession mobicentsSipApplicationSession)
Method Detail

notifySipSessionListeners

public void notifySipSessionListeners(SipSessionEventType sipSessionEventType)
Notifies the listeners that a lifecycle event occured on that sip session

Specified by:
notifySipSessionListeners in interface MobicentsSipSession
Parameters:
sipSessionEventType - the type of event that happened

createRequest

public SipServletRequest createRequest(java.lang.String method)
Specified by:
createRequest in interface SipSession

getApplicationSession

public SipApplicationSession getApplicationSession()
Specified by:
getApplicationSession in interface SipSession

getAttributeMap

protected java.util.Map<java.lang.String,java.lang.Object> getAttributeMap()

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in interface SipSession

getAttributeNames

public java.util.Enumeration<java.lang.String> getAttributeNames()
Specified by:
getAttributeNames in interface SipSession

getCallId

public java.lang.String getCallId()
Specified by:
getCallId in interface SipSession

getCreationTime

public long getCreationTime()
Specified by:
getCreationTime in interface SipSession

getId

public java.lang.String getId()
Specified by:
getId in interface SipSession

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface SipSession

access

public void access()
Update the accessed time information for this session. This method should be called by the context when a request comes in for a particular session, even if the application does not reference it.

Specified by:
access in interface MobicentsSipSession

getLocalParty

public Address getLocalParty()
Specified by:
getLocalParty in interface SipSession

getRegion

public SipApplicationRoutingRegion getRegion()

Specified by:
getRegion in interface SipSession

getRegionInternal

public SipApplicationRoutingRegion getRegionInternal()

Specified by:
getRegionInternal in interface MobicentsSipSession

setRoutingRegion

public void setRoutingRegion(SipApplicationRoutingRegion routingRegion)
This method allows the application to set the region that the application is in with respect to this SipSession

Specified by:
setRoutingRegion in interface MobicentsSipSession
Parameters:
routingRegion - the region that the application is in

getStateInfo

public java.io.Serializable getStateInfo()
Specified by:
getStateInfo in interface MobicentsSipSession
Returns:
the stateInfo

setStateInfo

public void setStateInfo(java.io.Serializable stateInfo)
Specified by:
setStateInfo in interface MobicentsSipSession
Parameters:
stateInfo - the stateInfo to set

getRemoteParty

public Address getRemoteParty()
Specified by:
getRemoteParty in interface SipSession

getState

public SipSession.State getState()
Specified by:
getState in interface SipSession

getSubscriberURI

public URI getSubscriberURI()

Specified by:
getSubscriberURI in interface SipSession

invalidate

public void invalidate()
Specified by:
invalidate in interface SipSession

invalidate

public void invalidate(boolean bypassCheck)

hasOngoingTransaction

protected boolean hasOngoingTransaction()
Removed from the interface in PFD stage so making it protected


isValid

public boolean isValid()
Specified by:
isValid in interface SipSession

isValidInternal

public boolean isValidInternal()
Specified by:
isValidInternal in interface MobicentsSipSession

setValid

public void setValid(boolean isValid)
Parameters:
isValid - the isValid to set

removeAttribute

public void removeAttribute(java.lang.String name)
Specified by:
removeAttribute in interface SipSession

removeAttribute

public void removeAttribute(java.lang.String name,
                            boolean byPassValidCheck)

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object attribute)
Specified by:
setAttribute in interface SipSession

setHandler

public void setHandler(java.lang.String name)
                throws javax.servlet.ServletException
Specified by:
setHandler in interface SipSession
Throws:
javax.servlet.ServletException

getHandler

public java.lang.String getHandler()
Retrieve the handler associated with this sip session

Specified by:
getHandler in interface MobicentsSipSession
Returns:
the handler associated with this sip session

setSessionCreatingDialog

public void setSessionCreatingDialog(javax.sip.Dialog dialog)
Specified by:
setSessionCreatingDialog in interface MobicentsSipSession
Parameters:
dialog - the dialog to set

getSessionCreatingDialog

public javax.sip.Dialog getSessionCreatingDialog()
Specified by:
getSessionCreatingDialog in interface MobicentsSipSession
Returns:
the dialog

getSipApplicationSession

public MobicentsSipApplicationSession getSipApplicationSession()
Specified by:
getSipApplicationSession in interface MobicentsSipSession

setSipApplicationSession

protected void setSipApplicationSession(MobicentsSipApplicationSession sipApplicationSession)

getSessionCreatingTransactionRequest

public SipServletRequestImpl getSessionCreatingTransactionRequest()
Specified by:
getSessionCreatingTransactionRequest in interface MobicentsSipSession

setSessionCreatingTransactionRequest

public void setSessionCreatingTransactionRequest(SipServletMessageImpl message)
Specified by:
setSessionCreatingTransactionRequest in interface MobicentsSipSession
Parameters:
sessionCreatingTransaction - the sessionCreatingTransaction to set

isSupervisedMode

public boolean isSupervisedMode()

setSipSubscriberURI

public void setSipSubscriberURI(java.lang.String subscriberURI)
Specified by:
setSipSubscriberURI in interface MobicentsSipSession

getSipSubscriberURI

public java.lang.String getSipSubscriberURI()
Specified by:
getSipSubscriberURI in interface MobicentsSipSession

getOutboundInterface

public java.lang.String getOutboundInterface()
Specified by:
getOutboundInterface in interface MobicentsSipSession

onDialogTimeout

public void onDialogTimeout(javax.sip.Dialog dialog)

setState

public void setState(SipSession.State state)
Specified by:
setState in interface MobicentsSipSession

onTerminatedState

public void onTerminatedState()
Specified by:
onTerminatedState in interface MobicentsSipSession

addOngoingTransaction

public void addOngoingTransaction(javax.sip.Transaction transaction)
Add an ongoing tx to the session.

Specified by:
addOngoingTransaction in interface MobicentsSipSession

removeOngoingTransaction

public void removeOngoingTransaction(javax.sip.Transaction transaction)
Remove an ongoing tx to the session.

Specified by:
removeOngoingTransaction in interface MobicentsSipSession

getOngoingTransactions

public java.util.Set<javax.sip.Transaction> getOngoingTransactions()
Specified by:
getOngoingTransactions in interface MobicentsSipSession

updateStateOnResponse

public void updateStateOnResponse(SipServletResponseImpl response,
                                  boolean receive)
Update the sip session state upon sending/receiving a response Covers JSR 289 Section 6.2.1 along with updateStateOnRequest method

Specified by:
updateStateOnResponse in interface MobicentsSipSession
Parameters:
response - the response received/to send
receive - true if the response has been received, false if it is to be sent.

updateStateOnSubsequentRequest

public void updateStateOnSubsequentRequest(SipServletRequestImpl request,
                                           boolean receive)
Update the sip session state upon sending/receiving a subsequent request Covers JSR 289 Section 6.2.1 along with updateStateOnResponse method

Specified by:
updateStateOnSubsequentRequest in interface MobicentsSipSession
Parameters:
request - the subsequent request received/to send
receive - true if the subsequent request has been received, false if it is to be sent.

onReadyToInvalidate

public void onReadyToInvalidate()
This method is called immediately when the conditions for read to invalidate session are met

Specified by:
onReadyToInvalidate in interface MobicentsSipSession

getKey

public SipSessionKey getKey()
Description copied from interface: MobicentsSipSession
get the internal Mobicents Sip Session Key

Specified by:
getKey in interface MobicentsSipSession
Returns:
the key

setKey

public void setKey(SipSessionKey key)
Parameters:
key - the key to set

getProxy

public ProxyImpl getProxy()
Retieves the proxy of the sip session if any

Specified by:
getProxy in interface MobicentsSipSession
Returns:

setProxy

public void setProxy(ProxyImpl proxy)

Specified by:
setProxy in interface MobicentsSipSession

setB2buaHelper

public void setB2buaHelper(B2buaHelperImpl helperImpl)

Specified by:
setB2buaHelper in interface MobicentsSipSession

getB2buaHelper

public B2buaHelperImpl getB2buaHelper()

Specified by:
getB2buaHelper in interface MobicentsSipSession

passivate

public void passivate()
Perform the internal processing required to passivate this session.


activate

public void activate()
Perform internal processing required to activate this session.


getUserPrincipal

public java.security.Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface MobicentsSipSession

setUserPrincipal

public void setUserPrincipal(java.security.Principal userPrincipal)
Specified by:
setUserPrincipal in interface MobicentsSipSession

getInvalidateWhenReady

public boolean getInvalidateWhenReady()
Specified by:
getInvalidateWhenReady in interface SipSession

isReadyToInvalidate

public boolean isReadyToInvalidate()
Specified by:
isReadyToInvalidate in interface SipSession

setReadyToInvalidate

public void setReadyToInvalidate(boolean readyToInvalidate)
Parameters:
readyToInvalidate - the readyToInvalidate to set

isReadyToInvalidateInternal

public boolean isReadyToInvalidateInternal()

setInvalidateWhenReady

public void setInvalidateWhenReady(boolean arg0)
Specified by:
setInvalidateWhenReady in interface SipSession

setOutboundInterface

public void setOutboundInterface(java.net.InetAddress inetAddress)
Specified by:
setOutboundInterface in interface SipSession

setOutboundInterface

public void setOutboundInterface(java.net.InetSocketAddress inetSocketAddress)
Specified by:
setOutboundInterface in interface SipSession

setOutboundInterface

public void setOutboundInterface(SipURI outboundInterface)
Specified by:
setOutboundInterface in interface SipSessionExt

getServletContext

public javax.servlet.ServletContext getServletContext()

Specified by:
getServletContext in interface SipSession

removeDerivedSipSession

public MobicentsSipSession removeDerivedSipSession(java.lang.String toTag)
Description copied from interface: MobicentsSipSession
Removes the derived sip session identified by the To tag in parameter

Specified by:
removeDerivedSipSession in interface MobicentsSipSession
Parameters:
toTag - the to Tag identifying the sip session to remove
Returns:
the removed derived sip session

findDerivedSipSession

public MobicentsSipSession findDerivedSipSession(java.lang.String toTag)
Description copied from interface: MobicentsSipSession
Find the derived sip session identified by its to tag

Specified by:
findDerivedSipSession in interface MobicentsSipSession
Parameters:
toTag - the to Tag identifying the sip session to remove
Returns:
the derived sip session identified by its to tag or null if none has been found

getDerivedSipSessions

public java.util.Iterator<MobicentsSipSession> getDerivedSipSessions()
Specified by:
getDerivedSipSessions in interface MobicentsSipSession

setParentSession

public void setParentSession(MobicentsSipSession mobicentsSipSession)
Specified by:
setParentSession in interface MobicentsSipSession

getParentSession

public MobicentsSipSession getParentSession()
Specified by:
getParentSession in interface MobicentsSipSession

setSipSessionAttributeMap

public void setSipSessionAttributeMap(java.util.Map<java.lang.String,java.lang.Object> sipSessionAttributeMap)
Specified by:
setSipSessionAttributeMap in interface MobicentsSipSession

addDerivedSipSessions

public void addDerivedSipSessions(MobicentsSipSession derivedSession)
Description copied from interface: MobicentsSipSession
Add the derived sip session it will be identified by the To tag from its key

Specified by:
addDerivedSipSessions in interface MobicentsSipSession
Parameters:
derivedSession - the derived session to add

getSipSessionAttributeMap

public java.util.Map<java.lang.String,java.lang.Object> getSipSessionAttributeMap()
Specified by:
getSipSessionAttributeMap in interface MobicentsSipSession

setLocalParty

public void setLocalParty(Address localParty)
Specified by:
setLocalParty in interface MobicentsSipSession

setRemoteParty

public void setRemoteParty(Address remoteParty)
Specified by:
setRemoteParty in interface MobicentsSipSession

addSubscription

public void addSubscription(SipServletMessageImpl sipServletMessageImpl)
                     throws javax.sip.SipException

Specified by:
addSubscription in interface MobicentsSipSession
Throws:
javax.sip.SipException

removeSubscription

public void removeSubscription(SipServletMessageImpl sipServletMessageImpl)

Specified by:
removeSubscription in interface MobicentsSipSession

getSemaphore

public java.util.concurrent.Semaphore getSemaphore()
Returns:
the semaphore

getSession

public MobicentsSipSessionFacade getSession()
Specified by:
getSession in interface MobicentsSipSession

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getNextSipApplicationRouterInfo

public SipApplicationRouterInfo getNextSipApplicationRouterInfo()
Specified by:
getNextSipApplicationRouterInfo in interface MobicentsSipSession

setNextSipApplicationRouterInfo

public void setNextSipApplicationRouterInfo(SipApplicationRouterInfo routerInfo)
Specified by:
setNextSipApplicationRouterInfo in interface MobicentsSipSession

setAckReceived

public void setAckReceived(long cSeq,
                           boolean ackReceived)
Setting ackReceived for CSeq to specified value in second param. if the second param is true it will try to cleanup earlier cseq as well to save on memory

Specified by:
setAckReceived in interface MobicentsSipSession
Parameters:
cSeq - cseq to set the ackReceived
ackReceived - whether or not the ack has been received for this cseq

isAckReceived

protected boolean isAckReceived(long cSeq)
check if the ack has been received for the cseq in param it may happen that the ackReceived has been removed already if that's the case it will return true

Parameters:
cSeq - CSeq number to check if the ack has already been received
Returns:

cleanupAcksReceived

protected void cleanupAcksReceived(long remoteCSeq)
We clean up the stored acks received when the remoteCSeq in param is greater and that the ackReceived is true

Parameters:
remoteCSeq - remoteCSeq the basis CSeq for cleaning up earlier (lower CSeq) stored ackReceived

getCseq

public long getCseq()
Specified by:
getCseq in interface MobicentsSipSession

setCseq

public void setCseq(long cseq)
Specified by:
setCseq in interface MobicentsSipSession

validateCSeq

public boolean validateCSeq(SipServletRequestImpl sipServletRequest)
Specified by:
validateCSeq in interface MobicentsSipSession

getTransport

public java.lang.String getTransport()
Specified by:
getTransport in interface MobicentsSipSession

setTransport

public void setTransport(java.lang.String transport)
Specified by:
setTransport in interface MobicentsSipSession

scheduleAsynchronousWork

public void scheduleAsynchronousWork(SipSessionAsynchronousWork work)
Specified by:
scheduleAsynchronousWork in interface SipSessionExt

getRequestsPending

public int getRequestsPending()
Specified by:
getRequestsPending in interface MobicentsSipSession

setRequestsPending

public void setRequestsPending(int requests)
Specified by:
setRequestsPending in interface MobicentsSipSession

setCopyRecordRouteHeadersOnSubsequentResponses

public void setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
Specified by:
setCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExt

getCopyRecordRouteHeadersOnSubsequentResponses

public boolean getCopyRecordRouteHeadersOnSubsequentResponses()
Specified by:
getCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExt

setSipSessionSecurity

public void setSipSessionSecurity(SipSessionSecurity sipSessionSecurity)
Specified by:
setSipSessionSecurity in interface MobicentsSipSession
Parameters:
sipSessionSecurity - the sipSessionSecurity to set

getSipSessionSecurity

public SipSessionSecurity getSipSessionSecurity()
Specified by:
getSipSessionSecurity in interface MobicentsSipSession
Returns:
the sipSessionSecurity

acquire

public void acquire()
Specified by:
acquire in interface MobicentsSipSession

release

public void release()
Specified by:
release in interface MobicentsSipSession


Copyright © 2011. All Rights Reserved.