Show / Hide Table of Contents

Class RTCPSession

Represents an RTCP session intended to be used in conjunction with an RTP session. This class needs to get notified of all RTP sends and receives and will take care of RTCP reporting.

Inheritance
System.Object
RTCPSession
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SIPSorcery.Net
Assembly: SIPSorcery.dll
Syntax
public class RTCPSession
Remarks

RTCP Design Decisions:

  • Minimum Report Period set to 5s as per RFC3550: 6.2 RTCP Transmission Interval (page 24).
  • Delay for initial report transmission set to 2.5s (0.5 * minimum report period) as per RFC3550: 6.2 RTCP Transmission Interval (page 26).
  • Randomisation factor to apply to report intervals to attempt to ensure RTCP reports amongst participants don't become synchronised [0.5 * interval, 1.5 * interval] as per RFC3550: 6.2 RTCP Transmission Interval (page 26).
  • Timeout period during which if no RTP or RTCP packets received a participant is assumed to have dropped 5 x minimum report period as per RFC3550: 6.2.1 (page 27) and 6.3.5 (page 31).
  • All RTCP composite reports must satisfy (this includes when a BYE is sent):
  • First RTCP packet must be a SR or RR,
  • Must contain an SDES packet.

Constructors

| Improve this Doc View Source

RTCPSession(SDPMediaTypesEnum, UInt32)

Default constructor.

Declaration
public RTCPSession(SDPMediaTypesEnum mediaType, uint ssrc)
Parameters
Type Name Description
SDPMediaTypesEnum mediaType

The media type this reporting session will be measuring.

System.UInt32 ssrc

The SSRC of the RTP stream being sent.

Fields

| Improve this Doc View Source

NO_ACTIVITY_TIMEOUT_REASON

Declaration
public const string NO_ACTIVITY_TIMEOUT_REASON = "No activity timeout."
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

Cname

Unique common name field for use in SDES packets.

Declaration
public string Cname { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

CreatedAt

Timestamp that the RTCP session was created at.

Declaration
public DateTime CreatedAt { get; }
Property Value
Type Description
System.DateTime
| Improve this Doc View Source

IsClosed

Indicates whether the RTCP session has been closed. An RTCP BYE request will typically trigger an close.

Declaration
public bool IsClosed { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsTimedOut

Indicates whether the session is currently in a timed out state. This occurs if no RTP or RTCP packets have been received during an expected interval.

Declaration
public bool IsTimedOut { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

LastActivityAt

Timestamp that the last RTP or RTCP packet for was received at.

Declaration
public DateTime LastActivityAt { get; }
Property Value
Type Description
System.DateTime
| Improve this Doc View Source

LastNtpTimestampSent

The last NTP timestamp corresponding to the last RTP timestamp sent by us.

Declaration
public ulong LastNtpTimestampSent { get; }
Property Value
Type Description
System.UInt64
| Improve this Doc View Source

LastRtpTimestampSent

The last RTP timestamp sent by us.

Declaration
public uint LastRtpTimestampSent { get; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

LastSeqNum

The last RTP sequence number sent by us.

Declaration
public ushort LastSeqNum { get; }
Property Value
Type Description
System.UInt16
| Improve this Doc View Source

MediaType

The media type this report session is measuring.

Declaration
public SDPMediaTypesEnum MediaType { get; }
Property Value
Type Description
SDPMediaTypesEnum
| Improve this Doc View Source

OctetsReceivedCount

Number of RTP bytes received from the remote party.

Declaration
public uint OctetsReceivedCount { get; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

OctetsSentCount

Number of RTP bytes sent to the remote party.

Declaration
public uint OctetsSentCount { get; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

PacketsReceivedCount

Number of RTP packets received from the remote party.

Declaration
public uint PacketsReceivedCount { get; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

PacketsSentCount

Number of RTP packets sent to the remote party.

Declaration
public uint PacketsSentCount { get; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

PayloadSampleRateHz

Indicates the sample rate for RTP media data.

Declaration
public int PayloadSampleRateHz { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

ReceptionReport

The reception report to keep track of the RTP statistics from packets received from the remote call party.

Declaration
public ReceptionReport ReceptionReport { get; }
Property Value
Type Description
ReceptionReport
| Improve this Doc View Source

Ssrc

The SSRC number of the RTP packets we are sending.

Declaration
public uint Ssrc { get; set; }
Property Value
Type Description
System.UInt32
| Improve this Doc View Source

StartedAt

Timestamp that the RTCP session sender report scheduler was started at.

Declaration
public DateTime StartedAt { get; }
Property Value
Type Description
System.DateTime

Methods

| Improve this Doc View Source

Close(String)

Declaration
public void Close(string reason)
Parameters
Type Name Description
System.String reason
| Improve this Doc View Source

DateTimeToNtpTimestamp(DateTime)

Converts specified DateTime value to long NTP time.

Declaration
public static ulong DateTimeToNtpTimestamp(DateTime value)
Parameters
Type Name Description
System.DateTime value

DateTime value to convert. This value must be in local time.

Returns
Type Description
System.UInt64

Returns NTP value.

| Improve this Doc View Source

DateTimeToNtpTimestamp32(DateTime)

Declaration
public static uint DateTimeToNtpTimestamp32(DateTime value)
Parameters
Type Name Description
System.DateTime value
Returns
Type Description
System.UInt32
| Improve this Doc View Source

GetRtcpReport()

Gets the RTCP compound packet containing the RTCP reports we send.

Declaration
public RTCPCompoundPacket GetRtcpReport()
Returns
Type Description
RTCPCompoundPacket

An RTCP compound packet.

| Improve this Doc View Source

RecordRtpPacketReceived(RTPPacket)

Event handler for an RTP packet being received by the RTP session. Used for measuring transmission statistics.

Declaration
public void RecordRtpPacketReceived(RTPPacket rtpPacket)
Parameters
Type Name Description
RTPPacket rtpPacket
| Improve this Doc View Source

RecordRtpPacketSend(RTPPacket)

Event handler for an RTP packet being sent by the RTP session. Used for measuring transmission statistics.

Declaration
public void RecordRtpPacketSend(RTPPacket rtpPacket)
Parameters
Type Name Description
RTPPacket rtpPacket
| Improve this Doc View Source

RemoveReceptionReport(UInt32)

Removes the reception report when the remote party indicates no more RTP packets for that SSRC will be received by sending an RTCP BYE.

Declaration
public void RemoveReceptionReport(uint ssrc)
Parameters
Type Name Description
System.UInt32 ssrc

The SSRC of the reception report being closed. Typically this should be the SSRC received in the RTCP BYE.

| Improve this Doc View Source

ReportReceived(IPEndPoint, RTCPCompoundPacket)

Event handler for an RTCP packet being received from the remote party.

Declaration
public void ReportReceived(IPEndPoint remoteEndPoint, RTCPCompoundPacket rtcpCompoundPacket)
Parameters
Type Name Description
System.Net.IPEndPoint remoteEndPoint

The end point the packet was received from.

RTCPCompoundPacket rtcpCompoundPacket

The data received.

| Improve this Doc View Source

Start()

Declaration
public void Start()
| Improve this Doc View Source

To32Bit(UInt64)

Declaration
public static uint To32Bit(ulong ntpTime)
Parameters
Type Name Description
System.UInt64 ntpTime
Returns
Type Description
System.UInt32

Events

| Improve this Doc View Source

OnReportReadyToSend

Event handler for sending RTCP reports.

Declaration
public event Action<SDPMediaTypesEnum, RTCPCompoundPacket> OnReportReadyToSend
Event Type
Type Description
System.Action<SDPMediaTypesEnum, RTCPCompoundPacket>
| Improve this Doc View Source

OnTimeout

Fires when the connection is classified as timed out due to not receiving any RTP or RTCP packets within the given period.

Declaration
public event Action<SDPMediaTypesEnum> OnTimeout
Event Type
Type Description
System.Action<SDPMediaTypesEnum>

Extension Methods

JSONWriter.ToJson(Object)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX