When the downstream leg of a call is replaced during call setup, this feature takes care of mediating SDP negotiations between the upstream leg and the new downstream leg. This avoids the need to fork the upstream leg, which is not always possible.
The feature takes over negotiations after the first reliable INVITE 18x response with SDP is forwarded upstream. Any SDP bearing provisional or final responses received afterwards are transformed into UPDATE requests on the upstream leg, with the SDP origin session and version number updated as necessary.
Details
Feature script name |
LegSDPMediation |
|---|---|
Applicable contexts |
SIP service |
SAS Support |
Yes |
Prerequisite features |
N/A |
Feature execution points |
|
Upgrading from the SequentialForkedSDPMediation Feature
The LegSDPMediation feature replaces the older SequentialForkedSDPMediation feature. All default configuration has been updated accordingly. However, if you have custom configuration relating to the old feature, it will need to be updated manually.
There are two things to check:
-
Feature execution scripts.
-
SequentialForkedSDPMediation feature configuration.
Feature Execution Scripts
Feature execution scripts are found on the [PLATFORM_OPERATOR_NAME]_FeatureExecutionScriptTable profile table.
The actual value of PLATFORM_OPERATOR_NAME depends on your deployment, but is often set to Metaswitch.
Execution scripts should be checked, and any instance of run SequentialForkedSDPMediation should be replaced with run LegSDPMediation.
Feature Configuration
SequentialForkedSDPMediation feature configuration is found on the SequentialForkedSDPMediationConfigProfileTable profile table.
There is only a single attribute on this table: Mediate183ToUpdate.
The LegSDPMediation feature is configured on the LegSDPMediationConfigProfileTable.
This table has different attributes, but can be configured to match the behaviour of the old feature according to the following mapping:
| Mediate183ToUpdate Value | Action on LegSDPMediationConfigProfileTable |
|---|---|
ALLOWS_UPDATE |
This is the default, so no action is needed. |
ON |
Set |
OFF |
Set |
Session state inputs and outputs
Inputs
| Name | Type | Format | Description | Behaviour if null/invalid |
|---|---|---|---|---|
SentinelSelectionKey |
SentinelSelectionKey |
Selection key, e.g. |
For selecting configuration data |
Feature aborted |
ForceMediationLegs |
List<String> |
Each entry is a SIP leg name. |
List of legs that mediation should be forced on. Cleared on each run of the feature. |
Nothing |
Feature responses
| Response | Reason |
|---|---|
featureCannotStart |
No feature configuration could be loaded |
featureHasFinished |
Feature has finished |
Feature configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
AllowForcedMediation |
boolean |
false |
If true, allows other features to force SDP mediation for upstream legs based on the current linked leg’s committed SDP. |
MediateInviteResponses |
boolean |
true |
If true, incoming SDP bearing provisional INVITE responses will be mediated to an UPDATE in order to remove the need to fork the upstream leg. |
RequireUpdateSupport |
boolean |
true |
If true, the feature will only mediate SDP negotiations if the calling UE indicates support for UPDATE requests. |
Statistics
| Name | Description |
|---|---|
UpdateSupported |
Incremented when the UE indicates that it supports UPDATE requests. |
UpdateNotSupported |
Incremented when the UE indicates no support for UPDATE requests. |
RewroteSDPOrigin |
Incremented when the feature rewrites the SDP origin session and version. |
GeneratedSDPUpdateToCallingParty |
Incremented when the feature generates an UPDATE to the calling party. |
GeneratedSDPUpdateToCalledParty |
Incremented when the feature generates an UPDATE to the called party. |
RetryTimerStarted |
Incremented when the feature starts a 491 retry timer. |
RetryTimerFired |
Incremented when the feature’s 491 retry timer expires. |
RetryTimerCancelled |
Incremented when the feature’s 491 retry timer is cancelled before it expires. |
Behaviour
Basic Mediation
Initially, the feature monitors messages that are sent and received on the upstream leg of the call. If it sees an SDP bearing reliable provisional response being sent upstream, it prepares itself to mediate further SDP negotiations. If a subsequent SDP bearing 18x or 2xx response is seen, mediation behaviour is triggered.
When it decides to mediate, the feature will first suppress forwarding of the 18x or 2xx response upstream. In place of the response, it will generate an UPDATE request on the upstream leg. The UPDATE will contain the SDP from the original response, but the origin session and version updated to be consistent with the previous SDP sent on the upstream leg.
If a 2xx response to the UPDATE is received from upstream:
-
If the original INVITE response was a 2xx, it will be forward upstream without the SDP body.
-
If the original INVITE response was a reliable 18x, the feature will generate a PRACK request on the downstream leg.
If a 491 response to the UPDATE is received from upstream, the feature will attempt to retry the UPDATE after a short delay. Only one retry will be attempted and if it is also rejected, the call will be terminated.
Any other error response for the UPDATE will end the call.
SDP Changes in UPDATE Responses
As the UPDATE sent upstream is considered a new SDP offer, the response may contain new modifications to the SDP that need to be sent downstream. This is particularly likely if the SDP negotiations include preconditions.
If this is the case, after handling any required PRACK exchange, the feature will generate a new UPDATE request on the downstream leg containing the updated SDP from upstream.
As with the original UPDATE, the feature will retry the UPDATE once if it receives a 491 response, and end the call if it receives any other error response.
The SDP in the UPDATE response from downstream may also be modified. The feature will continue alternating between new upstream and downstream UPDATE requests until both sides of the call are in agreement on the SDP.
Mid-Session SDP Changes
If the session is modified mid-call with a new SDP in an UPDATE or re-INVITE request, the feature will ensure the origin session and version are updated to be consistent with previous SDP.
When using Sentinel VoLTE, origin session and version information will also be handled appropriately during SRVCC handover.
Forking
There are two types of forking to be aware of: parallel and sequential.
Sequential forking is where the downstream leg is replaced by Sentinel during call setup. A typical example of this would be call diversion, when the target of the call is changed. This is the main use case for this feature, so that the different SDP negotiations on each downstream leg do not require forking the upstream leg.
Parallel forking is where multiple downstream legs are being used simultaneously. An example of this could be where the called party has multiple devices that we want to alert simultaneously. In this case, multiple upstream legs are required as the feature will not attempt to mediate SDP negotiations between the parallel forks. However, each downstream parallel fork could still be sequentially replaced during call setup, in which case the feature will mediate SDP negotiations on the affected fork. This can work simultaneously and independently on each parallel fork.
Forced Mediation
Forced mediation is a service provided by this feature that may be invoked by other features when they want to force SDP to be re-negotiated on an upstream leg. Other features invoke this service by adding the name of the relevant SIP leg to the ForceMediationLegs field in session state.
When this feature sees an entry in the ForceMediationLegs field matching a current upstream leg, it will generate an UPDATE request on that leg containing the committed SDP from the linked downstream leg. From there the feature will proceed with mediation as if it had seen a reliable provisional response from the downstream leg, excluding the need to generate a PRACK after the upstream UPDATE is accepted.
Example Flow
This example shows a basic case where call diversion is invoked on a busy response from the original called party. This triggers the creation of a new downstream leg to the diverted target, and the feature mediates the SDP negotiations between the upstream leg and the new downstream leg.
It also shows a reINVITE being sent mid-call from the new called party, requiring the feature to update the SDP origin session and version.

