|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.javax.sip.stack.DialogImpl
Tracks dialogs. A dialog is a peer to peer association of communicating SIP entities. For INVITE transactions, a Dialog is created when a success message is received (i.e. a response that has a To tag). The SIP Protocol stores enough state in the message structure to extract a dialog identifier that can be used to retrieve this structure from the SipStack.
Field Summary | |
static int |
COMPLETED_STATE
|
static int |
CONFIRMED_STATE
|
static int |
EARLY_STATE
|
static int |
TERMINATED_STATE
|
Method Summary | |
void |
ackReceived(gov.nist.javax.sip.message.SIPRequest sipRequest)
Mark that the dialog has seen an ACK. |
void |
addRoute(Route route,
boolean top)
Add a route to the dialog. |
void |
addRoute(gov.nist.javax.sip.message.SIPMessage sipMessage)
Extract the route information from this SIP Message and add the relevant information to the route set. |
void |
addTransaction(SIPTransaction transaction)
Add a transaction record to the dialog. |
void |
delete()
This method will release all resources associated with this dialog that are tracked by the Provider. |
CallIdHeader |
getCallId()
Returns the Call-ID for this SipSession. |
String |
getDialogId()
Get the id for this dialog. |
Transaction |
getFirstTransaction()
Get the transaction that created this dialog. |
SIPTransaction |
getLastTransaction()
Get the last transaction from the dialog. |
Address |
getLocalParty()
Get the local Address for this dialog. |
int |
getLocalSequenceNumber()
Get the local sequence number (for cseq assignment of outgoing requests within this dialog). |
String |
getLocalTag()
Get local identifier for the dialog. |
GenericURI |
getOriginalRequestURI()
Generate a request URI from the top of the route list. |
Address |
getRemoteParty()
Returns the Address identifying the remote party. |
int |
getRemoteSequenceNumber()
Get the remote sequence number (for cseq assignment of outgoing requests within this dialog). |
String |
getRemoteTag()
Get peer identifier identifier for the dialog. |
Address |
getRemoteTarget()
Returns the Address identifying the remote target. |
Iterator |
getRouteSet()
Gets the route set for the dialog. |
DialogState |
getState()
Returns the current state of the dialogue. |
String |
getUser()
Get the user name for the dialog. |
int |
incrementLocalSequenceNumber()
Increment the local CSeq # for the dialog. |
int |
incrementRemoteSequenceNumber()
Increment the Remote cseq # for the dialog. |
boolean |
isClientDialog()
Return true if this is a client dialog. |
boolean |
isSecure()
Returns true if this Dialog is secure i.e. if the request arrived over TLS, and the Request-URI contained a SIPS URI, the "secure" flag is set to TRUE. |
boolean |
isServer()
Return true if is server. |
void |
printTags()
Debugging print for the dialog. |
boolean |
recordRouteEnabled()
Return true if record routing is enabled for this dialog |
void |
sendAck(Request request)
Sends ACK Request to the remote party of this Dialogue. |
void |
sendRequest(ClientTransaction clientTransactionId,
Request dialogRequest)
Sends a Request to the remote party of this dialog. |
void |
setDefaultRoute(Route defaultRoute)
Set the default route (the default next hop for the proxy or the proxy address for the user agent). |
void |
setDialogId(String dialogId)
Set the dialog identifier. |
void |
setLocalTag(String mytag)
Set local tag for the transaction. |
void |
setRemoteTag(String hisTag)
Set the remote tag. |
void |
setStack(SIPTransactionStack sipStack)
Set the stack address. |
void |
setState(int state)
Set the state for this dialog. |
void |
setUser(String user)
Set the user name for the default route. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int EARLY_STATE
public static final int CONFIRMED_STATE
public static final int COMPLETED_STATE
public static final int TERMINATED_STATE
Method Detail |
public boolean isClientDialog()
public boolean recordRouteEnabled()
public void setState(int state)
state
- is the state to set for the dialog.public void printTags()
public void ackReceived(gov.nist.javax.sip.message.SIPRequest sipRequest)
public Transaction getFirstTransaction()
getFirstTransaction
in interface Dialog
public Iterator getRouteSet()
Requests within a dialog MAY contain Record-Route and Contact header fields. However, these requests do not cause the dialog's route set to be modified.
The User Agent Client uses the remote target and route set to build the Request-URI and Route header field of the request.
getRouteSet
in interface Dialog
public void setStack(SIPTransactionStack sipStack)
public void addRoute(Route route, boolean top)
route
- is the route to add to the dialog.public GenericURI getOriginalRequestURI()
public void setDefaultRoute(Route defaultRoute)
defaultRoute
- is the default route to set.public void setUser(String user)
user
- is the user name to set for the default route.public void addRoute(gov.nist.javax.sip.message.SIPMessage sipMessage)
sipMessage
- is the SIP message for which we want
to add the route.public void setDialogId(String dialogId)
public String getUser()
public boolean isServer()
isServer
in interface Dialog
public String getDialogId()
getDialogId
in interface Dialog
public void addTransaction(SIPTransaction transaction)
transaction
- is the transaction to add to the dialog.public void setRemoteTag(String hisTag)
hisTag
- is the remote tag to set.public SIPTransaction getLastTransaction()
public int incrementRemoteSequenceNumber()
public int incrementLocalSequenceNumber()
public int getRemoteSequenceNumber()
getRemoteSequenceNumber
in interface Dialog
public int getLocalSequenceNumber()
getLocalSequenceNumber
in interface Dialog
public String getLocalTag()
getLocalTag
in interface Dialog
public String getRemoteTag()
getRemoteTag
in interface Dialog
public void setLocalTag(String mytag)
mytag
- is the tag to use in From headers client
transactions that belong to this dialog and for
generating To tags for Server transaction requests that belong
to this dialog.public void delete()
delete
in interface Dialog
public CallIdHeader getCallId()
getCallId
in interface Dialog
public Address getLocalParty()
getLocalParty
in interface Dialog
public Address getRemoteParty()
This is the value of the From header of recieved responses in this dialogue when acting as an User Agent Server.
getRemoteParty
in interface Dialog
public Address getRemoteTarget()
This is the value of the Contact header of recieved Requests or refresh Requests in this dialogue when acting as an User Agent Server.
getRemoteTarget
in interface Dialog
public DialogState getState()
getState
in interface Dialog
DialogState
public boolean isSecure()
isSecure
in interface Dialog
true
if this dialogue was established using a sips
URI over TLS, and false
otherwise.public void sendAck(Request request) throws SipException
SipProviderImpl.sendRequest(ClientTransaction, Request)
method.
When the SipStackImpl.getRetransmissionFilter()
is true
, that is the SipProvider takes care of
all retransmissions for the application, if the the SipProvider can
not deliver the Request after
multiple retransmits due to the transaction expiring the SipListener will
be notified with a TimeoutEvent
.
sendAck
in interface Dialog
request
- - the new ACK Request message to send.
SipException
- if implementation cannot send the ACK Request for
any other reasonpublic void sendRequest(ClientTransaction clientTransactionId, Request dialogRequest) throws TransactionDoesNotExistException, SipException
This methods will set the From and the To tags for the outgoing request and also set the correct sequence number to the outgoing Request and associate the client transaction with this dialog. Note that any tags assigned by the user will be over-written by this method.
The User Agent must not send a BYE on a confirmed INVITE until it has received an ACK for its 2xx response or until the server transaction timeout is received.
When the SipStack.getRetransmissionFilter()
is true
,
that is the SipProvider takes care of all retransmissions for the
application, and the SipProvider can not deliver the Request after
multiple retransmits the SipListener will be notified with a
TimeoutEvent
when the transaction expires.
sendRequest
in interface Dialog
dialogRequest
- - the new Request message to send.clientTransactionId
- - the new ClientTransaction object identifying
this transaction, this clientTransaction should be requested from
SipProvider.getNewClientTransaction(Request)
TransactionDoesNotExistException
- if the serverTransaction does
not correspond to any existing server transaction.
SipException
- if implementation cannot send the Request for
any reason.
|
NIST SIP Parser and Stack (v1.2) API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |