# RTCP report events

RTP (real time protocol) is an internet protocol for transmitting real-time data, such as audio and video data, over packet networks. MSPP service RTP IPv4 and IPv6 endpoints support this protocol to provide an entry or exit point for duplex voice-over-IP data in Fusion gateways.

The real time control protocol (RTCP) provides a way to send and receive reports about the information transferred across packet networks in RTP packets. RTCP reports can be sent and received in RTP packets during voice-over-IP transmissions. RTP IPv4 and IPv6 endpoints receive these reports and can (if the application enables this feature) convey the information to the application in the form of unsolicited events.

This topic describes:

- RTCP messages

- Configuring RTP endpoints to return RTCP report information

- Processing RTCP information

## RTCP messages

An RTCP message consists of a number of stackable packets, each with its own type code and length indication. The packet format is similar to data packets; in particular, the type indication is at the same location. RTCP packets are sent periodically by the remote gateway, and can serve as a status indicator for session members, even when those members are not actively transmitting media data.

RTCP packets contain the necessary information for quality-of-service monitoring. Applications that have recently sent data generate a sender report. This information allows receivers to estimate the actual data rate.

Session members also periodically issue receiver reports if they have recently received data from remote endpoints. These reports contain the following information:

- The highest packet sequence number received

- The number of packets lost

- A measure of the inter-arrival jitter

- Timestamps needed to compute an estimate of the round-trip delay between the sender and the receiver issuing the report

RTP data packets identify their origin through a randomly generated 32-bit identifier. For conferencing applications, RTCP messages contain an SDES (source description) packet that contains several types of information, usually in text form. One such piece of information is the canonical name, a globally unique identifier of the session participant. Other possible SDES items include the user's name, email address, telephone number, application information, and alert messages.

## Configuring RTP IPv4 and IPv6 endpoints to return RTCP report information

Fusion applications can receive RTCP report information through RTP IPv4 and IPv6 endpoints. By default however, RTP endpoints do not send this information to the remote endpoint. Applications can configure RTP endpoints to return RTCP information by enabling this feature while creating the endpoint, or by commanding the endpoint to return unsolicited events after it is created.

After creating an RTP endpoint, the application can command the RTP endpoints to return RTCP unsolicited events by using mspSendCommand with the filter command MSP_CMD_RTPIN_RTCP_EVENTS. Once commanded to do so, the RTP endpoint periodically sends RTCP report information in the form of unsolicited MSPP events. For more information about creating and commanding RTP endpoints, refer to the MSPP Service Developer's Reference manual.

To configure an existing RTP endpoint to return RTCP report information:

Step | Action
1 | Create the RTP IPv4 or IPv6 endpoint with mspCreateEndpoint.
2 | Disable the endpoint with mspDisableEndpoint. RTP endpoints receive commands only when in a disabled state.
3 | Use mspSendCommand to send a MSP_CMD_RTPxxx_CONFIG filter command to the endpoint. This filter command requires that you specify an ENDPOINT_RTPxxx_CONFIG structure. In this structure, set startRtcp to a non-zero value. The RTP endpoint begins sending periodic unsolicited events when as it receives RTCP reports from the remote endpoint.
4 | Use the Natural Access function ctaWaitEvent to wait for the periodic RTCP unsolicited events.
5 | Invoke mspReleaseBuffer after the application receives each unsolicited event. RTCP session information is delivered to the application in a raw form. Fusion provides a set of macros for accessing information stored in bit form within the structure. For more information, refer to the mspunsol.h header file.

For more information about sending commands to MSPP endpoints, refer to the Dialogic® NaturalAccess™ Media Stream Protocol Processing API Developer's Manual.

## Processing RTCP information

The unsolicited RTCP events returned by the MSPP service contain buffered RTCP reports received from a remote endpoint. RTP IPv4 and IPv6 endpoints receive the RTCP reports in compound packets that follow a variable format. This format is described in RFC 1889 and subsequent internet drafts. The MSPP service includes this information, in buffered form, in the unsolicited events.

Each buffer within an unsolicited event begins with either a Sender Report or Receiver Report packet (depending on the source), followed by a Source Description packet, and (optionally) a BYE packet. All packet information in the buffer follows a common format. Each packet segment begins with a header in which one field specifies the packet type and another field that specifies its length. The application receiving the buffer can therefore sequentially read information about each packet, starting with the first packet and ending with the last.

For information about RTCP report format and content, refer to RFC 1889. For more information about the specific format of the buffers returned by MSPP unsolicited events, refer to the mspunsol.h header file.