# Receiving SIP messages

There are two ways for the SIP server to deliver the extra information associated with an incoming SIP request or response message:

- Include the information in the buffer attached to the NCC event associated with the incoming message. This method is recommended.

- Include the information in the buffer attached to NCCEVN_PROTOCOL_EVENT. This method is backwards compatible with version 1.0 of SIP for NCC API.

## Including information in the buffer attached to an associated NCC event

With this delivery method, if a change in call state occurs as a result of the incoming SIP message, the SIP server delivers the extra information in the buffer attached to the associated NCC event. The NCC event uses the following information elements:

- SIP_IE_BODY

- SIP_IE_CALL_ID

- SIP_IE_CONTENT_LENGTH

- SIP_IE_CONTENT_TYPE

- SIP_IE_CSEQ

- SIP_IE_METHOD

- SIP_IE_OTHER_HEADER

- SIP_IE_RESPONSE_CODE

If no change in call state occurs as a result of the incoming SIP message, the SIP server delivers the extra information in the buffer attached to an NCCEVN_PROTOCOL_EVENT. This event uses the information elements listed above.

For example, an incoming BYE message is returned to the application in the buffer of the NCCEVN_CALL_DISCONNECTED event, because the BYE message changes the call state. Because the re-INVITE message does not change the call state, an incoming SIP re-INVITE message is returned to the application in the buffer of NCCEVN_PROTOCOL_EVENT.

To configure the SIP server to use this method of delivering information, set the general.sendProtocolEvent keyword to False (the default), and the general.sendDataInEvents keyword to the desired bit mask. For more information, see Configuration parameters.

The following illustration shows how the application receives SIP messages containing extra information:

## Including information in the buffer attached to NCCEVN_PROTOCOL_EVENT

With this delivery method, the SIP server generates NCCEVN_PROTOCOL_EVENT every time it receives extra information in an incoming SIP message. The server puts the extra information in the buffer of NCCEVN_PROTOCOL_EVENT.

If the incoming SIP message triggers a call state change, the server generates two events: one for the call state change (such as NCCEVN_INCOMING_CALL), and one NCCEVEN_PROTOCOL_EVENT.

NCCEVN_PROTOCOL_EVENT contains the following information elements:

- SIP_IE_CONTENT_TYPE

- SIP_IE_CONTENT_LENGTH

- SIP_IE_BODY

- SIP_IE_METHOD

To configure the server to generate NCCEVN_PROTOCOL_EVENTs for incoming messages that contain extra information, set general.sendProtocolEvents to True and general.sendDataInEvents to 0 (the default). For more information, see Configuration parameters.