public class SIPClientTransactionImpl extends SIPTransactionImpl implements SIPClientTransaction
|INVITE from TU
Timer A fires |INVITE sent
Reset A, V Timer B fires
INVITE sent +-----------+ or Transport Err.
+---------| |---------------+inform TU
| | Calling | |
+-------->| |-------------->|
+-----------+ 2xx |
| | 2xx to TU |
| |1xx |
300-699 +---------------+ |1xx to TU |
ACK sent | | |
resp. to TU | 1xx V |
| 1xx to TU -----------+ |
| +---------| | |
| | |Proceeding |-------------->|
| +-------->| | 2xx |
| +-----------+ 2xx to TU |
| 300-699 | |
| ACK sent, | |
| resp. to TU| |
| | | NOTE:
| 300-699 V |
| ACK sent +-----------+Transport Err. | transitions
| +---------| |Inform TU | labeled with
| | | Completed |-------------->| the event
| +-------->| | | over the action
| +-----------+ | to take
| ˆ | |
| | | Timer D fires |
+--------------+ | - |
| |
V |
+-----------+ |
| | |
| Terminated|<--------------+
| |
+-----------+
Figure 5: INVITE client transaction
|Request from TU
|send request
Timer E V
send request +-----------+
+---------| |-------------------+
| | Trying | Timer F |
+-------->| | or Transport Err.|
+-----------+ inform TU |
200-699 | | |
resp. to TU | |1xx |
+---------------+ |resp. to TU |
| | |
| Timer E V Timer F |
| send req +-----------+ or Transport Err. |
| +---------| | inform TU |
| | |Proceeding |------------------>|
| +-------->| |-----+ |
| +-----------+ |1xx |
| | ˆ |resp to TU |
| 200-699 | +--------+ |
| resp. to TU | |
| | |
| V |
| +-----------+ |
| | | |
| | Completed | |
| | | |
| +-----------+ |
| ˆ | |
| | | Timer K |
+--------------+ | - |
| |
V |
NOTE: +-----------+ |
| | |
transitions | Terminated|<------------------+
labeled with | |
the event +-----------+
over the action
to take
Figure 6: non-INVITE client transaction
| Modifier and Type | Class and Description |
|---|---|
class |
SIPClientTransactionImpl.TransactionTimer |
applicationData, auditTag, baseTimerInterval, collectionTime, encapsulatedChannel, expiresTimerTask, isMapped, lastResponse, mergeId, originalRequest, originalRequestBranch, originalRequestBytes, originalRequestCSeqNumber, originalRequestHasPort, sipStack, T2, T4, timeoutTimerTicksLeft, timerD, timerI, timerK, toListener, transactionId, transactionTimerStartedCALLING_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 |
SIPClientTransactionImpl(SIPTransactionStack newSIPStack,
MessageChannel newChannelToUse)
Creates a new client transaction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
alertIfStillInCallingStateBy(int count)
Send a transaction timeout event to the application if Tx is still in Calling state in the
given time period ( in base timer interval count ) after sending request.
|
boolean |
checkFromTag(SIPResponse sipResponse)
Check if the From tag of the response matches the from tag of the original message.
|
void |
cleanUp() |
protected void |
cleanUpOnTerminated() |
protected void |
cleanUpOnTimer() |
void |
clearState()
This is called by the stack after a non-invite client transaction goes to completed state.
|
Request |
createAck()
Creates a new Ack message from the Request associated with this client
transaction.
|
Request |
createCancel()
Creates a new Cancel message from the Request associated with this client
transaction.
|
void |
fireRetransmissionTimer()
Called by the transaction stack when a retransmission timer fires.
|
void |
fireTimeoutTimer()
Called by the transaction stack when a timeout timer fires.
|
SIPDialog |
getDefaultDialog()
Get the default dialog that was originally assigned to the client transaction.
|
Dialog |
getDialog()
Gets the dialog object of this Transaction object.
|
SIPDialog |
getDialog(String dialogId) |
Hop |
getNextHop()
Reeturn the previously computed next hop (avoid computing it twice).
|
String |
getOriginalRequestCallId() |
Contact |
getOriginalRequestContact() |
Event |
getOriginalRequestEvent() |
String |
getOriginalRequestFromTag() |
String |
getOriginalRequestScheme() |
Via |
getOutgoingViaHeader()
get the via header for an outgoing request.
|
MessageChannel |
getRequestChannel()
Returns 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 |
isNotifyOnRetransmit() |
void |
processResponse(SIPResponse sipResponse,
MessageChannel incomingChannel)
This method is called prior to dialog assignment.
|
void |
processResponse(SIPResponse transactionResponse,
MessageChannel sourceChannel,
SIPDialog dialog)
Process a new response message through this transaction.
|
void |
sendMessage(SIPMessage messageToSend)
Process the message through the transaction and sends it to the SIP peer.
|
void |
sendRequest()
Sends the Request which created this ClientTransaction.
|
void |
setDialog(SIPDialog sipDialog,
String dialogId)
set the dialog object.
|
void |
setNextHop(Hop hop)
Set the next hop ( if it has already been computed).
|
void |
setNotifyOnRetransmit(boolean notifyOnRetransmit)
Set this flag if you want your Listener to get Timeout.RETRANSMIT notifications each time a
retransmission occurs.
|
void |
setResponseInterface(ServerResponseInterface newRespondTo)
Sets the real ResponseInterface this transaction encapsulates.
|
void |
setState(int newState)
Changes the state of this transaction.
|
void |
setViaHost(String host)
Set the port of the recipient.
|
void |
setViaPort(int port)
Set the port of the recipient.
|
void |
startTransactionTimer()
Start the timer task.
|
void |
stopExpiresTimer()
Stop the ExPIRES timer if it is running.
|
void |
terminate()
Terminate this transaction and immediately release all stack resources
associated with it.
|
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, getRequest, getResponse, getRetransmitTimer, getSipProvider, getSIPStack, getState, getT2, getT4, getTimerD, getTimerI, getTimerK, getTimerT2, getTimerT4, getTransactionId, getTransport, getViaHeader, hashCode, isByeTransaction, isCancelTransaction, isDialogCreatingTransaction, isInviteTransaction, isReleaseReferences, isReliable, isSecure, isServerTransaction, isTerminated, isTransactionMapped, passToListener, raiseErrorEvent, raiseIOExceptionEvent, releaseSem, removeEventListener, scheduleMaxTxLifeTimeTimer, semRelease, sendMessage, setApplicationData, setAuditTag, setBranch, setCollectionTime, setEncapsulatedChannel, setForkId, setOriginalRequest, setPassToListener, setReleaseReferences, setRetransmitTimer, setTimerD, setTimerT2, setTimerT4, setTransactionMapped, testAndSetTransactionTerminatedEventclone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitisSecureacquireSem, 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, getRequest, getResponse, getRetransmitTimer, getSipProvider, getSIPStack, getState, getT2, getT4, getTimerD, getTimerI, getTimerK, getTimerT2, getTimerT4, getTransactionId, getTransport, getViaHeader, hashCode, isByeTransaction, isCancelTransaction, isDialogCreatingTransaction, isInviteTransaction, isReleaseReferences, isReliable, isSecure, isServerTransaction, isTerminated, isTransactionMapped, passToListener, raiseErrorEvent, raiseIOExceptionEvent, releaseSem, removeEventListener, scheduleMaxTxLifeTimeTimer, semRelease, setApplicationData, setAuditTag, setBranch, setCollectionTime, setEncapsulatedChannel, setForkId, setOriginalRequest, setPassToListener, setReleaseReferences, setRetransmitTimer, setTimerD, setTimerT2, setTimerT4, setTransactionMapped, testAndSetTransactionTerminatedEventprotected SIPClientTransactionImpl(SIPTransactionStack newSIPStack, MessageChannel newChannelToUse)
newSIPStack - Transaction stack this transaction belongs to.newChannelToUse - Channel to encapsulate.public void setResponseInterface(ServerResponseInterface newRespondTo)
SIPClientTransactionsetResponseInterface in interface SIPClientTransactionnewRespondTo - ResponseInterface to send messages to.SIPClientTransaction.setResponseInterface(gov.nist.javax.sip.stack.ServerResponseInterface)public MessageChannel getRequestChannel()
SIPClientTransactiongetRequestChannel in interface SIPClientTransactionSIPClientTransaction.getRequestChannel()public boolean isMessagePartOfTransaction(SIPMessage messageToTest)
SIPTransactionisMessagePartOfTransaction in interface SIPClientTransactionisMessagePartOfTransaction in interface SIPTransactionisMessagePartOfTransaction in class SIPTransactionImplmessageToTest - Message to check if it is part of this transaction.SIPClientTransaction.isMessagePartOfTransaction(gov.nist.javax.sip.message.SIPMessage)public void sendMessage(SIPMessage messageToSend) throws IOException
SIPTransactionsendMessage in interface SIPClientTransactionsendMessage in interface SIPTransactionsendMessage in class SIPTransactionImplmessageToSend - Message to send to the SIP peer.IOExceptionSIPClientTransaction.sendMessage(gov.nist.javax.sip.message.SIPMessage)public void processResponse(SIPResponse transactionResponse, MessageChannel sourceChannel, SIPDialog dialog)
SIPClientTransactionprocessResponse in interface ServerResponseInterfaceprocessResponse in interface SIPClientTransactiontransactionResponse - Response to process.sourceChannel - Channel that received this message.dialog - -- dialog for this responseSIPClientTransaction.processResponse(gov.nist.javax.sip.message.SIPResponse,
gov.nist.javax.sip.stack.MessageChannel, gov.nist.javax.sip.stack.SIPDialog)public void sendRequest()
throws SipException
ClientTransactionMessageFactory and then creates a new
ClientTransaction from
SipProvider.getNewClientTransaction(Request). Calling this method
on the ClientTransaction sends the Request onto the network. The Request
message gets sent via the ListeningPoint information of the SipProvider
that is associated to this ClientTransaction.
This method assumes that the Request is sent out of Dialog. It uses the Router to determine the next hop. If the Router returns a empty iterator, and a Dialog is associated with the outgoing request of the Transaction then the Dialog route set is used to send the outgoing request.
This method implies that the application is functioning as either a UAC or a stateful proxy, hence the underlying implementation acts statefully.
sendRequest in interface SIPClientTransactionsendRequest in interface ClientTransactionSipException - if the SipProvider cannot send the Request for any
reason.SIPClientTransaction.sendRequest()public void fireRetransmissionTimer()
fireRetransmissionTimer in interface SIPTransactionpublic void fireTimeoutTimer()
fireTimeoutTimer in interface SIPTransactionpublic Request createCancel() throws SipException
ClientTransaction
Note that both the transaction corresponding to the original request and
the CANCEL transaction will complete independently. However, a UAC
canceling a request cannot rely on receiving a 487 (Request Terminated)
response for the original request, as an RFC 2543 compliant UAS will
not generate such a response. Therefore if there is no final response for
the original request the application will receieve a TimeoutEvent with
Timeout.TRANSACTION and the client should then consider the
original transaction cancelled.
createCancel in interface SIPClientTransactioncreateCancel in interface ClientTransactionSipException - if this method is called to cancel a request that
can't be cancelled i.e. ACK.SIPClientTransaction.createCancel()public Request createAck() throws SipException
ClientTransactioncreateAck in interface SIPClientTransactioncreateAck in interface ClientTransactionSipException - if this method is called before a final response
is received for the transaction.SIPClientTransaction.createAck()public void setViaPort(int port)
SIPClientTransactionsetViaPort in interface SIPClientTransactionSIPClientTransaction.setViaPort(int)public void setViaHost(String host)
SIPClientTransactionsetViaHost in interface SIPClientTransactionSIPClientTransaction.setViaHost(java.lang.String)public int getViaPort()
SIPTransactiongetViaPort in interface SIPClientTransactiongetViaPort in interface SIPTransactiongetViaPort in class SIPTransactionImplSIPClientTransaction.getViaPort()public String getViaHost()
SIPTransactiongetViaHost in interface SIPClientTransactiongetViaHost in interface SIPTransactiongetViaHost in class SIPTransactionImplSIPClientTransaction.getViaHost()public Via getOutgoingViaHeader()
SIPClientTransactiongetOutgoingViaHeader in interface SIPClientTransactionSIPClientTransaction.getOutgoingViaHeader()public void clearState()
SIPClientTransactionclearState in interface SIPClientTransactionSIPClientTransaction.clearState()public void setState(int newState)
SIPTransactionsetState in interface SIPClientTransactionsetState in interface SIPTransactionsetState in class SIPTransactionImplnewState - New state of this transaction.SIPClientTransaction.setState(int)public void startTransactionTimer()
startTransactionTimer in interface SIPTransactionpublic void terminate()
Transactionterminate in interface SIPClientTransactionterminate in interface TransactionSIPClientTransaction.terminate()public void stopExpiresTimer()
SIPClientTransactionstopExpiresTimer in interface SIPClientTransactionSIPClientTransaction.stopExpiresTimer()public boolean checkFromTag(SIPResponse sipResponse)
SIPClientTransactioncheckFromTag in interface SIPClientTransactionsipResponse - the response to check.SIPClientTransaction.checkFromTag(gov.nist.javax.sip.message.SIPResponse)public void processResponse(SIPResponse sipResponse, MessageChannel incomingChannel)
ServerResponseInterfaceprocessResponse in interface ServerResponseInterfaceprocessResponse in interface SIPClientTransactionSIPClientTransaction.processResponse(gov.nist.javax.sip.message.SIPResponse,
gov.nist.javax.sip.stack.MessageChannel)public Dialog getDialog()
SIPTransactiongetDialog in interface SIPClientTransactiongetDialog in interface SIPTransactiongetDialog in interface TransactiongetDialog in class SIPTransactionImplSIPClientTransaction.getDialog()public SIPDialog getDialog(String dialogId)
getDialog in interface SIPClientTransactionSIPClientTransaction.getDialog(java.lang.String)public void setDialog(SIPDialog sipDialog, String dialogId)
SIPTransactionsetDialog in interface SIPClientTransactionsetDialog in interface SIPTransactionsetDialog in class SIPTransactionImplsipDialog - --
the dialog to set.dialogId - --
the dialog id ot associate with the dialog.sSIPClientTransaction.setDialog(gov.nist.javax.sip.stack.SIPDialog,
java.lang.String)public SIPDialog getDefaultDialog()
ClientTransactionExtgetDefaultDialog in interface ClientTransactionExtgetDefaultDialog in interface SIPClientTransactionSIPClientTransaction.getDefaultDialog()public void setNextHop(Hop hop)
SIPClientTransactionsetNextHop in interface SIPClientTransactionhop - -- the hop that has been previously computed.SIPClientTransaction.setNextHop(javax.sip.address.Hop)public Hop getNextHop()
SIPClientTransactiongetNextHop in interface ClientTransactionExtgetNextHop in interface SIPClientTransactionSIPClientTransaction.getNextHop()public void setNotifyOnRetransmit(boolean notifyOnRetransmit)
SIPClientTransactionsetNotifyOnRetransmit in interface ClientTransactionExtsetNotifyOnRetransmit in interface SIPClientTransactionnotifyOnRetransmit - the notifyOnRetransmit to setSIPClientTransaction.setNotifyOnRetransmit(boolean)public boolean isNotifyOnRetransmit()
isNotifyOnRetransmit in interface SIPClientTransactionSIPClientTransaction.isNotifyOnRetransmit()public void alertIfStillInCallingStateBy(int count)
ClientTransactionExtalertIfStillInCallingStateBy in interface ClientTransactionExtalertIfStillInCallingStateBy in interface SIPClientTransactioncount - -- the number of base timer intervals after which an alert is issued.SIPClientTransaction.alertIfStillInCallingStateBy(int)protected void cleanUpOnTimer()
public void cleanUp()
cleanUp in interface SIPClientTransactioncleanUp in interface SIPTransactioncleanUp in class SIPTransactionImplSIPClientTransaction.cleanUp()protected void cleanUpOnTerminated()
public String getOriginalRequestFromTag()
getOriginalRequestFromTag in interface SIPClientTransactionSIPClientTransaction.getOriginalRequestFromTag()public String getOriginalRequestCallId()
getOriginalRequestCallId in interface SIPClientTransactionSIPClientTransaction.getOriginalRequestCallId()public Event getOriginalRequestEvent()
getOriginalRequestEvent in interface SIPClientTransactionSIPClientTransaction.getOriginalRequestEvent()public Contact getOriginalRequestContact()
getOriginalRequestContact in interface SIPClientTransactionSIPClientTransaction.getOriginalRequestContact()public String getOriginalRequestScheme()
getOriginalRequestScheme in interface SIPClientTransactionSIPClientTransaction.getOriginalRequestScheme()Copyright © 2014. All Rights Reserved.