Interface OCSleeSipProvider
-
- All Superinterfaces:
javax.sip.SipProvider
,net.java.slee.resource.sip.SleeSipProvider
public interface OCSleeSipProvider extends net.java.slee.resource.sip.SleeSipProvider
SBB interface for the OC SIP RA type. This provides additional utility methods for SBBs, that are not provided on the standard JSIP 1.2SleeSipProvider
interface.- Since:
- OCSIP RA Type 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
closeInboundFlow(String flowID)
Closes an inbound flow (a persistent connection as per draft-ietf-sip-outbound-03).javax.sip.address.SipURI
getLocalSipURI(String transport, boolean secure)
Get the SIP URI of this SIP RA entity, so that requests may be routed back to it.String
getNewBranch()
Get a new branch string, for use in Via headers in new requests.net.java.slee.resource.sip.DialogActivity
getNewDialog(javax.sip.address.Address from, javax.sip.address.Address to, String callID, String localTag)
Creates a new client dialog using the given local and remote party addresses.net.java.slee.resource.sip.DialogActivity
getNewDialog(net.java.slee.resource.sip.DialogActivity incomingDialog, String callID, String localTag)
Creates a new client dialog based on the parameters of an incoming server dialog, on which a dialog-initiating request has been received.String
getNewTag()
Get a new randomly generated tag string, required for dialog-creating requests and responses.int
getNodeID()
Gets the Node ID of the local Rhino node.OCHeaderFactory
getOCHeaderFactory()
Get the OC-specific HeaderFactory interfaceSipOverloadControlPlugin
getRegisteredOverloadControlPlugin()
Retrieves the currently registered overload control plugin.X509CRL
getTLSCRL()
Get the CRL used by TLS connections.DialogBuilder.Unconfigured
newDialogBuilder()
Get a new dialog builder, which is used to configure various dialog options and then create a newDialogActivity
.void
registerOverloadControlPlugin(SipOverloadControlPlugin plugin)
Register an overload control plugin.boolean
rejectIfBelowMinSE(javax.sip.ServerTransaction inviteST, int minSE)
Convenience method that checks an incoming INVITE's Session-Expires header (if present) and, if the Session-Expires value is below the specified minimum, sends a 422 error response providing the desired minimum value (Min-SE).net.java.slee.resource.sip.DialogActivity
retryInitialSessionRefresh(javax.sip.ClientTransaction failedInviteTxn, javax.sip.message.Response response422)
Convenience method to simplify retrying dialog setup after a 422 (Session Interval Too Small) response was received.void
setTLSCRL(X509CRL crl)
Set the CRL used by TLS connections.-
Methods inherited from interface javax.sip.SipProvider
addListeningPoint, addSipListener, getListeningPoint, getListeningPoint, getListeningPoints, getNewCallId, getNewClientTransaction, getNewDialog, getNewServerTransaction, getSipStack, removeListeningPoint, removeSipListener, sendRequest, sendResponse, setAutomaticDialogSupportEnabled, setListeningPoint
-
-
-
-
Method Detail
-
getOCHeaderFactory
OCHeaderFactory getOCHeaderFactory()
Get the OC-specific HeaderFactory interface
-
getNewTag
String getNewTag()
Get a new randomly generated tag string, required for dialog-creating requests and responses.
-
getNewBranch
String getNewBranch()
Get a new branch string, for use in Via headers in new requests. The returned string will start with the RFC3261-mandated magic cookie "z9hG4bK", and the remainder of the string must be sufficient to uniquely identify a transaction.
-
getNewDialog
net.java.slee.resource.sip.DialogActivity getNewDialog(net.java.slee.resource.sip.DialogActivity incomingDialog, String callID, String localTag) throws javax.sip.SipException
Creates a new client dialog based on the parameters of an incoming server dialog, on which a dialog-initiating request has been received. The caller can optionally specify a new Call-ID and local-tag to be used in the new dialog.The local and remote address parameters are copied from the original dialog. The RA will generate a local Contact address to be used in outgoing requests.
This method provides a simple way to create the outgoing leg of a B2BUA application. An application using this method should then call
DialogActivity.createRequest(javax.sip.message.Request)
andDialogActivity.sendRequest(javax.sip.message.Request)
to copy the dialog-initiating request and forward it out on the new dialog.- Parameters:
incomingDialog
- the original server dialog, on which a dialog-initiating request has been received.callID
- a string that will be used as the Call-ID of the new dialog. Ifnull
, the RA entity use the same Call-ID as the incoming dialog.localTag
- a string that will be used as the local-tag in the new dialog. Ifnull
, the RA entity will generate a new tag, so that the dialog has a unique dialog ID.- Returns:
- a new
DialogActivity
. - Throws:
javax.sip.SipException
- if unable to create the new dialog.- Since:
- OCSIP RA Type 2.1
-
getNewDialog
net.java.slee.resource.sip.DialogActivity getNewDialog(javax.sip.address.Address from, javax.sip.address.Address to, String callID, String localTag) throws javax.sip.SipException
Creates a new client dialog using the given local and remote party addresses. The caller can optionally specify a new Call-ID and local-tag to be used in the new dialog.The RA Entity will generate the Contact address. After creating the new dialog, the application can then create and send the initial request using
Dialog.createRequest(String)
andDialogActivity.sendRequest(javax.sip.message.Request)
. This is a convenience method for client (UAC) applications, so that they can easily create new dialogs.- Parameters:
from
- the local party address for the new dialog.to
- the remote party address for the new dialog.callID
- a string that will be used as the Call-ID of the new dialog. Ifnull
, the RA entity will generate a new Call-ID.localTag
- a string that will be used as the local-tag in the new dialog. Ifnull
, the RA entity will generate a new tag, so that the dialog has a unique dialog ID.- Returns:
- a new
DialogActivity
. - Throws:
javax.sip.SipException
- if unable to create the dialog.- Since:
- OCSIP RA Type 2.1
-
newDialogBuilder
DialogBuilder.Unconfigured newDialogBuilder()
Get a new dialog builder, which is used to configure various dialog options and then create a newDialogActivity
. This is an alternative to the getNewDialog(...) variants.- Returns:
- an
DialogBuilder.Unconfigured
builder object. One of the methods on the builder must be called to specify what type of dialog is being created.
-
getLocalSipURI
javax.sip.address.SipURI getLocalSipURI(String transport, boolean secure)
Get the SIP URI of this SIP RA entity, so that requests may be routed back to it. This may be used to construct Record-Route or Contact headers.Note: If the RA is listening on multiple IP addresses and ports, the RA will select the most appropriate URI. If an application needs more control it should generate its own URI.
- Parameters:
transport
- the desired transport parameter for the URI, may benull
.secure
- if true, the URI returned will be a "sips" URI, otherwise "sip". If transport is "tls" then the transport parameter is omitted from "sips" URIs.- Returns:
- the SIP URI
-
setTLSCRL
void setTLSCRL(X509CRL crl) throws NullPointerException
Set the CRL used by TLS connections. This must be a valid X509 CRL. The CRL will not be automatically refreshed by the stack.- Parameters:
crl
- theX509CRL
to use.- Throws:
NullPointerException
- if crl was null.
-
getTLSCRL
X509CRL getTLSCRL()
Get the CRL used by TLS connections.- Returns:
- the
X509CRL
in use, null if a CRL is not loaded.
-
closeInboundFlow
void closeInboundFlow(String flowID)
Closes an inbound flow (a persistent connection as per draft-ietf-sip-outbound-03).- Parameters:
flowID
- the unique flow-id for the connection. This value is generated by the stack and will have been seen by the application in theX-Flow-ID
header in requests received on the flow.
-
getNodeID
int getNodeID()
Gets the Node ID of the local Rhino node.- Returns:
- an integer node ID.
- Since:
- OCSIP RA Type 2.2
-
rejectIfBelowMinSE
boolean rejectIfBelowMinSE(javax.sip.ServerTransaction inviteST, int minSE)
Convenience method that checks an incoming INVITE's Session-Expires header (if present) and, if the Session-Expires value is below the specified minimum, sends a 422 error response providing the desired minimum value (Min-SE). This method does nothing (and returns false) if the INVITE request does not indicate support for "timer" using the Supported or Require headers.- Parameters:
inviteST
- theServerTransaction
of an INVITE request. May be an initial or re-INVITE request.minSE
- the minimum session expiry value allowed by the application, in seconds. May not be less than 90 seconds.- Returns:
- true if the request was rejected with 422. Otherwise this method returns false and the application should continue processing the request.
- Throws:
IllegalArgumentException
- if the server transaction is not an INVITE request, or if the minSE value is below 90 seconds.
-
retryInitialSessionRefresh
net.java.slee.resource.sip.DialogActivity retryInitialSessionRefresh(javax.sip.ClientTransaction failedInviteTxn, javax.sip.message.Response response422) throws javax.sip.SipException
Convenience method to simplify retrying dialog setup after a 422 (Session Interval Too Small) response was received. As per RFC4028 §7.3, a new dialog is created that will use the same Call-ID, From and To headers as the previous one, but with the initial CSeq incremented by one. The Min-SE from the 422 response is used to create new session timer options that will be applied to the initial INVITE on this dialog.Once the new dialog is created, the initial request can be recreated with the new session timer parameters using
DialogActivity.createRequest(javax.sip.message.Request)
orDialog.createRequest(String)
, then sent out usingDialogActivity.sendRequest(javax.sip.message.Request)
orDialog.sendRequest(javax.sip.ClientTransaction)
- Parameters:
failedInviteTxn
- the previous INVITE client transactionresponse422
- the 422 response- Returns:
- a new
DialogActivity
that uses the session timer options given in the response - Throws:
javax.sip.SipException
- if unable to create the new dialog.
-
registerOverloadControlPlugin
void registerOverloadControlPlugin(SipOverloadControlPlugin plugin)
Register an overload control plugin. If a plugin is registered, the SIP RA will invoke it for every received request prior to regular Rhino platform overload control.At most one overload control plugin can be registered with each SIP RA instance in a given JVM instance at any one time. Registering a plugin atomically deregisters any previously registered plugin.
- Parameters:
plugin
- the plugin to register. May be null, which unregisters any previously registered plugin.
-
getRegisteredOverloadControlPlugin
SipOverloadControlPlugin getRegisteredOverloadControlPlugin()
Retrieves the currently registered overload control plugin.- Returns:
- the currently registered plugin, or null if there is no registered plugin.
-
-