public interface Proxy
getProxy()
or getProxy(true)
is called on an initial
IncomingSipRequest
. SBBs then configure the proxy activity and add targets
to the target set using proxyTo(URI)
.
recurse
: If this property is true
, the proxy activity will automatically
try any alternative contacts in a 3xx response. Defaults to true
.
recordRoute
: If this property is true
, the proxy will add itself to the
Record-Route header, so that the service will be invoked on any future in-dialog requests. Defaults to true
.
parallel
: Determines whether to proxy in parallel (ie. multiple branches active at
the same time) or sequentially. Defaults to true
, proxy in parallel.
sequentialSearchTimeout
: If the proxy activity is operating sequentially,
then this property determines how long the proxy will wait for a final response before considering the current branch
to be failed and trying the next branch. Defaults to 15 seconds.
supervised
property from SIP Servlet is not replicated here, because that
functionality is replaced by defining event handler methods for response events.
See Response Processing below.
proxyTo(URI)
one or more
times. Branches can be added at any time, unless the proxy has already forwarded the final
response. In this case an IllegalStateException
will be thrown. The proxy sends the request
out on each branch immediately, unless getParallel()
is
false, in which case the proxy will wait until a final response is received, or the branch times out
before trying the next branch. Services must attach to the proxy activity context in order to see
the responses forwarded by the proxy.The proxy activity implements the "Timer C" behaviour as specified in RFC 3261 section 16. That is, for INVITE transactions, the proxy allows at least 3 minutes between provisional responses. If no provisional or final response is seen in this time then the branch is cancelled. For non-INVITE transactions, the normal timeout of 32s applies. If this expires then the proxy behaves as though it received a "408 Request Timeout" response on the branch, and adds it to the response context. If the proxy is operating sequentially then the sequential search timeout takes precedence if it is smaller than 32s.
IncomingSipResponse
event on the proxy activity. SBBs that want to be notified of responses must
declare the relevant response event handlers and be attached to the proxy activity context. If the SBB
does nothing the response will be forwarded upstream automatically. The SBB may also generate its own
responses, using IncomingSipRequest.createResponse(int)
as usual. These are handled by the proxy as follows:
SipSession
of the original request now represents the confirmed dialog between the caller
UAC and the SBB.
If no 2xx responses are received, then the proxy activity will select the best response and fire the response event. If the SBB does not add any more branches, then the activity ends after the response event is delivered.
Modifier and Type | Interface and Description |
---|---|
static class |
Proxy.ProxyResult |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel all remaining proxy branches by sending a CANCEL request on each branch.
|
void |
cancel(Parameterable... headers)
Cancel all remaining proxy branches by sending a CANCEL request on each branch,
with the given Reason headers.
|
IncomingSipRequest |
getOriginalRequest() |
boolean |
getParallel() |
boolean |
getRecordRoute() |
SipURI |
getRecordRouteURI() |
boolean |
getRecurse() |
int |
getSequentialSearchTimeout() |
Proxy.ProxyResult |
proxyInternal(URI uri)
proxy to an internal URI i.e. another node in the same cluster.
|
void |
proxyTo(URI uri) |
void |
proxyTo(URI[] uris) |
void |
setParallel(boolean parallel) |
void |
setRecordRoute(boolean recordRoute) |
void |
setRecurse(boolean recurse) |
void |
setSequentialSearchTimeout(int seconds) |
IncomingSipRequest getOriginalRequest()
void proxyTo(URI uri)
void proxyTo(URI[] uris)
void cancel()
void cancel(Parameterable... headers)
headers
- zero or more Parameterable
values that will be added to
the outgoing CANCEL as Reason headers.boolean getRecurse()
void setRecurse(boolean recurse)
boolean getRecordRoute()
void setRecordRoute(boolean recordRoute)
boolean getParallel()
void setParallel(boolean parallel)
int getSequentialSearchTimeout()
void setSequentialSearchTimeout(int seconds)
SipURI getRecordRouteURI()
Proxy.ProxyResult proxyInternal(URI uri)
uri
- The URI to proxy to.