public interface SIPClientTransaction extends ClientTransactionExt, SIPTransaction, ServerResponseInterface
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 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() |
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.
|
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 of the recipient.
|
int |
getViaPort()
Get the port of the recipient.
|
boolean |
isMessagePartOfTransaction(SIPMessage messageToTest)
Deterines if the message is a 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)
Send a request message through this transaction and onto the client.
|
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)
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 |
setViaHost(String host)
Set the port of the recipient.
|
void |
setViaPort(int port)
Set the port of the recipient.
|
void |
stopExpiresTimer()
Stop the ExPIRES timer if it is running.
|
void |
terminate()
Terminate this transaction and immediately release all stack resources
associated with it.
|
isSecure
acquireSem, addEventListener, cancelMaxTxLifeTimeTimer, close, disableRetransmissionTimer, disableTimeoutTimer, doesCancelMatchTransaction, extractCertIdentities, fireRetransmissionTimer, fireTimeoutTimer, 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, getState, getT2, getT4, getTimerD, getTimerI, getTimerK, getTimerT2, getTimerT4, getTransactionId, getTransport, getViaHeader, hashCode, isByeTransaction, isCancelTransaction, isDialogCreatingTransaction, isInviteTransaction, isReliable, isSecure, isServerTransaction, isTerminated, isTransactionMapped, passToListener, raiseErrorEvent, raiseIOExceptionEvent, releaseSem, removeEventListener, scheduleMaxTxLifeTimeTimer, semRelease, setApplicationData, setAuditTag, setBranch, setCollectionTime, setEncapsulatedChannel, setForkId, setOriginalRequest, setPassToListener, setReleaseReferencesStrategy, setRetransmitTimer, setTimerD, setTimerT2, setTimerT4, setTransactionMapped, startTransactionTimer, testAndSetTransactionTerminatedEvent
void setResponseInterface(ServerResponseInterface newRespondTo)
newRespondTo
- ResponseInterface to send messages to.MessageChannel getRequestChannel()
boolean isMessagePartOfTransaction(SIPMessage messageToTest)
isMessagePartOfTransaction
in interface SIPTransaction
messageToTest
- Message to check if it is part of this transaction.void sendMessage(SIPMessage messageToSend) throws IOException
sendMessage
in interface SIPTransaction
messageToSend
- Request to process and send.IOException
void processResponse(SIPResponse transactionResponse, MessageChannel sourceChannel, SIPDialog dialog)
processResponse
in interface ServerResponseInterface
transactionResponse
- Response to process.sourceChannel
- Channel that received this message.dialog
- -- dialog for this responsevoid sendRequest() throws SipException
ClientTransaction
MessageFactory
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 ClientTransaction
SipException
- if the SipProvider cannot send the Request for any
reason.Request
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 ClientTransaction
SipException
- if this method is called to cancel a request that
can't be cancelled i.e. ACK.Request createAck() throws SipException
ClientTransaction
createAck
in interface ClientTransaction
SipException
- if this method is called before a final response
is received for the transaction.void setViaPort(int port)
void setViaHost(String host)
int getViaPort()
getViaPort
in interface SIPTransaction
String getViaHost()
getViaHost
in interface SIPTransaction
Via getOutgoingViaHeader()
void clearState()
void setState(int newState)
setState
in interface SIPTransaction
newState
- New state of this transaction.void terminate() throws ObjectInUseException
Transaction
terminate
in interface Transaction
ObjectInUseException
- if the transaction cannot be terminated as
it is associated to a dialog.void stopExpiresTimer()
boolean checkFromTag(SIPResponse sipResponse)
sipResponse
- the response to check.void processResponse(SIPResponse sipResponse, MessageChannel incomingChannel)
ServerResponseInterface
processResponse
in interface ServerResponseInterface
Dialog getDialog()
Transaction
getDialog
in interface SIPTransaction
getDialog
in interface Transaction
Dialog
void setDialog(SIPDialog sipDialog, String dialogId)
SIPTransaction
setDialog
in interface SIPTransaction
sipDialog
- --
the dialog to set.dialogId
- --
the dialog id ot associate with the dialog.sSIPDialog getDefaultDialog()
ClientTransactionExt
getDefaultDialog
in interface ClientTransactionExt
void setNextHop(Hop hop)
hop
- -- the hop that has been previously computed.Hop getNextHop()
getNextHop
in interface ClientTransactionExt
void setNotifyOnRetransmit(boolean notifyOnRetransmit)
setNotifyOnRetransmit
in interface ClientTransactionExt
notifyOnRetransmit
- the notifyOnRetransmit to setboolean isNotifyOnRetransmit()
void alertIfStillInCallingStateBy(int count)
ClientTransactionExt
alertIfStillInCallingStateBy
in interface ClientTransactionExt
count
- -- the number of base timer intervals after which an alert is issued.void cleanUp()
cleanUp
in interface SIPTransaction
String getOriginalRequestFromTag()
String getOriginalRequestCallId()
Event getOriginalRequestEvent()
Contact getOriginalRequestContact()
String getOriginalRequestScheme()
Copyright © 2016. All Rights Reserved.