public class SIPServerTransactionImpl extends SIPTransactionImpl implements SIPServerTransaction
|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| | | +-----------+
Modifier and Type | Field and Description |
---|---|
protected String |
dialogId |
protected boolean |
isAckSeen |
applicationData, auditTag, baseTimerInterval, collectionTime, encapsulatedChannel, expiresTimerTask, isMapped, lastResponse, mergeId, originalRequest, originalRequestBranch, originalRequestBytes, originalRequestCSeqNumber, originalRequestHasPort, sipStack, T2, T4, timeoutTimerTicksLeft, timerD, timerI, timerK, toListener, transactionId, transactionTimerStarted
CONTENT_SUBTYPE_SDP, CONTENT_TYPE_APPLICATION
CALLING_STATE, COMPLETED_STATE, CONFIRMED_STATE, INITIAL_STATE, PROCEEDING_STATE, T1, TERMINATED_STATE, TIMER_A, TIMER_B, TIMER_F, TIMER_H, TIMER_J, TRYING_STATE
Modifier | Constructor and Description |
---|---|
protected |
SIPServerTransactionImpl(SIPTransactionStack sipStack,
MessageChannel newChannelToUse)
Creates a new server transaction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
ackSeen()
This is book-keeping for retransmission filter management.
|
void |
cleanUp() |
protected void |
cleanUpOnTimer() |
void |
disableRetransmissionAlerts()
Disable retransmission Alerts and cancel associated timers.
|
void |
enableRetransmissionAlerts()
Enable the timeout retransmit notifications for the ServerTransaction.
|
boolean |
equals(Object other) |
void |
fireRetransmissionTimer()
Called by the transaction stack when a retransmission timer fires.
|
void |
fireTimeoutTimer()
This method is called when this transaction's timeout timer has fired.
|
SIPServerTransaction |
getCanceledInviteTransaction()
TODO -- this method has to be added to the api.
|
Dialog |
getDialog()
Gets the dialog object of this Transaction object.
|
int |
getLastResponseStatusCode()
Get the last response status code.
|
long |
getPendingReliableCSeqNumber() |
String |
getPendingReliableResponseMethod() |
long |
getPendingReliableRSeqNumber() |
protected int |
getRealState()
Return the book-keeping information that we actually use.
|
byte[] |
getReliableProvisionalResponse() |
MessageChannel |
getResponseChannel()
Returns this transaction.
|
TransactionState |
getState()
Gets the current state of this transaction.
|
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)
Tests a message to see if it is part of this transaction.
|
boolean |
isRetransmissionAlertEnabled() |
void |
map()
Send out a trying response (only happens when the transaction is mapped).
|
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 |
resendLastResponseAsBytes() |
void |
scheduleAckRemoval() |
void |
sendMessage(SIPMessage messageToSend)
Process the message through the transaction and sends it to the SIP peer.
|
void |
sendReliableProvisionalResponse(Response relResponse) |
void |
sendResponse(Response response)
Sends the Response to a Request which is associated with this
ServerTransaction.
|
protected void |
sendResponse(SIPResponse transactionResponse)
Send a response.
|
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)
Sets the request message that this transaction handles.
|
void |
setPendingSubscribe(SIPClientTransaction pendingSubscribeClientTx) |
void |
setRequestInterface(ServerRequestInterface newRequestOf)
Sets the real RequestInterface this transaction encapsulates.
|
void |
setState(int newState)
Changes the state of this transaction.
|
void |
startTransactionTimer()
Start the timer that runs the transaction state machine.
|
protected void |
startTransactionTimerJ(long time)
Start the timer task.
|
void |
terminate()
Terminate this transaction and immediately release all stack resources
associated with it.
|
void |
waitForTermination() |
acquireSem, addEventListener, cancelMaxTxLifeTimeTimer, close, disableRetransmissionTimer, disableTimeoutTimer, doesCancelMatchTransaction, enableRetransmissionTimer, enableRetransmissionTimer, enableTimeoutTimer, extractCertIdentities, fireTimer, getApplicationData, getAuditTag, getBaseTimerInterval, getBranch, getBranchId, getCipherSuite, getCSeq, getForkId, getHost, getInternalState, getKey, getLastResponse, getLocalCertificates, getMergeId, getMessageChannel, getMessageProcessor, getMethod, getOriginalRequest, getPeerAddress, getPeerCertificates, getPeerInetAddress, getPeerPacketSourceAddress, getPeerPacketSourcePort, getPeerPort, getPeerProtocol, getPort, getReleaseReferencesStrategy, getRequest, getResponse, getRetransmitTimer, getSipProvider, getSIPStack, getT2, getT4, getTimerD, getTimerI, getTimerK, getTimerT2, getTimerT4, getTransactionId, getTransport, getViaHeader, hashCode, isByeTransaction, isCancelTransaction, isDialogCreatingTransaction, isInviteTransaction, isReliable, isSecure, isServerTransaction, isTerminated, isTransactionMapped, passToListener, raiseErrorEvent, raiseIOExceptionEvent, removeEventListener, scheduleMaxTxLifeTimeTimer, semRelease, sendMessage, setApplicationData, setAuditTag, setBranch, setCollectionTime, setEncapsulatedChannel, setForkId, setPassToListener, setReleaseReferencesStrategy, setRetransmitTimer, setTimerD, setTimerT2, setTimerT4, setTransactionMapped, testAndSetTransactionTerminatedEvent
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isTransactionMapped, setTransactionMapped
acquireSem, addEventListener, cancelMaxTxLifeTimeTimer, close, disableRetransmissionTimer, disableTimeoutTimer, doesCancelMatchTransaction, extractCertIdentities, fireTimer, getApplicationData, getAuditTag, getBaseTimerInterval, getBranch, getBranchId, getCipherSuite, getCSeq, getForkId, getHost, getInternalState, getKey, getLastResponse, getLocalCertificates, getMergeId, getMessageChannel, getMessageProcessor, getMethod, getOriginalRequest, getPeerAddress, getPeerCertificates, getPeerPacketSourceAddress, getPeerPacketSourcePort, getPeerPort, getPeerProtocol, getPort, getReleaseReferencesStrategy, getRequest, getResponse, getRetransmitTimer, getSipProvider, getSIPStack, getT2, getT4, getTimerD, getTimerI, getTimerK, getTimerT2, getTimerT4, getTransactionId, getTransport, getViaHeader, hashCode, isByeTransaction, isCancelTransaction, isDialogCreatingTransaction, isInviteTransaction, isReliable, isSecure, isServerTransaction, isTerminated, passToListener, raiseErrorEvent, raiseIOExceptionEvent, removeEventListener, scheduleMaxTxLifeTimeTimer, semRelease, setApplicationData, setAuditTag, setBranch, setCollectionTime, setEncapsulatedChannel, setForkId, setPassToListener, setReleaseReferencesStrategy, setRetransmitTimer, setTimerD, setTimerT2, setTimerT4, testAndSetTransactionTerminatedEvent
protected String dialogId
protected boolean isAckSeen
protected SIPServerTransactionImpl(SIPTransactionStack sipStack, MessageChannel newChannelToUse)
sipStack
- Transaction stack this transaction belongs to.newChannelToUse
- Channel to encapsulate.protected void sendResponse(SIPResponse transactionResponse) throws IOException
transactionResponse
- -- the response to sendIOException
public void setRequestInterface(ServerRequestInterface newRequestOf)
SIPServerTransaction
setRequestInterface
in interface SIPServerTransaction
newRequestOf
- RequestInterface to send messages to.SIPServerTransaction.setRequestInterface(android.gov.nist.javax.sip.stack.ServerRequestInterface)
public MessageChannel getResponseChannel()
SIPServerTransaction
getResponseChannel
in interface SIPServerTransaction
SIPServerTransaction.getResponseChannel()
public boolean isMessagePartOfTransaction(SIPMessage messageToTest)
SIPTransaction
isMessagePartOfTransaction
in interface SIPServerTransaction
isMessagePartOfTransaction
in interface SIPTransaction
isMessagePartOfTransaction
in class SIPTransactionImpl
messageToTest
- Message to check if it is part of this transaction.SIPServerTransaction.isMessagePartOfTransaction(android.gov.nist.javax.sip.message.SIPMessage)
public void map()
SIPServerTransaction
map
in interface SIPServerTransaction
SIPServerTransaction.map()
public void processRequest(SIPRequest transactionRequest, MessageChannel sourceChannel)
SIPServerTransaction
processRequest
in interface ServerRequestInterface
processRequest
in interface SIPServerTransaction
transactionRequest
- Request to process.sourceChannel
- Channel that received this message.SIPServerTransaction.processRequest(android.gov.nist.javax.sip.message.SIPRequest, android.gov.nist.javax.sip.stack.MessageChannel)
public void sendMessage(SIPMessage messageToSend) throws IOException
SIPTransaction
sendMessage
in interface SIPServerTransaction
sendMessage
in interface SIPTransaction
sendMessage
in class SIPTransactionImpl
messageToSend
- Message to send to the SIP peer.IOException
SIPServerTransaction.sendMessage(android.gov.nist.javax.sip.message.SIPMessage)
public String getViaHost()
SIPTransaction
getViaHost
in interface SIPServerTransaction
getViaHost
in interface SIPTransaction
getViaHost
in class SIPTransactionImpl
SIPServerTransaction.getViaHost()
public int getViaPort()
SIPTransaction
getViaPort
in interface SIPServerTransaction
getViaPort
in interface SIPTransaction
getViaPort
in class SIPTransactionImpl
SIPServerTransaction.getViaPort()
public void fireRetransmissionTimer()
SIPTransaction
fireRetransmissionTimer
in interface SIPTransaction
SIPTransaction.fireRetransmissionTimer()
public void resendLastResponseAsBytes() throws IOException
resendLastResponseAsBytes
in interface SIPServerTransaction
IOException
SIPServerTransaction.resendLastResponseAsBytes()
public void fireTimeoutTimer()
SIPTransaction
fireTimeoutTimer
in interface SIPTransaction
SIPTransaction.fireTimeoutTimer()
public int getLastResponseStatusCode()
SIPServerTransaction
getLastResponseStatusCode
in interface SIPServerTransaction
SIPServerTransaction.getLastResponseStatusCode()
public void setOriginalRequest(SIPRequest originalRequest)
SIPTransaction
setOriginalRequest
in interface SIPServerTransaction
setOriginalRequest
in interface SIPTransaction
setOriginalRequest
in class SIPTransactionImpl
originalRequest
- Request being handled.SIPServerTransaction.setOriginalRequest(android.gov.nist.javax.sip.message.SIPRequest)
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 SIPServerTransaction
sendResponse
in interface ServerTransaction
response
- the Response to send to the Request.SipException
- if the SipProvider cannot send the Response for any
other reason.SIPServerTransaction.sendResponse(android.javax.sip.message.Response)
protected int getRealState()
public TransactionState getState()
SIPTransaction
getState
in interface SIPServerTransaction
getState
in interface SIPTransaction
getState
in interface Transaction
getState
in class SIPTransactionImpl
SIPServerTransaction.getState()
public void setState(int newState)
SIPTransaction
setState
in interface SIPServerTransaction
setState
in interface SIPTransaction
setState
in class SIPTransactionImpl
newState
- New state of this transaction.SIPServerTransaction.setState(int)
public void startTransactionTimer()
SIPTransaction
startTransactionTimer
in interface SIPTransaction
SIPTransaction.startTransactionTimer()
protected void startTransactionTimerJ(long time)
public boolean equals(Object other)
equals
in interface SIPServerTransaction
equals
in class Object
SIPServerTransaction.equals(java.lang.Object)
public Dialog getDialog()
SIPTransaction
getDialog
in interface SIPServerTransaction
getDialog
in interface SIPTransaction
getDialog
in interface Transaction
getDialog
in class SIPTransactionImpl
SIPServerTransaction.getDialog()
public void setDialog(SIPDialog sipDialog, String dialogId)
SIPTransaction
setDialog
in interface SIPServerTransaction
setDialog
in interface SIPTransaction
setDialog
in class SIPTransactionImpl
sipDialog
- --
the dialog to set.dialogId
- --
the dialog id ot associate with the dialog.sSIPServerTransaction.setDialog(android.gov.nist.javax.sip.stack.SIPDialog, java.lang.String)
public void terminate() throws ObjectInUseException
Transaction
terminate
in interface SIPServerTransaction
terminate
in interface Transaction
ObjectInUseException
- if the transaction cannot be terminated as
it is associated to a dialog.SIPServerTransaction.terminate()
public void sendReliableProvisionalResponse(Response relResponse) throws SipException
sendReliableProvisionalResponse
in interface SIPServerTransaction
SipException
public byte[] getReliableProvisionalResponse()
getReliableProvisionalResponse
in interface SIPServerTransaction
SIPServerTransaction.getReliableProvisionalResponse()
public boolean prackRecieved()
SIPServerTransaction
prackRecieved
in interface SIPServerTransaction
SIPServerTransaction.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 SIPServerTransaction
enableRetransmissionAlerts
in interface ServerTransaction
SipException
- if a Dialog is already associated with the ServerTransaction
when the method is called.SIPServerTransaction.enableRetransmissionAlerts()
public boolean isRetransmissionAlertEnabled()
isRetransmissionAlertEnabled
in interface SIPServerTransaction
SIPServerTransaction.isRetransmissionAlertEnabled()
public void disableRetransmissionAlerts()
SIPServerTransaction
disableRetransmissionAlerts
in interface SIPServerTransaction
SIPServerTransaction.disableRetransmissionAlerts()
public void setAckSeen()
SIPServerTransaction
setAckSeen
in interface SIPServerTransaction
SIPServerTransaction.setAckSeen()
public boolean ackSeen()
SIPServerTransaction
ackSeen
in interface SIPServerTransaction
SIPServerTransaction.ackSeen()
public void setMapped(boolean b)
setMapped
in interface SIPServerTransaction
SIPServerTransaction.setMapped(boolean)
public void setPendingSubscribe(SIPClientTransaction pendingSubscribeClientTx)
setPendingSubscribe
in interface SIPServerTransaction
SIPServerTransaction.setPendingSubscribe(android.gov.nist.javax.sip.stack.SIPClientTransaction)
public void releaseSem()
SIPTransaction
releaseSem
in interface SIPServerTransaction
releaseSem
in interface SIPTransaction
releaseSem
in class SIPTransactionImpl
SIPServerTransaction.releaseSem()
public void setInviteTransaction(SIPServerTransaction st)
setInviteTransaction
in interface SIPServerTransaction
st
- -- the invite server tx corresponding to the cancel server transaction.public SIPServerTransaction getCanceledInviteTransaction()
getCanceledInviteTransaction
in interface ServerTransactionExt
getCanceledInviteTransaction
in interface SIPServerTransaction
public void scheduleAckRemoval() throws IllegalStateException
scheduleAckRemoval
in interface SIPServerTransaction
IllegalStateException
SIPServerTransaction.scheduleAckRemoval()
public void cleanUp()
cleanUp
in interface SIPServerTransaction
cleanUp
in interface SIPTransaction
cleanUp
in class SIPTransactionImpl
SIPServerTransaction.cleanUp()
protected void cleanUpOnTimer()
public String getPendingReliableResponseMethod()
getPendingReliableResponseMethod
in interface SIPServerTransaction
SIPServerTransaction.getPendingReliableResponseMethod()
public long getPendingReliableCSeqNumber()
getPendingReliableCSeqNumber
in interface SIPServerTransaction
SIPServerTransaction.getPendingReliableCSeqNumber()
public long getPendingReliableRSeqNumber()
getPendingReliableRSeqNumber
in interface SIPServerTransaction
SIPServerTransaction.getPendingReliableRSeqNumber()
public void waitForTermination()
waitForTermination
in interface SIPServerTransaction
SIPServerTransaction.waitForTermination()
Copyright © 2018. All Rights Reserved.