3.2.2.4.1.2 Find an Activity

If the client has chosen an existing CAS, the client SHOULD use an existing compatible activity if possible. Selection of a compatible activity within the scope of existing CAS is performed according to the following algorithm:

Search the CAS's Collection of Activities and choose an Activity that satisfies the following conditions:

  • The Activity's Discard flag MUST be set to FALSE.

  • If the Activity's Current CallOverlapping flag is set to TRUE, and the Activity's Current CallCausal Ordering Flag is TRUE, and the Activity has one or more call elements in the List of Active Calls, it MUST use that activity. If the server does not support the PF2_UNRELATED flag (from the Client Address SpaceSupports PF2_UNRELATED Flag element) of the selected activity, the client cannot begin the call until the Activity's Current Call has completed.

  • If the Activity's Current CallOverlapping flag is set to FALSE or the Activity's Current Call Casual Ordering Flag is FALSE, and the Activity has one or more call elements in the List of Active Calls in the state STATE_ACK_PENDING, it SHOULD use that activity.

  • If a compatible activity is not found in the Collection of Activities, the client MUST search the Collection of Inactive Activities and SHOULD use an activity from that collection if one exists.

If the client finds a compatible activity during the algorithmic search just described, a second order check is made to verify compatibility of security settings of the considered activity and the server binding handle provided for the new RPC method calls is made. The following settings are compared:

From the Activity's Security Context Handle and the server binding handle for the call:

  • Security Provider Identifier

  • Authentication Level

  • Impersonation Level

Security Provider Identifier, Authentication Level and Impersonation Level elements of the call's server binding handle security settings are as defined in [C706] section 2.7.

In addition to the above, the activity's Client Credential Handle and the server binding handle AuthIdentity (see section 3.1.1.1.2) MUST be equal. The implication of this check is that the new call and the existing activity use the same Client Credential Handle.

All elements MUST match exactly. If the security settings check fails, the algorithm continues.

If the compatible activity is found in the Collection of Activities, then increment the activity's Active Call Reference counter.

If the compatible activity is found in the Collection of Inactive Activities, then increment the activity's Active Call Reference counter and move the activity to the Collection of Activities. If the compatible activity has a prior call (from the activity's <List of Active Calls>) in either the STATE_COMPLETED or STATE_ACK_PENDING state, the activity's sequence number MUST be incremented, and the activity's delayed-ack timer MUST be canceled.

If the new call is assigned to an existing, compatible activity, set the call's Activity UUID element to the Activity UUID of the existing element.

If a compatible activity is not available, the client MUST create a new one. Its sequence number MUST be initialized to zero and the Active Call Reference counter MUST be set to one. Set the call's Activity UUID element to the Activity UUID of the new activity.