Interface SleeSipProvider

  • All Superinterfaces:
    SipProvider

    public interface SleeSipProvider
    extends SipProvider
    This interface is the SBB resource adaptor interface for the JSIP 1.2 RA Type. An SBB can bind an object of this type into its JNDI component environment using a resource-adaptor-entity-binding element in the SBB's deployment descriptor.

    This interface extends SipProvider, with additional methods for SLEE applications.

    • Method Detail

      • getNewDialog

        DialogActivity getNewDialog​(DialogActivity incomingDialog,
                                    boolean useSameCallId)
                             throws 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 new dialog will optionally have the same Call-ID as the original dialog, but will always have a new local tag, generated by the RA Entity, so that the dialog ID is unique.

        The local and remote address paraameters 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) and DialogActivity.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.
        useSameCallId - if true, the new dialog will have the same Call-ID as the original dialog. Otherwise a new Call-ID will be generated by the RA Entity.
        Returns:
        a new DialogActivity.
        Throws:
        SipException - if unable to create the new dialog.
      • isLocalSipURI

        boolean isLocalSipURI​(SipURI uri)
        Convenience method for determining if a SipURI matches a local address that the SIP RA Entity is using. For example, a Proxy SBB could use this to check incoming Route headers.
        Parameters:
        uri - a SIP URI.
        Returns:
        true if the hostname, port and transport in the SIP URI match a local listening point of the SIP RA, otherwise false.
      • isLocalHostname

        boolean isLocalHostname​(String host)
        Convenience method for determining if a hostname matches the host that the SIP RA Entity is running on.
        Parameters:
        host - a hostname, or IP address in string form.
        Returns:
        true if the hostname is a valid hostname for this host, otherwise false.
      • getLocalSipURI

        SipURI getLocalSipURI​(String transport)
        Convenience method for obtaining a SIP URI addressed to this SIP RA Entity. For example, a Proxy SBB could use this when inserting a Record-Route header.
        Parameters:
        transport - a case-insensitive transport name, such as "udp", "tcp" or "tls". This will be used as the transport parameter in the resulting SipURI, unless transport is "tls", in which case the RA Entity shall return a secure sips: URI. If transport is null, no transport parameter will be used in the URI.
        Returns:
        a SipURI addressed to this SIP RA Entity.
      • getLocalVia

        ViaHeader getLocalVia​(String transport,
                              String branch)
                       throws TransportNotSupportedException
        Convenience method for obtaining a ViaHeader addressed to this SIP RA Entity. For example, a Proxy SBB could use this when adding a Via header to a forwarded request.
        Parameters:
        transport - a case-insensitive transport name, such as "udp", "tcp" or "tls". This will be used as the transport parameter in the resulting ViaHeader.
        branch - the branch parameter to use in the new header. If null, the RA will automatically generate a valid branch parameter.
        Returns:
        a ViaHeader addressed to this SIP RA Entity.
        Throws:
        TransportNotSupportedException - if the given transport is not supported by the SIP RA entity
      • acceptCancel

        boolean acceptCancel​(CancelRequestEvent cancelEvent,
                             boolean isProxy)
        Convenience method for simplifying CANCEL handling. When a CANCEL arrives, an application can ask the the RA to handle it, by calling this method.

        The behaviour of this method depends on whether the CANCEL actually matched an INVITE, and also whether the application is behaving as a proxy or not (determined by the isProxy parameter. This is summarized in the table below.

        isProxy = falseisProxy = true
        CANCEL matches INVITE Send “200 OK” response to CANCEL.
        Send “487 Request Terminated” response to INVITE.
        Send “200 OK” response to CANCEL.
        Proxy application must cancel outstanding branches and wait for responses (RFC3261 §16.10).
        CANCEL does not match INVITE Send “481 Call or Transaction Does Not Exist” response to CANCEL. Do nothing.
        Proxy application must statelessly forward the CANCEL downstream (RFC3261 §16.10).

        Applications can choose to implement their own CANCEL handling, this method is provided to simplify the common case where a CANCEL is just accepted immediately.

        Parameters:
        cancelEvent - the CancelRequestEvent containing the CANCEL request and its ServerTransaction, and the matching INVITE ServerTransaction, if any.
        isProxy - if true, the RA will follow standard proxy behaviour as described in the table above.
        Returns:
        true if the CANCEL did match an INVITE, otherwise false.