Replaces Header Support
The Oracle Communications Session Border Controller (SBC) supports the Replaces: header in SIP messages according to RFC 3891. The header, included within SIP INVITE messages, provides a mechanism to replace an existing early or established dialog with a different dialog. The different dialog can be used for services such as call parking, attended call transfer and various conferencing features.
The Replaces: header specifies the dialog to replace by containing the corresponding dialog identifier. The identifier includes the from tag, to tag, and call id. The orientation of endpoint-created tags, as from-tag and to-tag, matches each of the two dialogs for a standard call. For example, the Replaces: header from an endpoint that specifies assuming the dialog between the SBC and Bob-1 appears as follows:
Replaces:5555;from-tag=20;to-tag=10
The SBC validates the dialog identifier by matching an existing dialog, tries to install the new endpoint, and tries to remove the old endpoint by gracefully ending that dialog with a BYE. The replaces INVITE must come from an endpoint in the same realm as the endpoint it is replacing. If the UA sending the Replaces header is in a different realm as the original call leg (or indicates such architecture from a malformed Replaces: header), the SBC replies to the Replaces: endpoint with a 481 Missing Dialog. Refer to the following diagram for the standard scenario.
![The OCSBC supporting the REPLACES header The OCSBC supporting the REPLACES header](img/replaces-header.png)
Note that when the endpoints are in the same realm, you must enable the mm-in-realm parameter in realm-config or the SBC cannot generate the SDP for the 200 OK. Without the SDP, the call is unsuccessful.
New SDP Parameters in INVITE with Replaces
When an INVITE with Replaces: header is received, the media parameters in the new SDP are compared against the SDP of the dialog to be replaced. If any portion of the SDPs (excluding the session-origin line) is different, then the media must be renegotiated. The Oracle Communications Session Border Controller sends a re-INVITE with the new SDP to the dialog opposite of the one being replaced as shown below. If the re-INVITE fails for any reason, then the original dialogs will remain.
![The OCSBC supporting SDP renegotiation after a re-INVITE with Replaces header. The OCSBC supporting SDP renegotiation after a re-INVITE with Replaces header.](img/replaces-header-new-media.png)
It is important to note that, if the SDP matches, the SBC suppresses this re-INVITE. As inferred above, when an INVITE with a REPLACES header arrives, the SBC notes the matching dialog and then makes SDP changes, including codec manipulation, codec-policy application and, in the case of SRTP to RTP sessions, crypto removal. It is only after these changes that the SBC compares everything in the dialog's most recent SDP with the new SDP, excepting the SDP version and whitespace. If the SDP does match, the SBC suppresses the re-INVITE to the original client and proceeds with the replaced dialog.
Early Dialog Replacement
An INVITE with Replaces: header can replace an early dialog. That is, a dialog where the final 2xx class response to INVITE request has not arrived yet. The Oracle Communications Session Border Controller completes the originating side of the call with a 200 OK. The original dialog with the terminator is cancelled. SDP from the new terminator can be renegotiated if it changes.
![The OCSBC using the Replaces header to replace and early dialog. The OCSBC using the Replaces header to replace and early dialog.](img/replaces-header-early-dialog.png)
The SDP from the original 183 response is used for the 200 response back to the originator if present to complete the early transaction. If reliable provisional messages are used, then no SDP is included in the 200 response.
If no SDP is present in any of the provisional messages, then the Oracle Communications Session Border Controller constructs it from the original offer and modifying the IP port information for each c= and m= line with information from the INVITE with Replaces: header. If there are more m= lines in the original offer than ports from the INVITE with Replaces: header, then the extra ports are disabled with port value of 0. If no SDP was offered in the original INVITE, then the SDP from the INVITE with Replaces: header is used as the offer in the 200 OK.
If the SDP media parameters were compatible between the replaced and replacing SDPs, then media does not need to be renegotiated and no re-INVITE is created. If the re-INVITE fails, the original dialogs are torn down using a BYE for the original server dialog.
INVITE with Replaces in Early Dialog Server Side
The Oracle Communications Session Border Controller does not support replacing an early server dialog. It replies with a 481 (Dialog/Transaction does not exist) response to the endpoint requesting the replace.
![The OCSBC rejecting and early server dialog. The OCSBC rejecting and early server dialog.](img/replaces-header-server-dialog.png)
Replace Header Configuration
Replaces: header support is configured in the session-agent, realm, or sip-interface via the sip-profile configuration element. sip-profiles are defined once and attached to a chosen interface, realm or session-agent.
The replace-dialogs parameter is set to either enabled or disabled. In addition, you may set this parameter to inherit which uses the next lower order of precedence object. If there are no sip-profiles referenced in the higher ordered object, or if all the replace-dialogs parameters are set to inherit, then the feature is disabled.
To configure Replaces: header support:
Debugging
show sipd status
Includes Replaced Dialogs counts to show successfully replaced dialogs:
# show sipd status
17:41:38-142
SIP Status -- Period -- -------- Lifetime --------
Active High Total Total PerMax High
Replaced Dialogs - - 1 1 1
show sipd errors
Includes Replace Dialog Fails to show failed dialog replacements. This counter is incremented only when the dialog replacement attempt actually occurred but failed to successfully complete.
# show sipd errors
17:58:04-181
SIP Errors/Events ---- Lifetime ----
Recent Total PerMax
Replace Dialog Fails 0 0 0