SIP Recursion Policy
Session Agents (and Session agent groups) can utilize a SIP Recursion policy to customize the Oracle Communications Session Border Controller (OCSBC) behavior when recursing through a list of target SIP peers. These policies are useful for networks with large numbers of SIP peers that wish to customize recursive routing behavior for individual session agents or session agent groups, based on number of recursion attempts or the returned SIP response code.
SIP recursion policy provides the OCSBC with rules to indicate when to resend messages to the next SIP peer based on the previous response before terminating recursion and forwarding the final peer's response back to the initial requester.
The system terminates recursing among session agents (or session agent groups) when one of two criteria is first met. The first criteria is reaching a maximum number of recursions among all targets to a given SIP request for all configured response codes. The second criteria is receiving a maximum number of a configured response code from all targets as recursed for a given SIP request.
To set a maximum number of recursions before forwarding the final response back to the ingress-side requester, you set the sip-recursion-policy, global-count parameter and the desired response-codes. Once the OCSBC exceeds retrying to send a message to valid targets this number of times, it stops recursing and forwards the final response back to the requester. To disable maximum recursion hops per-call, set the sip-recursion-policy, global-count to 0.

SIP recursion policy can also terminate recursion based on receiving one or more of the individually configured 3xx, 4xx, or 5xx response messages received from all targets in response to the request. The OCSBC can consider the number of responses per response code that were received before terminating recursion.
sip-response-code response-code 488 attempts 2
Consecutive mode sets the OCSBC to stop recursing after the total configured number of responses (sip-response-code, attempts) for a configured sip-response-code subelement has been received consecutively. When the number of attempts per response code is received, recursion stops and the final response is forwarded to the requestor. Considering the previous example's configuration set to consecutive mode, the OCSBC will need to receive two 488 responses in a row before recursion terminates and the last 488 is forwarded back to the requester.
Final Configuration
In order to use a sip-recursion-policy, it must be configured within a session agent or session agent group. Populate a session-agent-group, sip-recursion-policy or session-agent, sip-recursion-policy parameter with the name of the SIP recursion policy you wish to apply.
Feature Interactions
The existing SIP Configurable Route Recursion feature takes higher precedence than this feature. If the stop-recurse parameter is configured in the SIP interface, session agent, or SAG, the OCSBC checks each response against that list, before any SIP recursion policy.
SIP Recursion Policy Configuration
If configuring the Oracle Communications Session Border Controller to terminate recursion on received response, continue this procedure to create one or more sip-response-code subelement.
Configure the appropriate session-agent, sip-recursion-policy or session-agent-group, sip-recursion-policy parameter with the name of the SIP Recursion policy you just created.