Interface Leg


  • public interface Leg
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addAdditionalTrackingKeys​(java.lang.String... additionalTrackingKeys)
      Add one or more additional tracking keys to the set of additional keys used to track this leg.
      Leg downstreamFork​(org.jainslee.resources.sip.SipSession session, java.lang.String legName)
      Immediate create a new leg which is a downstream fork to this leg, associate it with the provided SipSession and attach the Sentinel service SBB to the ACI of the SipSession.
      boolean endInviteSession()
      Queue an instruction to release an INVITE-initiated dialog during instruction processing.
      boolean endSubscription​(SubscribedEventID eventID)
      Queue an instruction to end a given subscription.
      boolean endSubscription​(SubscribedEventID eventID, MessageBody messageBody)
      Queue an instruction to end a given subscription.
      boolean endSubscription​(SubscribedEventID eventID, java.lang.String reason)
      Queue an instruction to end a given subscription.
      boolean endSubscription​(SubscribedEventID eventID, java.lang.String reason, MessageBody messageBody)
      Queue an instruction to end a given subscription.
      boolean endSubscriptions()
      Queue an instruction to end all subscriptions on this leg.
      boolean endSubscriptions​(java.lang.String reason)
      Queue an instruction to end all subscriptions on this leg.
      javax.slee.ActivityContextInterface getAci()
      Return the ACI for this leg.
      java.util.Map<java.lang.String,​java.lang.String> getAdditionalTrackedAttributes()
      Get the map of additional attribute name/values used for session tracking on this leg.
      java.util.Set<java.lang.String> getAdditionalTrackingKeys()
      Get the set of additional keys used for session tracking on this leg.
      com.opencloud.sentinel.sdp.SessionDescriptionWrapper getCommittedSDP()
      Return the committed SDP on this session.
      java.lang.Long getCommittedSDPSequenceNumber()
      Return the committed SDP sequence number on this session.
      org.jainslee.resources.sip.DialogID getDialogID()
      Gets the Dialog ID of the SipSession for this leg.
      java.util.Set<Leg> getDownstreamForkedLegs()
      Return the set of legs including this leg which are included in a downstream fork session set.
      boolean getHasOutstandingSDPOffer()
      Return whether there is an oustanding SDP offer on this leg
      org.jainslee.resources.sip.SipRequest getInitialSubscribe()
      Return the initial SUBSCRIBE SIP request sent/received on this leg/session.
      org.jainslee.resources.sip.SipRequest getInviteRequest()
      Return the initial INVITE SIP request sent/received on this leg/session.
      InviteSessionPhase getInviteSessionPhase()
      Indicates which phase the INVITE session for this leg is in.
      java.lang.Long getLastTrackingDataChangeTime()
      Gets the timestamp of the last update to any of the session tracking fields on this leg.
      org.jainslee.resources.sip.SipRequest getLatestIncomingRequest​(java.lang.String method)
      Gets the latest SIP request received on this leg/session, with the given method, and for which we have not sent a response.
      org.jainslee.resources.sip.SipRequest getLatestInviteRequest()
      Return the latest Invite SIP request sent/received on this leg/session.
      long getLatestMessageTimestamp()
      Return the time of the last message sent or received on this leg.
      org.jainslee.resources.sip.SipResponse getLatestProvisionalInviteResponse()
      Return the latest SIP response sent/received on this leg/session.
      com.opencloud.sentinel.sdp.SessionDescriptionWrapper getLatestReceivedSDP()
      Return the latest SDP received on this session.
      java.lang.Long getLatestReceivedSDPSequenceNumber()
      Return the latest received SDP sequence number on this session.
      org.jainslee.resources.sip.SipRequest getLatestRequest()
      Return the latest SIP request sent/received on this leg/session.
      org.jainslee.resources.sip.SipResponse getLatestResponse()
      Return the latest SIP response sent/received on this leg/session.
      com.opencloud.sentinel.sdp.SessionDescriptionWrapper getLatestSentSDP()
      Return he latest SDP sent on this session.
      java.lang.Long getLatestSentSDPSequenceNumber()
      Return the latest sent SDP sequence number on this session.
      java.lang.String getLegName()
      The name assigned to the leg by the core or by a feature.
      Leg getLinkedLeg()
      Return the leg linked to this leg.
      SipMessageQueue getMessagesToSend()
      Return the MessagesToSend queue Iterable containing messages to be sent on this leg/session.
      java.util.Set<ReliableResponseID> getOutstandingReliableResponseIDs()
      Gets the set of IDs for reliable responses for which we have not yet seen a PRACK on this leg.
      java.util.Set<java.lang.String> getOutstandingTransactionsByMethod()
      Return a list of SipRequest methods for all outstanding transactions on this leg.
      java.lang.String getOwner()
      Gets the URI string of the node that currently owns this leg.
      java.util.Set<Leg> getParallelForkedLegs()
      Return a set of legs including this leg which are included in a parallel fork session set.
      com.opencloud.sentinel.sdp.SessionDescriptionWrapper getPreviousCommittedSDP()
      Return the previous committed SDP on this session.
      com.opencloud.sentinel.sdp.SessionDescriptionWrapper getPreviousReceivedSDP()
      Return the previous SDP received on this session.
      java.lang.Long getPreviousReceivedSDPSequenceNumber()
      Return the previously received SDP sequence number on this session.
      com.opencloud.sentinel.sdp.SessionDescriptionWrapper getPreviousSentSDP()
      Return the previous SDP sent on this session.
      java.lang.Long getPreviousSentSDPSequenceNumber()
      Return the previously sent SDP sequence number on this session.
      org.jainslee.resources.sip.SipSession getSipSession()
      Return the SipSession for this leg .
      java.util.Set<SubscribedEventID> getSubscriptions()
      Return set of active subscriptions on this leg.
      java.util.Set<Leg> getUpstreamForkedLegs()
      Return a set of legs including this leg which are included in an upstream fork session set.
      boolean isActive()
      Return true if leg is Active.
      boolean isDownstreamForked()
      Return true if this leg is part of a set of downstream forked legs.
      boolean isLinked()
      Return true if this leg is linked to another leg.
      boolean isParallelForked()
      Return true if this leg is part of a set of parallel forked legs
      boolean isSuspended()  
      boolean isTrackingEnabled()
      Get the value of the tracking enabled flag, which indicates if session tracking is enabled for this leg.
      boolean isUpstreamForked()
      Return true if this leg is part of a set of upstream forked legs.
      boolean isWaitForTrackingResultEnabled()
      Get the value of the wait for tracking result enabled flag, which indicates whether session tracking should pause session processing while session ownership store operations for this leg are in progress.
      void linkLeg​(Leg leg)
      Immediately link this leg to the leg provided as an argument.
      Leg parallelFork​(org.jainslee.resources.sip.OutgoingSipRequest inviteToBeSentOnForkedLeg, java.lang.String forkedLegName)
      Immediately create a new leg which is a parallel fork to this leg and attach the Sentinel service SBB to the ACI of the inviteToBeSentOnForkedLeg SipSession.
      void proxySessionAndDoNotRecordRoute()
      Proxy the initial request received on the leg using the URI received in the initial request.
      void proxySessionAndDoNotRecordRoute​(org.jainslee.resources.sip.URI newRequestUri)
      Proxy the initial request received on the leg using a different request URI.
      void proxySessionAndDoNotRecordRoute​(org.jainslee.resources.sip.URI[] newRequestUris)
      Proxy the session to continue using different request URIs and remove Sentinel from the route.
      ProxyResult proxySessionInternal​(org.jainslee.resources.sip.URI newRequestUri)
      Proxy the session to continue using different request URIs and remove Sentinel from the route.
      void refreshSession​(long refreshPeriod, boolean useUpdate)
      Queue an instruction to perform session refresh on the leg when the leg manager is requested to execute instructions.
      void resume()
      Resume sending messages from this queue.
      void sendCancel​(org.jainslee.resources.sip.Parameterable... reasonHeaders)
      Queues a CANCEL to the initial INVITE on the leg's MessagesToSend queue, adding the given Reason headers.
      void sendMessage​(org.jainslee.resources.sip.SipMessage requestOrResponseToBeSent)
      Queue the SipRequest or SipResponse in the MessagesToSend queue for the leg.
      void setAdditionalTrackedAttributes​(java.util.Map<java.lang.String,​java.lang.String> additionalTrackedAttributes)
      Set the map of additional tracked attributes used for session tracking on this leg.
      void setCommittedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
      Set the committed SDP on this session.
      void setCommittedSDPSequenceNumber​(java.lang.Long number)
      Set the committed SDP sequence number on this session.
      void setHasOutstandingSDPOffer​(boolean hasOutstandingSDPOFfer)
      Set whether there is an outstanding SDP offer on this leg
      void setInitialSubscribe​(org.jainslee.resources.sip.SipRequest subscribe)
      Set the initial SUBSCRIBE SIP request sent/received on this leg/session.
      void setInviteRequest​(org.jainslee.resources.sip.SipRequest request)
      Set the initial INVITE SIP request sent/received on this leg/session.
      void setLatestReceivedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
      Set the latest SDP received on this session.
      void setLatestReceivedSDPSequenceNumber​(java.lang.Long number)
      Set the latest received SDP sequence number on this session.
      void setLatestRequest​(org.jainslee.resources.sip.SipRequest request)
      Set the latest SIP request sent/received on this leg/session.
      void setLatestSentSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
      Set the latest SDP sent on this session.
      void setLatestSentSDPSequenceNumber​(java.lang.Long number)
      Set the latest sent SDP sequence number on this session.
      void setOwner​(java.lang.String ownerUri)
      Sets the URI string of the node that currently owns this leg.
      void setPreviousCommittedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
      Set the previous committed SDP on this session.
      void setPreviousReceivedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
      Set the previous SDP received on this session.
      void setPreviousReceivedSDPSequenceNumber​(java.lang.Long number)
      Set the previously received SDP sequence number on this session.
      void setPreviousSentSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
      Set the previous SDP sent on this session.
      void setPreviousSentSDPSequenceNumber​(java.lang.Long number)
      Set the previous sent SDP sequence number on this session.
      void setTrackingEnabled​(boolean trackingEnabled)
      Sets whether session tracking should be enabled for this leg.
      void setWaitForTrackingResultEnabled​(boolean waitForTrackingResultEnabled)
      Set the value of the wait for tracking result enabled flag, which indicates whether session tracking should pause session processing while session ownership operations for this leg are in progress.
      void suspend()
      Suspend sending messages from the message queue.
      void unlinkLeg()
      Immediately unlink this leg from the leg linked to it, if any.
      Leg upstreamFork​(org.jainslee.resources.sip.OutgoingSipRequest notify, java.lang.String forkedLegName)
      Immediately create a new leg which is an upstream fork to this leg resulting from a forked subscription and attach the Sentinel service SBB to the ACI of the notify request SipSession.
      Leg upstreamFork​(org.jainslee.resources.sip.OutgoingSipResponse responseToBeSent, java.lang.String forkedLegName)
      Immediately create a new leg which is an upstream fork to this leg and attach the Sentinel service SBB to the ACI of the responseToBeSent SipSession.
    • Field Detail

    • Method Detail

      • getLegName

        java.lang.String getLegName()
        The name assigned to the leg by the core or by a feature. The name must be unique for the Sentinel SIP instance:

        The following well known leg names are used:

        1. calledParty
        2. callingParty

        As Leg is not serializable, the legName is used to store a reference to the leg. The Leg associated with the legName is obtained using the LegManager.getLeg(String) method.

        Returns:
        Unique leg name for this leg.
      • sendMessage

        void sendMessage​(org.jainslee.resources.sip.SipMessage requestOrResponseToBeSent)
                  throws TransactionInProgressException
        Queue the SipRequest or SipResponse in the MessagesToSend queue for the leg.

        Multiple message may be sent on a single leg, each method call will queue the supplied message. During instruction execution the LegManager will send the messages in FIFO order. For instance:

        • ACK + INVITE - required when playing announcements
        • 181 + ERROR - CDIV when max forwards reached

        The request or response queued may be subsequently removed or altered. The pending message queue for the leg is accessed using getMessagesToSend().

        Parameters:
        requestOrResponseToBeSent - SipMessage to be sent on this leg.
        Throws:
        TransactionInProgressException
      • sendCancel

        void sendCancel​(org.jainslee.resources.sip.Parameterable... reasonHeaders)
        Queues a CANCEL to the initial INVITE on the leg's MessagesToSend queue, adding the given Reason headers. The queued CANCEL may be subsequently removed or have its Reason headers altered (other changes will have no effect). The pending message queue for the leg is accessed using getMessagesToSend(). If no parameters are passed to this method, no Reason headers will be included on the outbound CANCEL request.
        Parameters:
        reasonHeaders - The Reason headers to add to the outbound CANCEL request.
      • parallelFork

        Leg parallelFork​(org.jainslee.resources.sip.OutgoingSipRequest inviteToBeSentOnForkedLeg,
                         java.lang.String forkedLegName)
                  throws DuplicateLegException
        Immediately create a new leg which is a parallel fork to this leg and attach the Sentinel service SBB to the ACI of the inviteToBeSentOnForkedLeg SipSession. Queue the inviteToBeSentOnForkedLeg INVITE on the MessagesToSend queue of the forked leg.

        If the leg is not in a parallel forked group then add both legs to a parallel forked group. If the leg is already part of a parallel forked group then add the new leg to that group.

        On return isParallelForked() will return true. On return a call getParallelForkedLegs() will include the leg and new forked leg and any other legs that are already parallel forks of the legs.

        Parameters:
        inviteToBeSentOnForkedLeg - Outgoing Invite to be sent.
        forkedLegName - the new parallel fork leg name, it must be unique. legNames are case sensitive.
        Throws:
        DuplicateLegException - If leg already exists with the supplied name.
      • upstreamFork

        Leg upstreamFork​(org.jainslee.resources.sip.OutgoingSipResponse responseToBeSent,
                         java.lang.String forkedLegName)
                  throws DuplicateLegException
        Immediately create a new leg which is an upstream fork to this leg and attach the Sentinel service SBB to the ACI of the responseToBeSent SipSession. Queue the responseToBeSent on the MessagesToSend queue for the new forked leg.

        If the leg is not in a upstream forked group then add both legs to a upstream forked group. If the leg is already part of an upstream forked group then add the new leg to that group.

        On return isUpstreamForked() will return true. On return a call getUpstreamForkedLegs() will include the leg and new forked leg and any other legs that are already parallel forks of the legs.

        Parameters:
        responseToBeSent - SipMessage to be sent on this leg.
        forkedLegName - the new upstream fork leg name, it must be unique for this Sentinel SIP service instance. Leg names are case sensitive.
        Throws:
        DuplicateLegException - If leg already exists with the supplied name.
      • upstreamFork

        Leg upstreamFork​(org.jainslee.resources.sip.OutgoingSipRequest notify,
                         java.lang.String forkedLegName)
                  throws DuplicateLegException
        Immediately create a new leg which is an upstream fork to this leg resulting from a forked subscription and attach the Sentinel service SBB to the ACI of the notify request SipSession. Queue the notify request on the MessagesToSend queue for the new forked leg.

        If the leg is not in a upstream forked group then add both legs to a upstream forked group. If the leg is already part of an upstream forked group then add the new leg to that group.

        On return isUpstreamForked() will return true. On return a call getUpstreamForkedLegs() will include the leg and new forked leg and any other legs

        Reserved for system features.

        Parameters:
        notify - Outgoing NOTIFY to be sent.
        forkedLegName - the new upstream fork leg name, it must be unique for this Sentinel SIP service instance. Leg names are case sensitive.
        Throws:
        DuplicateLegException - If leg already exists with the supplied name.
      • downstreamFork

        Leg downstreamFork​(org.jainslee.resources.sip.SipSession session,
                           java.lang.String legName)
                    throws DuplicateLegException
        Immediate create a new leg which is a downstream fork to this leg, associate it with the provided SipSession and attach the Sentinel service SBB to the ACI of the SipSession.

        If the leg is not in a downstream forked group then add both legs to a downstream forked group. If the leg is already part of an downstream forked group then add the new leg to that group.

        On return isDownstreamForked() will return true. On return a call getDownstreamForkedLegs() will include the leg and new forked leg and any other legs

        Reserved for system features.

        Parameters:
        session - the SipSession of the new downstream fork leg.
        legName - the new downstream fork leg name, it must be unique for this Sentinel SIP service instance. Leg names are case sensitive.
        Throws:
        DuplicateLegException - If leg already exists with the supplied name.
      • refreshSession

        void refreshSession​(long refreshPeriod,
                            boolean useUpdate)
        Queue an instruction to perform session refresh on the leg when the leg manager is requested to execute instructions. During instruction processing a session refresh request procedure is initiated if the configured refresh period for the leg has been exceeded and there isn't a request in progress.

        Reserved for system features.

        Parameters:
        refreshPeriod - The time period in seconds of inactivity before needing to send a request to keep session alive
        useUpdate - Use an UPDATE request to refresh the session so long as UPDATE requests are allowed on the leg
      • linkLeg

        void linkLeg​(Leg leg)
              throws LegsAlreadyLinkedException,
                     java.lang.IllegalArgumentException
        Immediately link this leg to the leg provided as an argument.

        If the legs are already linked to each other, the legs will remain linked. If either of the legs is linked to another leg then LegsAlreadyLinkedException will be thrown. Legs may not be linked to themselves, and IllegalArgumentException will be thrown if this is attempted.

        When linked, features may choose to act as a B2BUA between those legs.

        Parameters:
        leg - the leg to link with this leg.
        Throws:
        LegsAlreadyLinkedException - if either of the legs are currently linked to another leg.
        java.lang.IllegalArgumentException - when supplied leg is null or is the same as this leg.
      • unlinkLeg

        void unlinkLeg()
        Immediately unlink this leg from the leg linked to it, if any. If the leg is not actually linked, there is no effect.
      • getLinkedLeg

        Leg getLinkedLeg()
        Return the leg linked to this leg.
        Returns:
        the leg linked to this leg, otherwise return null.
      • isLinked

        boolean isLinked()
        Return true if this leg is linked to another leg.
        Returns:
        true if this leg is linked to another leg, otherwise return false.
      • isDownstreamForked

        boolean isDownstreamForked()
        Return true if this leg is part of a set of downstream forked legs.
        Returns:
        true if this leg is a downstream forked leg, otherwise return false.
      • getDownstreamForkedLegs

        java.util.Set<Leg> getDownstreamForkedLegs()
        Return the set of legs including this leg which are included in a downstream fork session set. If isDownstreamForked() return false calls to this method will return an empty collection.
        Returns:
        Set of downstream fork legs that this leg is a part of, otherwise return an empty collection.
      • isUpstreamForked

        boolean isUpstreamForked()
        Return true if this leg is part of a set of upstream forked legs.
        Returns:
        true if this leg is an upstream forked leg, otherwise return false.
      • getUpstreamForkedLegs

        java.util.Set<Leg> getUpstreamForkedLegs()
        Return a set of legs including this leg which are included in an upstream fork session set. If isUpstreamForked() return false calls to this method will return a empty collection.
        Returns:
        Set of upstream fork legs that this leg is a part of, otherwise return an empty collection.
      • isParallelForked

        boolean isParallelForked()
        Return true if this leg is part of a set of parallel forked legs
        Returns:
        true if this leg is a parallel forked leg, otherwise return false.
      • getParallelForkedLegs

        java.util.Set<Leg> getParallelForkedLegs()
        Return a set of legs including this leg which are included in a parallel fork session set. If isParallelForked() return false calls to this method will return a empty collection.
        Returns:
        Set of parallel fork legs that this leg is a part of, otherwise return an empty collection.
      • isActive

        boolean isActive()
        Return true if leg is Active.
        Returns:
        true if leg is attached to a SIP Session, otherwise return false.
      • getSipSession

        org.jainslee.resources.sip.SipSession getSipSession()
        Return the SipSession for this leg .
        Returns:
        SipSession for this leg.
      • getAci

        javax.slee.ActivityContextInterface getAci()
        Return the ACI for this leg.
        Returns:
        ACI for this leg.
      • getLatestMessageTimestamp

        long getLatestMessageTimestamp()
        Return the time of the last message sent or received on this leg.
        Returns:
        milliseconds from the epoch 00:00:00, January 1, 1970 UTC to time that the last message on leg was sent.
      • getInviteRequest

        org.jainslee.resources.sip.SipRequest getInviteRequest()
        Return the initial INVITE SIP request sent/received on this leg/session.
        Returns:
        The initial INVITE SIP request sent/received on this leg.
      • setInviteRequest

        void setInviteRequest​(org.jainslee.resources.sip.SipRequest request)
        Set the initial INVITE SIP request sent/received on this leg/session.
        Parameters:
        request - The initial INVITE SIP request sent/received on this leg.
      • getLatestInviteRequest

        org.jainslee.resources.sip.SipRequest getLatestInviteRequest()
        Return the latest Invite SIP request sent/received on this leg/session.
        Returns:
        The latest Invite SIP request sent/received on this leg/session.
      • setInitialSubscribe

        void setInitialSubscribe​(org.jainslee.resources.sip.SipRequest subscribe)
        Set the initial SUBSCRIBE SIP request sent/received on this leg/session.
        Parameters:
        subscribe - The initial SUBSCRIBE SIP request sent/received on this leg.
      • getInitialSubscribe

        org.jainslee.resources.sip.SipRequest getInitialSubscribe()
        Return the initial SUBSCRIBE SIP request sent/received on this leg/session.
        Returns:
        The initial SUBSCRIBE SIP request sent/received on this leg.
      • getLatestRequest

        org.jainslee.resources.sip.SipRequest getLatestRequest()
        Return the latest SIP request sent/received on this leg/session.
        Returns:
        The latest SIP request sent/received on this leg/session.
      • getLatestIncomingRequest

        org.jainslee.resources.sip.SipRequest getLatestIncomingRequest​(java.lang.String method)
        Gets the latest SIP request received on this leg/session, with the given method, and for which we have not sent a response. For CANCEL requests specifically, they will still be accessible with this method even after a response has been sent.
        Parameters:
        method - The method of the request to retrieve.
        Returns:
        The requested SIP request, or null if no appropriate request was found.
      • setLatestRequest

        void setLatestRequest​(org.jainslee.resources.sip.SipRequest request)
        Set the latest SIP request sent/received on this leg/session.
        Parameters:
        request - The latest SIP request sent/received on this leg.
      • getLatestResponse

        org.jainslee.resources.sip.SipResponse getLatestResponse()
        Return the latest SIP response sent/received on this leg/session.
        Returns:
        The latest SIP response sent/received on this leg/session.
      • getLatestProvisionalInviteResponse

        org.jainslee.resources.sip.SipResponse getLatestProvisionalInviteResponse()
        Return the latest SIP response sent/received on this leg/session.
        Returns:
        The latest SIP response sent/received on this leg/session.
      • getOutstandingReliableResponseIDs

        java.util.Set<ReliableResponseID> getOutstandingReliableResponseIDs()
        Gets the set of IDs for reliable responses for which we have not yet seen a PRACK on this leg.
        Returns:
        An immutable set of the outstanding IDs.
      • getOutstandingTransactionsByMethod

        java.util.Set<java.lang.String> getOutstandingTransactionsByMethod()
        Return a list of SipRequest methods for all outstanding transactions on this leg. This method may be used by features to determine whether to send a request or not based on the current state of outstanding transactions on the leg. The string values are those that are returned by SipMessage.getMethod() and are provided as fields on SipRequest e.g. SipRequest.INVITE.
        Returns:
        set of strings of SipRequest methods which have are currently outstanding transactions on this leg.
      • getLatestReceivedSDP

        com.opencloud.sentinel.sdp.SessionDescriptionWrapper getLatestReceivedSDP()
        Return the latest SDP received on this session.
        Returns:
        The latest SDP received on this Leg.
      • setLatestReceivedSDP

        void setLatestReceivedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
        Set the latest SDP received on this session.
        Parameters:
        sdp - The latest SDP received on this Leg.
      • getLatestSentSDP

        com.opencloud.sentinel.sdp.SessionDescriptionWrapper getLatestSentSDP()
        Return he latest SDP sent on this session.
        Returns:
        The latest SDP sent on this Leg.
      • setLatestSentSDP

        void setLatestSentSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
        Set the latest SDP sent on this session.
        Parameters:
        sdp - The latest SDP sent on this Leg.
      • getCommittedSDP

        com.opencloud.sentinel.sdp.SessionDescriptionWrapper getCommittedSDP()
        Return the committed SDP on this session.
        Returns:
        The committed SDP on this Leg.
      • setCommittedSDP

        void setCommittedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
        Set the committed SDP on this session.
        Parameters:
        sdp - The committed SDP on this Leg.
      • getLatestSentSDPSequenceNumber

        java.lang.Long getLatestSentSDPSequenceNumber()
        Return the latest sent SDP sequence number on this session.
        Returns:
        The latest sent SDP sequence number on this Leg.
      • setLatestSentSDPSequenceNumber

        void setLatestSentSDPSequenceNumber​(java.lang.Long number)
        Set the latest sent SDP sequence number on this session.
        Parameters:
        number - The latest sent SDP sequence number on this Leg.
      • getPreviousSentSDPSequenceNumber

        java.lang.Long getPreviousSentSDPSequenceNumber()
        Return the previously sent SDP sequence number on this session. That is, the one sent before the latest.
        Returns:
        The previous SDP sequence number on this Leg.
      • setPreviousSentSDPSequenceNumber

        void setPreviousSentSDPSequenceNumber​(java.lang.Long number)
        Set the previous sent SDP sequence number on this session. That is, the one sent before the latest.
        Parameters:
        number - The previous sent SDP sequence number on this Leg.
      • getLatestReceivedSDPSequenceNumber

        java.lang.Long getLatestReceivedSDPSequenceNumber()
        Return the latest received SDP sequence number on this session.
        Returns:
        The latest received SDP sequence number on this Leg.
      • setLatestReceivedSDPSequenceNumber

        void setLatestReceivedSDPSequenceNumber​(java.lang.Long number)
        Set the latest received SDP sequence number on this session.
        Parameters:
        number - The latest received SDP sequence number on this Leg.
      • getPreviousReceivedSDPSequenceNumber

        java.lang.Long getPreviousReceivedSDPSequenceNumber()
        Return the previously received SDP sequence number on this session. That is, the one received before the latest.
        Returns:
        The previous received SDP sequence number on this Leg.
      • setPreviousReceivedSDPSequenceNumber

        void setPreviousReceivedSDPSequenceNumber​(java.lang.Long number)
        Set the previously received SDP sequence number on this session. That is, the one received before the latest.
        Parameters:
        number - The latest received SDP sequence number on this Leg.
      • getPreviousReceivedSDP

        com.opencloud.sentinel.sdp.SessionDescriptionWrapper getPreviousReceivedSDP()
        Return the previous SDP received on this session.
        Returns:
        The previous SDP received on this Leg.
      • setPreviousReceivedSDP

        void setPreviousReceivedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
        Set the previous SDP received on this session.
        Parameters:
        sdp - The previous SDP received on this Leg.
      • getPreviousSentSDP

        com.opencloud.sentinel.sdp.SessionDescriptionWrapper getPreviousSentSDP()
        Return the previous SDP sent on this session.
        Returns:
        The previous SDP sent on this Leg.
      • setPreviousSentSDP

        void setPreviousSentSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
        Set the previous SDP sent on this session.
        Parameters:
        sdp - The previous SDP sent on this Leg.
      • getCommittedSDPSequenceNumber

        java.lang.Long getCommittedSDPSequenceNumber()
        Return the committed SDP sequence number on this session.
        Returns:
        The committed SDP sequence number on this Leg.
      • setCommittedSDPSequenceNumber

        void setCommittedSDPSequenceNumber​(java.lang.Long number)
        Set the committed SDP sequence number on this session.
        Parameters:
        number - The committed SDP sequence number on this Leg.
      • getPreviousCommittedSDP

        com.opencloud.sentinel.sdp.SessionDescriptionWrapper getPreviousCommittedSDP()
        Return the previous committed SDP on this session.
        Returns:
        The previous committed SDP on this Leg.
      • setPreviousCommittedSDP

        void setPreviousCommittedSDP​(com.opencloud.sentinel.sdp.SessionDescriptionWrapper sdp)
        Set the previous committed SDP on this session.
        Parameters:
        sdp - The previous committed SDP on this Leg.
      • getHasOutstandingSDPOffer

        boolean getHasOutstandingSDPOffer()
        Return whether there is an oustanding SDP offer on this leg
        Returns:
        True iff there is an outstanding SDP offer on this leg
      • setHasOutstandingSDPOffer

        void setHasOutstandingSDPOffer​(boolean hasOutstandingSDPOFfer)
        Set whether there is an outstanding SDP offer on this leg
        Parameters:
        hasOutstandingSDPOFfer - A boolean specifying
      • isTrackingEnabled

        boolean isTrackingEnabled()
        Get the value of the tracking enabled flag, which indicates if session tracking is enabled for this leg.
        Returns:
        true if session tracking is enabled for this leg.
      • setTrackingEnabled

        void setTrackingEnabled​(boolean trackingEnabled)
        Sets whether session tracking should be enabled for this leg.
        Parameters:
        trackingEnabled - true to enable session tracking, false to disable session tracking.
      • isWaitForTrackingResultEnabled

        boolean isWaitForTrackingResultEnabled()
        Get the value of the wait for tracking result enabled flag, which indicates whether session tracking should pause session processing while session ownership store operations for this leg are in progress. Note that delete operations are not affected by this, the session will never be paused when deleting tracking data.
        Returns:
        true if wait for tracking result is enabled for this leg.
      • setWaitForTrackingResultEnabled

        void setWaitForTrackingResultEnabled​(boolean waitForTrackingResultEnabled)
        Set the value of the wait for tracking result enabled flag, which indicates whether session tracking should pause session processing while session ownership operations for this leg are in progress. Note that delete operations are not affected by this, the session will never be paused when deleting tracking data.
        Parameters:
        waitForTrackingResultEnabled - true to enable wait for tracking result, false to disable wait for tracking result.
      • getAdditionalTrackingKeys

        java.util.Set<java.lang.String> getAdditionalTrackingKeys()
        Get the set of additional keys used for session tracking on this leg. The returned set is a copy of the original so changes to it will not be reflected on the leg unless Leg#setAdditionalTrackingKeys(Set) is called. An empty set will be returned if there are no additional tracking keys set for this leg.
        Returns:
        the set of additional keys used for session tracking on this leg.
      • addAdditionalTrackingKeys

        void addAdditionalTrackingKeys​(java.lang.String... additionalTrackingKeys)
        Add one or more additional tracking keys to the set of additional keys used to track this leg. Additional tracking keys cannot be removed once added.
        Parameters:
        additionalTrackingKeys - additional tracking key(s) to add to this leg
      • getAdditionalTrackedAttributes

        java.util.Map<java.lang.String,​java.lang.String> getAdditionalTrackedAttributes()
        Get the map of additional attribute name/values used for session tracking on this leg. The returned map is a copy of the original so changes to it will not be reflected on the leg unless setAdditionalTrackedAttributes(Map) is called. An empty map will be returned if there are no additional tracked attributes for this leg.
        Returns:
        the map of additional attribute name/values.
      • setAdditionalTrackedAttributes

        void setAdditionalTrackedAttributes​(java.util.Map<java.lang.String,​java.lang.String> additionalTrackedAttributes)
        Set the map of additional tracked attributes used for session tracking on this leg.
        Parameters:
        additionalTrackedAttributes - the map of additional tracked attributes.
      • getOwner

        java.lang.String getOwner()
        Gets the URI string of the node that currently owns this leg.
        Returns:
        The URI of the node that owns this leg (as a String).
      • setOwner

        void setOwner​(java.lang.String ownerUri)
        Sets the URI string of the node that currently owns this leg.
        Parameters:
        ownerUri - The URI string for the new owner for this leg.
      • getLastTrackingDataChangeTime

        java.lang.Long getLastTrackingDataChangeTime()
        Gets the timestamp of the last update to any of the session tracking fields on this leg. The session tracking fields are: - TrackingEnabled - AdditionalTrackingKeys - AdditionalTrackedAttributes - Owner
        Returns:
        The timestamp of the last update to any of the session tracking fields on this leg (unix time in millis)
      • getDialogID

        org.jainslee.resources.sip.DialogID getDialogID()
        Gets the Dialog ID of the SipSession for this leg.
        Returns:
        The Dialog ID of the SipSession for this leg.
      • proxySessionAndDoNotRecordRoute

        void proxySessionAndDoNotRecordRoute()
        Proxy the initial request received on the leg using the URI received in the initial request. Remove Sentinel from the route.

        Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.

      • proxySessionAndDoNotRecordRoute

        void proxySessionAndDoNotRecordRoute​(org.jainslee.resources.sip.URI newRequestUri)
        Proxy the initial request received on the leg using a different request URI. Remove Sentinel from the route.

        Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.

        Parameters:
        newRequestUri - the initial request will be proxied to this address.
      • proxySessionAndDoNotRecordRoute

        void proxySessionAndDoNotRecordRoute​(org.jainslee.resources.sip.URI[] newRequestUris)
        Proxy the session to continue using different request URIs and remove Sentinel from the route.

        Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.

        Parameters:
        newRequestUris - the initial request will be proxied to these destinations.
      • proxySessionInternal

        ProxyResult proxySessionInternal​(org.jainslee.resources.sip.URI newRequestUri)
        Proxy the session to continue using different request URIs and remove Sentinel from the route. The URI should point to another node within the Rhino cluster, it will be checked for liveness before attempting to proxy.

        Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.

        Parameters:
        newRequestUri - the initial request will be proxied to these destinations.
        Returns:
        The result of attempting to proxy the request or NOT_PROXIABLE if the request was unsuitable for proxying
      • isSuspended

        boolean isSuspended()
        Returns:
        true if suspended otherwise false
        See Also:
        resume(), suspend()
      • suspend

        void suspend()
        Suspend sending messages from the message queue.
        See Also:
        resume(), isSuspended()
      • resume

        void resume()
        Resume sending messages from this queue. The next time the queue is processed the messages will be sent if the queue has not been suspended again.
        See Also:
        suspend(), isSuspended()
      • endSubscriptions

        boolean endSubscriptions()
        Queue an instruction to end all subscriptions on this leg. When instruction processing is performed by the LegManager a terminating SUBSCRIBE or NOTIFY will be sent for each subscription.
        Returns:
        true if any subscriptions will be terminated during instruction processing, otherwise false.
      • endSubscriptions

        boolean endSubscriptions​(java.lang.String reason)
        Queue an instruction to end all subscriptions on this leg. When instruction processing is performed by the LegManager a terminating SUBSCRIBE or NOTIFY will be sent for each subscription.
        Parameters:
        reason - the reason for the subscription ending, may be null. See RFC6665 §7.2.
        Returns:
        true if any subscriptions will be terminated during instruction processing, otherwise false.
      • endSubscription

        boolean endSubscription​(SubscribedEventID eventID)
        Queue an instruction to end a given subscription. When instruction processing is performed by the LegManager a terminating SUBSCRIBE or NOTIFY will be send for the subscription.
        Parameters:
        eventID - the SubscribedEventID identifying the subscription to end.
        Returns:
        true if a matching subscription was found.
      • endSubscription

        boolean endSubscription​(SubscribedEventID eventID,
                                java.lang.String reason)
        Queue an instruction to end a given subscription. When instruction processing is performed by the LegManager a terminating SUBSCRIBE or NOTIFY will be send for the subscription.
        Parameters:
        eventID - the SubscribedEventID identifying the subscription to end.
        reason - the reason for the subscription ending, may be null. See RFC6665 §7.2.
        Returns:
        true if a matching subscription was found.
      • endSubscription

        boolean endSubscription​(SubscribedEventID eventID,
                                MessageBody messageBody)
        Queue an instruction to end a given subscription. When instruction processing is performed by the LegManager a terminating SUBSCRIBE or NOTIFY will be send for the subscription.
        Parameters:
        eventID - the SubscribedEventID identifying the subscription to end.
        messageBody - the message body to add to the SUBSCRIBE or NOTIFY
        Returns:
        true if a matching subscription was found.
      • endSubscription

        boolean endSubscription​(SubscribedEventID eventID,
                                java.lang.String reason,
                                MessageBody messageBody)
        Queue an instruction to end a given subscription. When instruction processing is performed by the LegManager a terminating SUBSCRIBE or NOTIFY will be send for the subscription.
        Parameters:
        eventID - the SubscribedEventID identifying the subscription to end.
        reason - the reason for the subscription ending, may be null. See RFC6665 §7.2.
        messageBody - the message body to add to the SUBSCRIBE or NOTIFY
        Returns:
        true if a matching subscription was found.
      • endInviteSession

        boolean endInviteSession()
        Queue an instruction to release an INVITE-initiated dialog during instruction processing. The action taken depends on the current state of the leg (see LegManager.releaseLeg(Leg)). Subscriptions on the same dialog are not affected, the dialog will only end if there are no active subscriptions.
        Returns:
        true if an invite session was found and terminated, otherwise false.
      • getInviteSessionPhase

        InviteSessionPhase getInviteSessionPhase()
        Indicates which phase the INVITE session for this leg is in. Phases change as sent/received messages advance the progress of call setup. Null if this leg does not have an INVITE session or if the initial INVITE has yet to be processed.
        Returns:
        An enum value representing the current phase of this leg's INVITE session.