public class NonBlockingTest.Client extends Object implements Closeable
| Constructor and Description |
|---|
NonBlockingTest.Client() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
processResponse(ResponseEvent arg0)
Processes a Response received on a SipProvider upon which this
SipListener is registered.
|
void |
sendInvite(int serverPort) |
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void processResponse(ResponseEvent arg0)
SipListener
Handling Responses:
When the application receives a ResponseEvent from the SipProvider the
ResponseEvent may or may not correlate to an existing Request of the
application. The application can be determine if the ResponseEvent
belongs to an existing Request by checking the client transaction of the
ResponseEvent.
null the
ResponseEvent does not belong to an existing Request and the Response is
considered stray, i.e. stray response can be identitied, if
responseEvent.getClientTransaction() == null;. Handling
of these "stray" responses is dependent on the application i.e. a proxy
will forward them statelessly using the
SipProvider.sendResponse(Response)method, while a User Agent
will discard them.
null
the application determines it action to the ResponseEvent based on the
content of the Response information.
User Agent Client (UAC) behaviour:
After possibly receiving one or more provisional responses (1xx) to a
Request, the UAC will get one or more 2xx responses or one non-2xx final
response. Because of the protracted amount of time it can take to receive
final responses to an INVITE, the reliability mechanisms for INVITE
transactions differ from those of other requests. A UAC needs to send an
ACK for every final Response it receives, however the procedure for
sending the ACK depends on the type of Response. For final responses
between 300 and 699, the ACK processing is done by the transaction layer
i.e. handled by the implementation. For 2xx responses, the ACK processing
is done by the UAC application, to guarantee the three way handshake of
an INVITE transaction. This specification defines a utility thats enables
the SipProvider to handle the ACK processing for an INVITE transaction,
see the SipStack.isRetransmissionFilterActive()method.
A 2xx response to an INVITE establishes a session, and it also creates a
dialog between the UAC that issued the INVITE and the UAS that generated
the 2xx response. Therefore, when multiple 2xx responses are received
from different remote User Agents, i.e. the INVITE forked, each 2xx
establishes a different dialog and all these dialogs are part of the same
call. If an INVITE client transaction returns a TimeoutEvent
rather than a response the UAC acts as if a 408 (Request Timeout)
response had been received from the UAS.
Stateful Proxies:
A proxy application that handles a response statefully must do the
following processing:
Additionally the following processing MUST be performed on each response that is forwarded.
ServerTransaction.sendResponse(Response)method.
Stateless Proxies:
As a stateless proxy does not have any notion of transactions, or of the
response context used to describe stateful proxy behavior,
responseEvent.getClientTransaction == null; always return
true . Response processing does not apply, the transaction
layer of the SipProvider implementation is by-passed. An application
intending to stateless proxy the Response MUST:
SipProvider.sendResponse(Response)method.
processResponse in interface SipListenerarg0 - -
the responseEvent fired from the SipProvider to the
SipListener representing a Response received from the network.Copyright © 2018. All Rights Reserved.