|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nist.javax.sip.stack.MessageChannel
gov.nist.javax.sip.stack.SIPTransaction
gov.nist.javax.sip.stack.SIPServerTransaction
public class SIPServerTransaction
Represents a server transaction. Implements the following state machines.
|INVITE |pass INV to TU INVITE V send 100 if TU won't in 200ms send response+-----------+ +--------| |--------+101-199 from TU | | Proceeding| |send response +------->| |<-------+ | | Transport Err. | | Inform TU | |--------------->+ +-----------+ | 300-699 from TU | |2xx from TU | send response | |send response | | +------------------>+ | | INVITE V Timer G fires | send response+-----------+ send response | +--------| |--------+ | | | Completed | | | +------->| |<-------+ | +-----------+ | | | | ACK | | | - | +------------------>+ | Timer H fires | V or Transport Err.| +-----------+ Inform TU | | | | | Confirmed | | | | | +-----------+ | | | |Timer I fires | |- | | | V | +-----------+ | | | | | Terminated|<---------------+ | | +-----------+ Figure 7: INVITE server transaction Request received |pass to TU V +-----------+ | | | Trying |-------------+ | | | +-----------+ |200-699 from TU | |send response |1xx from TU | |send response | | | Request V 1xx from TU | send response+-----------+send response| +--------| |--------+ | | | Proceeding| | | +------->| |<-------+ | +<--------------| | | |Trnsprt Err +-----------+ | |Inform TU | | | | | | |200-699 from TU | | |send response | | Request V | | send response+-----------+ | | +--------| | | | | | Completed |<------------+ | +------->| | +<--------------| | |Trnsprt Err +-----------+ |Inform TU | | |Timer J fires | |- | | | V | +-----------+ | | | +-------------->| Terminated| | | +-----------+
Field Summary |
---|
Fields inherited from class gov.nist.javax.sip.stack.SIPTransaction |
---|
auditTag, CALLING_STATE, COMPLETED_STATE, CONFIRMED_STATE, INITIAL_STATE, PROCEEDING_STATE, TERMINATED_STATE, TRYING_STATE |
Method Summary | |
---|---|
boolean |
ackSeen()
This is book-keeping for retransmission filter management. |
void |
disableRetransmissionAlerts()
Disable retransmission Alerts and cancel associated timers. |
void |
enableRetransmissionAlerts()
Enable the timeout retransmit notifications for the ServerTransaction. |
boolean |
equals(Object other)
|
SIPServerTransaction |
getCanceledInviteTransaction()
TODO -- this method has to be added to the api. |
Dialog |
getDialog()
Gets the dialog object of this Transaction object. |
SIPResponse |
getLastResponse()
Get the last response. |
SIPResponse |
getReliableProvisionalResponse()
|
MessageChannel |
getResponseChannel()
Returns this transaction. |
TransactionState |
getState()
Return the current transaction state according to the RFC 3261 transaction state machine. |
String |
getViaHost()
Get the host to assign for an outgoing Request via header. |
int |
getViaPort()
Get the port to assign for the via header of an outgoing message. |
boolean |
isMessagePartOfTransaction(SIPMessage messageToTest)
Deterines if the message is a part of this transaction. |
boolean |
isRetransmissionAlertEnabled()
|
boolean |
isTransactionMapped()
Return true if the transaction is known to stack. |
boolean |
prackRecieved()
Cancel the retransmit timer for the provisional response task. |
void |
processRequest(SIPRequest transactionRequest,
MessageChannel sourceChannel)
Process a new request message through this transaction. |
void |
releaseSem()
Release the transaction semaphore. |
void |
scheduleAckRemoval()
|
void |
sendMessage(SIPMessage messageToSend)
Send a response message through this transactionand onto the client. |
void |
sendResponse(Response response)
Sends the Response to a Request which is associated with this ServerTransaction. |
void |
setAckSeen()
This is book-keeping for retransmission filter management. |
void |
setDialog(SIPDialog sipDialog,
String dialogId)
set the dialog object. |
void |
setInviteTransaction(SIPServerTransaction st)
The INVITE Server Transaction corresponding to a CANCEL Server Transaction. |
void |
setMapped(boolean b)
|
void |
setOriginalRequest(SIPRequest originalRequest)
Set the original request. |
void |
setPendingSubscribe(SIPClientTransaction pendingSubscribeClientTx)
|
void |
setRequestInterface(ServerRequestInterface newRequestOf)
Sets the real RequestInterface this transaction encapsulates. |
void |
setState(TransactionState newState)
Sets a timeout after which the connection is closed (provided the server does not use the connection for outgoing requests in this time period) and calls the superclass to set state. |
void |
terminate()
Terminate this transaction and immediately release all stack resources associated with it. |
Methods inherited from class gov.nist.javax.sip.stack.MessageChannel |
---|
getHostPort, getKey, getKey, getPeerHostPort, getRawIpSourceAddress, getViaHostPort, logResponse, sendMessage, sendMessage |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.sip.Transaction |
---|
getApplicationData, getBranchId, getRequest, getRetransmitTimer, setApplicationData, setRetransmitTimer |
Method Detail |
---|
public void setRequestInterface(ServerRequestInterface newRequestOf)
newRequestOf
- RequestInterface to send messages to.public MessageChannel getResponseChannel()
public boolean isMessagePartOfTransaction(SIPMessage messageToTest)
isMessagePartOfTransaction
in class SIPTransaction
messageToTest
- Message to check if it is part of this transaction.
public boolean isTransactionMapped()
public void processRequest(SIPRequest transactionRequest, MessageChannel sourceChannel)
processRequest
in interface ServerRequestInterface
transactionRequest
- Request to process.sourceChannel
- Channel that received this message.public void sendMessage(SIPMessage messageToSend) throws IOException
sendMessage
in class SIPTransaction
messageToSend
- Response to process and send.
IOException
public String getViaHost()
SIPTransaction
getViaHost
in class SIPTransaction
public int getViaPort()
SIPTransaction
getViaPort
in class SIPTransaction
public SIPResponse getLastResponse()
getLastResponse
in class SIPTransaction
public void setOriginalRequest(SIPRequest originalRequest)
setOriginalRequest
in class SIPTransaction
originalRequest
- Request being handled.public void sendResponse(Response response) throws SipException
ServerTransaction
MessageFactory
and
then passes that Response to this method. The Response message gets sent out on
the network via the ListeningPoint information that is associated with
the SipProvider of this ServerTransaction.
This method implies that the application is functioning as either a UAS or a stateful proxy, hence the underlying implementation acts statefully. When a UAS sends a 2xx response to an INVITE, the server transaction is transitions to the TerminatedState. The implementation may delay physically removing ServerTransaction record from memory to catch retransmissions of the INVITE in accordance with the reccomendation of http://bugs.sipit.net/show_bug.cgi?id=769 .
ACK Processing and final response retransmission:
If a Dialog is associated
with the ServerTransaction then when the UAC sends the ACK ( the typical case for User Agents),
the Application ( i.e. Listener )
will see a ServerTransaction corresponding to the ACK and the corresponding
Dialog
presented to it. The ACK will be presented to the Listener only
once in this case. Retransmissions of the OK and filtering of ACK retransmission
are the responsibility of the Dialog layer of this specification. However
if no Dialog
is associated with the INVITE Transaction, the ACK will be presented
to the Application with a null Dialog in the RequestEvent
and there will be
no Dialog associated with the ACK Transaction
(i.e. Transaction.getDialog()
returns null).
In this case (when there is no Dialog associated with the original INVITE or ACK)
the Application is responsible for retransmission
of the OK for the INVITE if necessary (i.e. if it wants to manage its own dialog layer and
function as a User Agent) and for dealing with retransmissions of the ACK. This
requires that the three way handshake of an INVITE is managed by the UAS
application and not the implementation of this specification.
Note that Responses created via Dialog.createReliableProvisionalResponse(int)
should be sent using Dialog.sendReliableProvisionalResponse(Response)
sendResponse
in interface ServerTransaction
response
- the Response to send to the Request.
SipException
- if the SipProvider cannot send the Response for any
other reason.Response
public TransactionState getState()
getState
in interface Transaction
getState
in class SIPTransaction
public void setState(TransactionState newState)
setState
in class SIPTransaction
newState
- New state of this transaction.public boolean equals(Object other)
equals
in class Object
public Dialog getDialog()
SIPTransaction
getDialog
in interface Transaction
getDialog
in class SIPTransaction
Dialog
public void setDialog(SIPDialog sipDialog, String dialogId)
SIPTransaction
setDialog
in class SIPTransaction
sipDialog
- --
the dialog to set.dialogId
- --
the dialog id ot associate with the dialog.spublic void terminate() throws ObjectInUseException
Transaction
terminate
in interface Transaction
ObjectInUseException
- if the transaction cannot be terminated as
it is associated to a dialog.public SIPResponse getReliableProvisionalResponse()
public boolean prackRecieved()
public void enableRetransmissionAlerts() throws SipException
ServerTransaction
Timeout.RETRANSMIT
until the application calls Transaction.terminate()
or a
the listener receives a SipListener.processTransactionTerminated(TransactionTerminatedEvent)
callback.
Note that the stack calls
SipListener.processTransactionTerminated(TransactionTerminatedEvent)
asynchronously
after it removes the transaction some time after the Transaction state is set to
TransactionState.TERMINATED
;
after which, it maintains no record of the Transaction.
enableRetransmissionAlerts
in interface ServerTransaction
SipException
- if a Dialog is already associated with the ServerTransaction
when the method is called.public boolean isRetransmissionAlertEnabled()
public void disableRetransmissionAlerts()
public void setAckSeen()
public boolean ackSeen()
public void setMapped(boolean b)
public void setPendingSubscribe(SIPClientTransaction pendingSubscribeClientTx)
public void releaseSem()
SIPTransaction
releaseSem
in class SIPTransaction
public void setInviteTransaction(SIPServerTransaction st)
st
- -- the invite server tx corresponding to the cancel server transaction.public SIPServerTransaction getCanceledInviteTransaction()
getCanceledInviteTransaction
in interface ServerTransactionExt
public void scheduleAckRemoval() throws IllegalStateException
IllegalStateException
|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |