public class SipSessionImpl extends 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.
SipSession.State| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<Long,Boolean> |
acksReceived |
protected B2buaHelperImpl |
b2buaHelper |
protected boolean |
copyRecordRouteHeadersOnSubsequentResponses |
protected long |
creationTime
Creation time.
|
protected long |
cseq |
protected ConcurrentHashMap<String,MobicentsSipSession> |
derivedSipSessions |
protected MobicentsSipSessionFacade |
facade |
protected 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 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 Set<javax.sip.Transaction> |
ongoingTransactions |
protected String |
originalMethod |
protected boolean |
orphan |
protected 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 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 MobicentsSipApplicationSessionKey |
sipApplicationSessionKey |
protected SipFactoryImpl |
sipFactory |
protected Map<String,Object> |
sipSessionAttributeMap |
protected MobicentsSipSessionSecurity |
sipSessionSecurity |
protected SipSession.State |
state
Current state of the session, one of INTITIAL, EARLY, ESTABLISHED and TERMINATED.
|
protected Serializable |
stateInfo
AR state info
|
protected String |
subscriberURI
Subscriber URI should be set for outbound sessions, from requests created in the container.
|
protected Set<String> |
subscriptions |
protected String |
transport |
protected SipPrincipal |
userPrincipal |
| Modifier | Constructor and Description |
|---|---|
protected |
SipSessionImpl(SipSessionKey key,
SipFactoryImpl sipFactoryImpl,
MobicentsSipApplicationSession mobicentsSipApplicationSession) |
| Modifier and Type | Method and Description |
|---|---|
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) |
void |
addOngoingTransaction(javax.sip.Transaction transaction)
Add an ongoing tx to the session.
|
void |
addSubscription(MobicentsSipServletMessage sipServletMessageImpl) |
void |
cleanDialogInformation(boolean terminate) |
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(String method) |
boolean |
equals(Object obj) |
MobicentsSipSession |
findDerivedSipSession(String toTag) |
SipApplicationSession |
getApplicationSession() |
Object |
getAttribute(String name) |
protected Map<String,Object> |
getAttributeMap() |
Enumeration<String> |
getAttributeNames() |
B2buaHelperImpl |
getB2buaHelper() |
boolean |
getBypassLoadBalancer() |
boolean |
getBypassProxy() |
String |
getCallId() |
boolean |
getCopyRecordRouteHeadersOnSubsequentResponses() |
long |
getCreationTime() |
long |
getCseq() |
Iterator<MobicentsSipSession> |
getDerivedSipSessions() |
MobicentsSipSessionFacade |
getFacade() |
javax.sip.address.SipURI |
getFlow() |
String |
getHandler()
Retrieve the handler associated with this sip session
|
String |
getId() |
boolean |
getInvalidateWhenReady() |
SipSessionKey |
getKey() |
long |
getLastAccessedTime() |
Address |
getLocalParty() |
SipApplicationRouterInfo |
getNextSipApplicationRouterInfo() |
Set<javax.sip.Transaction> |
getOngoingTransactions() |
String |
getOutboundInterface() |
MobicentsSipSession |
getParentSession() |
ProxyImpl |
getProxy() |
SipApplicationRoutingRegion |
getRegion() |
SipApplicationRoutingRegion |
getRegionInternal() |
Address |
getRemoteParty() |
int |
getRequestsPending() |
Semaphore |
getSemaphore() |
javax.servlet.ServletContext |
getServletContext() |
javax.sip.Dialog |
getSessionCreatingDialog() |
SipServletRequestImpl |
getSessionCreatingTransactionRequest() |
MobicentsSipApplicationSession |
getSipApplicationSession() |
Map<String,Object> |
getSipSessionAttributeMap() |
MobicentsSipSessionSecurity |
getSipSessionSecurity() |
String |
getSipSubscriberURI() |
SipSession.State |
getState() |
Serializable |
getStateInfo() |
SipSession.State |
getStateInternal() |
URI |
getSubscriberURI() |
String |
getTransport() |
SipPrincipal |
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 |
isOrphan() |
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(String name) |
void |
removeAttribute(String name,
boolean byPassValidCheck) |
MobicentsSipSession |
removeDerivedSipSession(String toTag) |
void |
removeOngoingTransaction(javax.sip.Transaction transaction)
Remove an ongoing tx to the session.
|
void |
removeSubscription(MobicentsSipServletMessage sipServletMessageImpl) |
void |
scheduleAsynchronousWork(SipSessionAsynchronousWork work) |
void |
setAckReceived(long cSeq,
boolean ackReceived)
Setting ackReceived for CSeq to specified value in second param.
|
void |
setAttribute(String key,
Object attribute) |
void |
setB2buaHelper(MobicentsB2BUAHelper helperImpl) |
void |
setBypassLoadBalancer(boolean bypassLoadBalancer) |
void |
setBypassProxy(boolean bypassProxy) |
void |
setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses) |
void |
setCseq(long cseq) |
void |
setFlow(javax.sip.address.SipURI flow) |
void |
setHandler(String name) |
void |
setInvalidateWhenReady(boolean arg0) |
void |
setKey(SipSessionKey key) |
void |
setLocalParty(Address localParty) |
void |
setNextSipApplicationRouterInfo(SipApplicationRouterInfo routerInfo) |
void |
setOrphan(boolean orphan) |
void |
setOutboundInterface(InetAddress inetAddress) |
void |
setOutboundInterface(InetSocketAddress inetSocketAddress) |
void |
setOutboundInterface(SipURI outboundInterface) |
void |
setParentSession(MobicentsSipSession mobicentsSipSession) |
void |
setProxy(MobicentsProxy 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(MobicentsSipServletMessage message) |
protected void |
setSipApplicationSession(MobicentsSipApplicationSession sipApplicationSession) |
void |
setSipSessionAttributeMap(Map<String,Object> sipSessionAttributeMap) |
void |
setSipSessionSecurity(MobicentsSipSessionSecurity sipSessionSecurity) |
void |
setSipSubscriberURI(String subscriberURI) |
void |
setState(SipSession.State state) |
void |
setStateInfo(Serializable stateInfo) |
void |
setTransport(String transport) |
void |
setUserPrincipal(SipPrincipal userPrincipal) |
void |
setValid(boolean isValid) |
String |
toString() |
void |
updateStateOnResponse(MobicentsSipServletResponse 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(MobicentsSipServletRequest 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(MobicentsSipServletRequest sipServletRequest) |
protected transient MobicentsSipApplicationSessionKey sipApplicationSessionKey
protected transient MobicentsSipApplicationSession sipApplicationSession
protected ProxyImpl proxy
protected B2buaHelperImpl b2buaHelper
protected transient int requestsPending
protected transient SipSessionKey key
protected transient SipPrincipal userPrincipal
protected long cseq
protected String transport
protected long creationTime
protected long lastAccessedTime
protected transient SipApplicationRoutingRegion routingRegion
protected transient Serializable stateInfo
protected transient SipApplicationRouterInfo nextSipApplicationRouterInfo
protected SipSession.State state
protected AtomicBoolean isValidInternal
protected transient boolean isValid
protected String handlerServlet
protected transient String subscriberURI
protected transient String outboundInterface
protected transient javax.sip.Dialog sessionCreatingDialog
protected transient SipServletRequestImpl sessionCreatingTransactionRequest
protected transient boolean isSessionCreatingTransactionServer
protected transient Set<javax.sip.Transaction> ongoingTransactions
protected transient volatile ConcurrentHashMap<String,MobicentsSipSession> derivedSipSessions
protected transient SipFactoryImpl sipFactory
protected boolean invalidateWhenReady
protected boolean readyToInvalidate
protected transient MobicentsSipSession parentSession
protected transient Address localParty
protected transient Address remoteParty
protected transient String originalMethod
protected transient boolean okToByeSentOrReceived
protected transient boolean copyRecordRouteHeadersOnSubsequentResponses
protected transient Semaphore semaphore
protected transient MobicentsSipSessionFacade facade
protected transient ConcurrentHashMap<Long,Boolean> acksReceived
protected transient MobicentsSipSessionSecurity sipSessionSecurity
protected boolean orphan
protected SipSessionImpl(SipSessionKey key, SipFactoryImpl sipFactoryImpl, MobicentsSipApplicationSession mobicentsSipApplicationSession)
public void notifySipSessionListeners(SipSessionEventType sipSessionEventType)
notifySipSessionListeners in interface MobicentsSipSessionsipSessionEventType - the type of event that happenedpublic SipServletRequest createRequest(String method)
createRequest in interface SipSessionpublic SipApplicationSession getApplicationSession()
getApplicationSession in interface SipSessionpublic Object getAttribute(String name)
getAttribute in interface SipSessionpublic Enumeration<String> getAttributeNames()
getAttributeNames in interface SipSessionpublic String getCallId()
getCallId in interface SipSessionpublic long getCreationTime()
getCreationTime in interface SipSessionpublic String getId()
getId in interface SipSessionpublic long getLastAccessedTime()
getLastAccessedTime in interface SipSessionpublic void access()
access in interface MobicentsSipSessionpublic Address getLocalParty()
getLocalParty in interface SipSessionpublic SipApplicationRoutingRegion getRegion()
getRegion in interface SipSessionpublic SipApplicationRoutingRegion getRegionInternal()
getRegionInternal in interface MobicentsSipSessionpublic void setRoutingRegion(SipApplicationRoutingRegion routingRegion)
setRoutingRegion in interface MobicentsSipSessionroutingRegion - the region that the application is inpublic Serializable getStateInfo()
getStateInfo in interface MobicentsSipSessionpublic void setStateInfo(Serializable stateInfo)
setStateInfo in interface MobicentsSipSessionstateInfo - the stateInfo to setpublic Address getRemoteParty()
getRemoteParty in interface SipSessionpublic SipSession.State getState()
getState in interface SipSessionpublic SipSession.State getStateInternal()
public URI getSubscriberURI()
getSubscriberURI in interface SipSessionpublic void invalidate()
invalidate in interface SipSessionpublic void invalidate(boolean bypassCheck)
invalidate in interface MobicentsSipSessionprotected boolean hasOngoingTransaction()
public boolean isValid()
isValid in interface SipSessionpublic boolean isValidInternal()
isValidInternal in interface MobicentsSipSessionpublic void setValid(boolean isValid)
isValid - the isValid to setpublic void removeAttribute(String name)
removeAttribute in interface SipSessionpublic void removeAttribute(String name, boolean byPassValidCheck)
public void setAttribute(String key, Object attribute)
setAttribute in interface SipSessionpublic void setHandler(String name) throws javax.servlet.ServletException
setHandler in interface SipSessionjavax.servlet.ServletExceptionpublic String getHandler()
getHandler in interface MobicentsSipSessionpublic void setSessionCreatingDialog(javax.sip.Dialog dialog)
setSessionCreatingDialog in interface MobicentsSipSessiondialog - the dialog to setpublic javax.sip.Dialog getSessionCreatingDialog()
getSessionCreatingDialog in interface MobicentsSipSessionpublic MobicentsSipApplicationSession getSipApplicationSession()
getSipApplicationSession in interface MobicentsSipSessionprotected void setSipApplicationSession(MobicentsSipApplicationSession sipApplicationSession)
public SipServletRequestImpl getSessionCreatingTransactionRequest()
getSessionCreatingTransactionRequest in interface MobicentsSipSessionpublic void setSessionCreatingTransactionRequest(MobicentsSipServletMessage message)
setSessionCreatingTransactionRequest in interface MobicentsSipSessionsessionCreatingTransaction - the sessionCreatingTransaction to setpublic boolean isSupervisedMode()
public void setSipSubscriberURI(String subscriberURI)
setSipSubscriberURI in interface MobicentsSipSessionpublic String getSipSubscriberURI()
getSipSubscriberURI in interface MobicentsSipSessionpublic String getOutboundInterface()
getOutboundInterface in interface MobicentsSipSessionpublic void onDialogTimeout(javax.sip.Dialog dialog)
public void setState(SipSession.State state)
setState in interface MobicentsSipSessionpublic void onTerminatedState()
onTerminatedState in interface MobicentsSipSessionpublic void addOngoingTransaction(javax.sip.Transaction transaction)
addOngoingTransaction in interface MobicentsSipSessionpublic void removeOngoingTransaction(javax.sip.Transaction transaction)
removeOngoingTransaction in interface MobicentsSipSessionpublic void cleanDialogInformation(boolean terminate)
cleanDialogInformation in interface MobicentsSipSessionpublic Set<javax.sip.Transaction> getOngoingTransactions()
getOngoingTransactions in interface MobicentsSipSessionpublic void updateStateOnResponse(MobicentsSipServletResponse response, boolean receive)
updateStateOnResponse in interface MobicentsSipSessionresponse - the response received/to sendreceive - true if the response has been received, false if it is to be sent.public void updateStateOnSubsequentRequest(MobicentsSipServletRequest request, boolean receive)
updateStateOnSubsequentRequest in interface MobicentsSipSessionrequest - the subsequent request received/to sendreceive - true if the subsequent request has been received, false if it is to be sent.public void onReadyToInvalidate()
onReadyToInvalidate in interface MobicentsSipSessionpublic SipSessionKey getKey()
getKey in interface MobicentsSipSessionpublic void setKey(SipSessionKey key)
key - the key to setpublic ProxyImpl getProxy()
getProxy in interface MobicentsSipSessionpublic void setProxy(MobicentsProxy proxy)
setProxy in interface MobicentsSipSessionpublic void setB2buaHelper(MobicentsB2BUAHelper helperImpl)
setB2buaHelper in interface MobicentsSipSessionpublic B2buaHelperImpl getB2buaHelper()
getB2buaHelper in interface MobicentsSipSessionpublic void passivate()
public void activate()
public SipPrincipal getUserPrincipal()
getUserPrincipal in interface MobicentsSipSessionpublic void setUserPrincipal(SipPrincipal userPrincipal)
setUserPrincipal in interface MobicentsSipSessionpublic boolean getInvalidateWhenReady()
getInvalidateWhenReady in interface SipSessionpublic boolean isReadyToInvalidate()
isReadyToInvalidate in interface SipSessionpublic void setReadyToInvalidate(boolean readyToInvalidate)
readyToInvalidate - the readyToInvalidate to setpublic boolean isReadyToInvalidateInternal()
isReadyToInvalidateInternal in interface MobicentsSipSessionpublic void setInvalidateWhenReady(boolean arg0)
setInvalidateWhenReady in interface SipSessionpublic void setOutboundInterface(InetAddress inetAddress)
setOutboundInterface in interface SipSessionpublic void setOutboundInterface(InetSocketAddress inetSocketAddress)
setOutboundInterface in interface SipSessionpublic void setOutboundInterface(SipURI outboundInterface)
setOutboundInterface in interface SipSessionExtpublic javax.servlet.ServletContext getServletContext()
getServletContext in interface SipSessionpublic MobicentsSipSession removeDerivedSipSession(String toTag)
removeDerivedSipSession in interface MobicentsSipSessionpublic MobicentsSipSession findDerivedSipSession(String toTag)
findDerivedSipSession in interface MobicentsSipSessionpublic Iterator<MobicentsSipSession> getDerivedSipSessions()
getDerivedSipSessions in interface MobicentsSipSessionpublic void setParentSession(MobicentsSipSession mobicentsSipSession)
setParentSession in interface MobicentsSipSessionpublic MobicentsSipSession getParentSession()
getParentSession in interface MobicentsSipSessionpublic void setSipSessionAttributeMap(Map<String,Object> sipSessionAttributeMap)
setSipSessionAttributeMap in interface MobicentsSipSessionpublic void addDerivedSipSessions(MobicentsSipSession derivedSession)
addDerivedSipSessions in interface MobicentsSipSessionpublic Map<String,Object> getSipSessionAttributeMap()
getSipSessionAttributeMap in interface MobicentsSipSessionpublic void setLocalParty(Address localParty)
setLocalParty in interface MobicentsSipSessionpublic void setRemoteParty(Address remoteParty)
setRemoteParty in interface MobicentsSipSessionpublic void addSubscription(MobicentsSipServletMessage sipServletMessageImpl) throws javax.sip.SipException
addSubscription in interface MobicentsSipSessionjavax.sip.SipExceptionpublic void removeSubscription(MobicentsSipServletMessage sipServletMessageImpl)
removeSubscription in interface MobicentsSipSessionpublic Semaphore getSemaphore()
public MobicentsSipSessionFacade getFacade()
getFacade in interface MobicentsSipSessionpublic SipApplicationRouterInfo getNextSipApplicationRouterInfo()
getNextSipApplicationRouterInfo in interface MobicentsSipSessionpublic void setNextSipApplicationRouterInfo(SipApplicationRouterInfo routerInfo)
setNextSipApplicationRouterInfo in interface MobicentsSipSessionpublic void setAckReceived(long cSeq,
boolean ackReceived)
setAckReceived in interface MobicentsSipSessioncSeq - cseq to set the ackReceivedackReceived - whether or not the ack has been received for this cseqprotected boolean isAckReceived(long cSeq)
cSeq - CSeq number to check if the ack has already been receivedprotected void cleanupAcksReceived(long remoteCSeq)
remoteCSeq - remoteCSeq the basis CSeq for cleaning up earlier (lower CSeq) stored ackReceivedpublic long getCseq()
getCseq in interface MobicentsSipSessionpublic void setCseq(long cseq)
setCseq in interface MobicentsSipSessionpublic boolean validateCSeq(MobicentsSipServletRequest sipServletRequest)
validateCSeq in interface MobicentsSipSessionpublic String getTransport()
getTransport in interface MobicentsSipSessionpublic void setTransport(String transport)
setTransport in interface MobicentsSipSessionpublic void scheduleAsynchronousWork(SipSessionAsynchronousWork work)
scheduleAsynchronousWork in interface SipSessionExtpublic int getRequestsPending()
getRequestsPending in interface MobicentsSipSessionpublic void setRequestsPending(int requests)
setRequestsPending in interface MobicentsSipSessionpublic void setCopyRecordRouteHeadersOnSubsequentResponses(boolean copyRecordRouteHeadersOnSubsequentResponses)
setCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExtpublic boolean getCopyRecordRouteHeadersOnSubsequentResponses()
getCopyRecordRouteHeadersOnSubsequentResponses in interface SipSessionExtpublic void setSipSessionSecurity(MobicentsSipSessionSecurity sipSessionSecurity)
setSipSessionSecurity in interface MobicentsSipSessionsipSessionSecurity - the sipSessionSecurity to setpublic MobicentsSipSessionSecurity getSipSessionSecurity()
getSipSessionSecurity in interface MobicentsSipSessionpublic void acquire()
acquire in interface MobicentsSipSessionpublic void release()
release in interface MobicentsSipSessionpublic void setFlow(javax.sip.address.SipURI flow)
setFlow in interface MobicentsSipSessionpublic javax.sip.address.SipURI getFlow()
getFlow in interface MobicentsSipSessionpublic boolean isOrphan()
isOrphan in interface MobicentsSipSessionpublic void setOrphan(boolean orphan)
setOrphan in interface MobicentsSipSessionpublic void setBypassLoadBalancer(boolean bypassLoadBalancer)
setBypassLoadBalancer in interface SipSessionExtpublic boolean getBypassLoadBalancer()
getBypassLoadBalancer in interface SipSessionExtpublic void setBypassProxy(boolean bypassProxy)
setBypassProxy in interface SipSessionExtpublic boolean getBypassProxy()
getBypassProxy in interface SipSessionExtCopyright © 2016. All Rights Reserved.