3.2.3.5.4 REQUEST

When a packet of type REQUEST is received, the server MUST execute the following steps:

  1. Set a 32-bit integer N to the sequence number in the packet header.

  2. Using the activity ID in the message header, find the activity in the Table of Activity IDs. If the activity is found in the Table of Activity IDs, then process the packet according to the following rules:

    • If N is less than the activity ID element's lowest-allowed-sequence number, the server MUST discard the packet.<92>

    • If N is greater than or equal to the activity ID element's lowest-allowed-sequence and N is less than the activity ID element's lowest-unused-sequence, the server MUST search for an existing call object with Sequence Number equal to N in the Table of Active Calls per Activity. If no call was found, the server MUST discard the message.

    • If N is greater than or equal to the activity ID element's lowest-unused-sequence, the server MUST create a new call object with Sequence Number equal to N and add it to the Table of Active Calls per Activity for the activity. The server MUST set the activity ID element's lowest-unused-sequence to N+1. If the packet's PF2_UNRELATED flag is false, the server MUST discard all call objects with lesser sequence from the Table of Active Calls per Activity for the activity and set the activity ID element's lowest-allowed-sequence to N. The server MUST set the new call's Call State to STATE_INIT.

  3. If the activity ID is not found in the Table of Activity IDs, create a new entry in the Table of Activity IDs and perform the following actions on the new entry:

    • Set the lowest-allowed-sequence counter to N.

    • Set the lowest-unused-sequence counter to N.

    • Initialize the CAS UUID to NULL.

    • Set the Last Use Timestamp to the current machine time.

    • Create a new call object with Sequence Number equal to N and add it to the Table of Active Calls per Activity for the activity. The server MUST set the activity ID element's lowest-unused-sequence to N+1. If the packet's PF2_UNRELATED flag is set, the server MUST set the activity ID element's lowest-allowed-sequence to N. The server MUST set the new Call State to STATE_INIT.

  4. If the message was not discarded, the server MUST process the message according to the current state of the call object kept in Call State, as described in sections 3.2.3.5.4.1 through 3.2.3.5.4.4.