public interface Leg
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SEND_MESSAGE_FAILED_INSTRUCTION
Send Message instruction value, used in
FailedInstruction . |
Modifier and Type | Method and 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(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.
|
SessionDescriptionWrapper |
getCommittedSDP()
Return the committed SDP on this session.
|
java.lang.Long |
getCommittedSDPSequenceNumber()
Return the committed SDP sequence number on this session.
|
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
|
SipRequest |
getInitialSubscribe()
Return the initial SUBSCRIBE SIP request sent/received on this leg/session.
|
SipRequest |
getInviteRequest()
Return the initial INVITE SIP request sent/received on this leg/session.
|
java.lang.Long |
getLastTrackingDataChangeTime()
Gets the timestamp of the last update to any of the session tracking fields on this leg.
|
SipRequest |
getLatestIncomingRequest(java.lang.String method)
Return the latest SIP request received on this leg/session with the given method.
|
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.
|
SessionDescriptionWrapper |
getLatestReceivedSDP()
Return the latest SDP received on this session.
|
java.lang.Long |
getLatestReceivedSDPSequenceNumber()
Return the latest received SDP sequence number on this session.
|
SipRequest |
getLatestRequest()
Return the latest SIP request sent/received on this leg/session.
|
SipResponse |
getLatestResponse()
Return the latest SIP response sent/received on this leg/session.
|
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<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.
|
SessionDescriptionWrapper |
getPreviousCommittedSDP()
Return the previous committed SDP on this session.
|
SessionDescriptionWrapper |
getPreviousReceivedSDP()
Return the previous SDP received on this session.
|
java.lang.Long |
getPreviousReceivedSDPSequenceNumber()
Return the previously received SDP sequence number on this session.
|
SessionDescriptionWrapper |
getPreviousSentSDP()
Return the previous SDP sent on this session.
|
java.lang.Long |
getPreviousSentSDPSequenceNumber()
Return the previously sent SDP sequence number on this session.
|
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(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(URI newRequestUri)
Proxy the initial request received on the leg using a different request URI.
|
void |
proxySessionAndDoNotRecordRoute(URI[] newRequestUris)
Proxy the session to continue using different request URIs and remove Sentinel
from the route.
|
ProxyResult |
proxySessionInternal(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()
Queues a CANCEL to the initial INVITE on the leg's MessagesToSend queue.
|
void |
sendMessage(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(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(SipRequest subscribe)
Set the initial SUBSCRIBE SIP request sent/received on this leg/session.
|
void |
setInviteRequest(SipRequest request)
Set the initial INVITE SIP request sent/received on this leg/session.
|
void |
setLatestReceivedSDP(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(SipRequest request)
Set the latest SIP request sent/received on this leg/session.
|
void |
setLatestSentSDP(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(SessionDescriptionWrapper sdp)
Set the previous committed SDP on this session.
|
void |
setPreviousReceivedSDP(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(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(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(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.
|
static final java.lang.String SEND_MESSAGE_FAILED_INSTRUCTION
FailedInstruction
.java.lang.String getLegName()
The following well known leg names are used:
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.
void sendMessage(SipMessage requestOrResponseToBeSent) throws TransactionInProgressException
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:
The request or response queued may be subsequently removed or altered. The pending message queue for the leg
is accessed using getMessagesToSend()
.
requestOrResponseToBeSent
- SipMessage to be sent on this leg.TransactionInProgressException
void sendCancel()
getMessagesToSend()
.Leg parallelFork(OutgoingSipRequest inviteToBeSentOnForkedLeg, java.lang.String forkedLegName) throws DuplicateLegException
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.
inviteToBeSentOnForkedLeg
- Outgoing Invite to be sent.forkedLegName
- the new parallel fork leg name, it must be unique. legNames are case sensitive.DuplicateLegException
- If leg already exists with the supplied name.Leg upstreamFork(OutgoingSipResponse responseToBeSent, java.lang.String forkedLegName) throws DuplicateLegException
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.
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.DuplicateLegException
- If leg already exists with the supplied name.Leg upstreamFork(OutgoingSipRequest notify, java.lang.String forkedLegName) throws DuplicateLegException
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.
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.DuplicateLegException
- If leg already exists with the supplied name.Leg downstreamFork(SipSession session, java.lang.String legName) throws DuplicateLegException
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.
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.DuplicateLegException
- If leg already exists with the supplied name.void refreshSession(long refreshPeriod, boolean useUpdate)
Reserved for system features.
refreshPeriod
- The time period in seconds of inactivity before needing to send a request to keep session aliveuseUpdate
- Use an UPDATE request to refresh the session so long as UPDATE requests are allowed on the legvoid linkLeg(Leg leg) throws LegsAlreadyLinkedException, java.lang.IllegalArgumentException
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.
leg
- the leg to link with this leg.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.void unlinkLeg()
Leg getLinkedLeg()
boolean isLinked()
boolean isDownstreamForked()
java.util.Set<Leg> getDownstreamForkedLegs()
isDownstreamForked()
return false calls to this method will return an empty collection.boolean isUpstreamForked()
java.util.Set<Leg> getUpstreamForkedLegs()
isUpstreamForked()
return false calls to this method will return a empty collection.boolean isParallelForked()
java.util.Set<Leg> getParallelForkedLegs()
isParallelForked()
return false calls to this method will return a empty collection.boolean isActive()
SipSession getSipSession()
javax.slee.ActivityContextInterface getAci()
long getLatestMessageTimestamp()
SipRequest getInviteRequest()
void setInviteRequest(SipRequest request)
request
- The initial INVITE SIP request sent/received on this leg.SipRequest getLatestInviteRequest()
void setInitialSubscribe(SipRequest subscribe)
subscribe
- The initial SUBSCRIBE SIP request sent/received on this leg.SipRequest getInitialSubscribe()
SipRequest getLatestRequest()
SipRequest getLatestIncomingRequest(java.lang.String method)
method
- The method of the latest SIP request received on this leg/session with the given method.void setLatestRequest(SipRequest request)
request
- The latest SIP request sent/received on this leg.SipResponse getLatestResponse()
SipMessageQueue getMessagesToSend()
Iterable
containing messages to be sent on this leg/session.
Iterating over the message queue will return all queued items in FIFO order.
final SipMessageQueue queue ...; for (SipMessage msgToSend : queue) { }
Messages are added to this queue by:
sendMessage(SipMessage)
sendCancel()
parallelFork(OutgoingSipRequest, String)
upstreamFork(OutgoingSipRequest, String)
upstreamFork(OutgoingSipResponse, String)
LegManager.createLeg(OutgoingSipRequest, String)
Message are removed from the queue by:
The messages in the queue may be modified or removed from the queue using methods on the returned SipMessageQueue.
SipMessage
to be sent on this Leg.java.util.Set<java.lang.String> getOutstandingTransactionsByMethod()
SipRequest#getMethod()
and are provided as fields on SipRequest e.g. SipRequest.INVITE.SessionDescriptionWrapper getLatestReceivedSDP()
void setLatestReceivedSDP(SessionDescriptionWrapper sdp)
sdp
- The latest SDP received on this Leg.SessionDescriptionWrapper getLatestSentSDP()
void setLatestSentSDP(SessionDescriptionWrapper sdp)
sdp
- The latest SDP sent on this Leg.SessionDescriptionWrapper getCommittedSDP()
void setCommittedSDP(SessionDescriptionWrapper sdp)
sdp
- The committed SDP on this Leg.java.lang.Long getLatestSentSDPSequenceNumber()
void setLatestSentSDPSequenceNumber(java.lang.Long number)
number
- The latest sent SDP sequence number on this Leg.java.lang.Long getPreviousSentSDPSequenceNumber()
void setPreviousSentSDPSequenceNumber(java.lang.Long number)
number
- The previous sent SDP sequence number on this Leg.java.lang.Long getLatestReceivedSDPSequenceNumber()
void setLatestReceivedSDPSequenceNumber(java.lang.Long number)
number
- The latest received SDP sequence number on this Leg.java.lang.Long getPreviousReceivedSDPSequenceNumber()
void setPreviousReceivedSDPSequenceNumber(java.lang.Long number)
number
- The latest received SDP sequence number on this Leg.SessionDescriptionWrapper getPreviousReceivedSDP()
void setPreviousReceivedSDP(SessionDescriptionWrapper sdp)
sdp
- The previous SDP received on this Leg.SessionDescriptionWrapper getPreviousSentSDP()
void setPreviousSentSDP(SessionDescriptionWrapper sdp)
sdp
- The previous SDP sent on this Leg.java.lang.Long getCommittedSDPSequenceNumber()
void setCommittedSDPSequenceNumber(java.lang.Long number)
number
- The committed SDP sequence number on this Leg.SessionDescriptionWrapper getPreviousCommittedSDP()
void setPreviousCommittedSDP(SessionDescriptionWrapper sdp)
sdp
- The previous committed SDP on this Leg.boolean getHasOutstandingSDPOffer()
void setHasOutstandingSDPOffer(boolean hasOutstandingSDPOFfer)
hasOutstandingSDPOFfer
- A boolean specifyingboolean isTrackingEnabled()
void setTrackingEnabled(boolean trackingEnabled)
trackingEnabled
- true to enable session tracking, false to disable session tracking.boolean isWaitForTrackingResultEnabled()
void setWaitForTrackingResultEnabled(boolean waitForTrackingResultEnabled)
waitForTrackingResultEnabled
- true to enable wait for tracking result, false to disable wait for tracking result.java.util.Set<java.lang.String> getAdditionalTrackingKeys()
Leg#setAdditionalTrackingKeys(Set)
is called.
An empty set will be returned if there are no additional tracking keys set for this leg.void addAdditionalTrackingKeys(java.lang.String... additionalTrackingKeys)
additionalTrackingKeys
- additional tracking key(s) to add to this legjava.util.Map<java.lang.String,java.lang.String> getAdditionalTrackedAttributes()
setAdditionalTrackedAttributes(Map)
is called.
An empty map will be returned if there are no additional tracked attributes for this leg.void setAdditionalTrackedAttributes(java.util.Map<java.lang.String,java.lang.String> additionalTrackedAttributes)
additionalTrackedAttributes
- the map of additional tracked attributes.java.lang.String getOwner()
void setOwner(java.lang.String ownerUri)
ownerUri
- The URI string for the new owner for this leg.java.lang.Long getLastTrackingDataChangeTime()
DialogID getDialogID()
void proxySessionAndDoNotRecordRoute()
Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.
void proxySessionAndDoNotRecordRoute(URI newRequestUri)
Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.
newRequestUri
- the initial request will be proxied to this address.void proxySessionAndDoNotRecordRoute(URI[] newRequestUris)
Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.
newRequestUris
- the initial request will be proxied to these destinations.ProxyResult proxySessionInternal(URI newRequestUri)
Note: when using this method directly the caller will have to to unlink any linked leg's and detach them manually.
newRequestUri
- the initial request will be proxied to these destinations.boolean isSuspended()
void suspend()
resume()
,
isSuspended()
void resume()
suspend()
,
isSuspended()
boolean endSubscriptions()
boolean endSubscriptions(java.lang.String reason)
reason
- the reason for the subscription ending, may be null.
See RFC6665 §7.2.boolean endSubscription(SubscribedEventID eventID)
eventID
- the SubscribedEventID
identifying the subscription to end.boolean endSubscription(SubscribedEventID eventID, java.lang.String reason)
eventID
- the SubscribedEventID
identifying the subscription to end.reason
- the reason for the subscription ending, may be null.
See RFC6665 §7.2.boolean endSubscription(SubscribedEventID eventID, MessageBody messageBody)
eventID
- the SubscribedEventID
identifying the subscription to end.messageBody
- the message body to add to the SUBSCRIBE or NOTIFYboolean endSubscription(SubscribedEventID eventID, java.lang.String reason, MessageBody messageBody)
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 NOTIFYjava.util.Set<SubscribedEventID> getSubscriptions()
SubscribedEventID
.boolean endInviteSession()
LegManager.releaseLeg(Leg)
). Subscriptions on the same
dialog are not affected, the dialog will only end if there are no active subscriptions.Copyright © OpenCloud. All Rights Reserved.