|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SipSession
Represents point-to-point SIP relationships. It roughly corresponds to a SIP dialog. In particular, for UAs it maintains (or is otherwise associated with) dialog state so as to be able to create subequent requests belonging to that dialog (using createRequest). For UACs, SipSession extend the notion of SIP dialogs to have well-defined state before a dialog has been established and after a final non-2xx terminates an early dialog. This allows UACs to create "subsequent" requests without having an established dialog. The effect is that the subsequent request will have the same Call-ID, From and To headers (with the same From tag and without a To tag), the will exist in the same CSeq space. All messages are potentially associated with a SipSession. The SipSession can be retrieved from the message by calling SipServletMessage.getSession().
| Nested Class Summary | |
|---|---|
static class |
SipSession.State
Possible SIP dialog states from SipSession FSM. |
| Method Summary | |
|---|---|
SipServletRequest |
createRequest(String method)
Returns a new request object. |
SipApplicationSession |
getApplicationSession()
Returns the application session with which this SipSession is associated. |
Object |
getAttribute(String name)
Returns the object bound with the specified name in this session, or null if no object is bound under the name. |
Enumeration<String> |
getAttributeNames()
Returns an Enumeration over the String objects containing the names of all the objects bound to this session. |
String |
getCallId()
Returns the Call-ID for this SipSession. |
long |
getCreationTime()
Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. |
String |
getId()
Returns a string containing the unique identifier assigned to this session. |
boolean |
getInvalidateWhenReady()
Returns true if the container will notify the application when this SipSession is in the ready-to-invalidate state. |
long |
getLastAccessedTime()
Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT. |
Address |
getLocalParty()
Returns the Address identifying the local party. |
SipApplicationRoutingRegion |
getRegion()
This method allows the application to obtain the region it was invoked in for this SipSession. |
Address |
getRemoteParty()
Returns the Address identifying the remote party. |
javax.servlet.ServletContext |
getServletContext()
Returns the ServletContext to which this session belongs. |
SipSession.State |
getState()
Returns the current SIP dialog state, which is one of INITIAL, EARLY, CONFIRMED, or TERMINATED. |
URI |
getSubscriberURI()
Returns the URI of the subscriber for which this application is invoked to serve. |
void |
invalidate()
Invalidates this session and unbinds any objects bound to it. |
boolean |
isReadyToInvalidate()
Returns true if this session is in a ready-to-invalidate state. |
boolean |
isValid()
Returns true if this SipSession is valid, false otherwise. |
void |
removeAttribute(String name)
Removes the object bound with the specified name from this session. |
void |
setAttribute(String name,
Object attribute)
Binds an object to this session, using the name specified. |
void |
setHandler(String name)
Sets the handler for this SipSession. |
void |
setInvalidateWhenReady(boolean invalidateWhenReady)
Specifies whether the container should notify the application when the SipSession is in the ready-to-invalidate state as defined above. |
void |
setOutboundInterface(InetAddress address)
In multi-homed environment this method can be used to select the outbound interface and port number to use for proxy branches. |
void |
setOutboundInterface(InetSocketAddress address)
In multi-homed environment this method can be used to select the outbound interface and port number to use for proxy branches. |
| Method Detail |
|---|
SipServletRequest createRequest(String method)
IllegalArgumentException - if method is not a syntactically valid SIP method or if it's "ACK" or "CANCEL"
IllegalStateException - if this SipSession has been invalidated or if this SipSession is in the INITIAL state and there is an ongoing transaction or if this SipSession is in the TERMINATED stateSipApplicationSession getApplicationSession()
Object getAttribute(String name)
Enumeration<String> getAttributeNames()
String getCallId()
long getCreationTime()
String getId()
boolean getInvalidateWhenReady()
IllegalStateException - if this method is called on an invalidated sessionvoid setInvalidateWhenReady(boolean invalidateWhenReady)
invalidateWhenReady - if true, the container will observe this session and
notify the application when it is in the ready-to-invalidate state.
The session is not observed if the flag is false.
The default is true for v1.1 applications and false for v1.0 applications.
IllegalStateException - if this method is called on an invalidated sessionlong getLastAccessedTime()
Address getLocalParty()
SipApplicationRoutingRegion getRegion()
SipSession.getSubscriberURI()
If this SipSession is created when this servlet receives an initial request,
this method returns the region in which this servlet is invoked.
The SipApplicationRoutingRegion is only available if this SipSession received an initial request.
Otherwise, this method throws IllegalStateException.
IllegalStateException - if this method is called on an invalidated sessionAddress getRemoteParty()
javax.servlet.ServletContext getServletContext()
SipSession.State getState()
URI getSubscriberURI()
IllegalStateException - if this method is called on an invalidated sessionvoid invalidate()
boolean isValid()
boolean isReadyToInvalidate()
IllegalStateException - if this method is called on an invalidated sessionvoid removeAttribute(String name)
void setAttribute(String name,
Object attribute)
void setHandler(String name)
throws javax.servlet.ServletException
javax.servlet.ServletExceptionvoid setOutboundInterface(InetAddress address)
address - the socket address representing the outbound interface to use when forwarding requests with this proxy
NullPointerException - on null address
IllegalArgumentException - if the address is not understood by the container as one of its outbound interfacevoid setOutboundInterface(InetSocketAddress address)
address - the address which represents the outbound interface
NullPointerException - on null address
IllegalArgumentException - if the address is not understood by the container as one of its outbound interface
IllegalStateException - if this method is called on an invalidated session
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||