Class MsrpMessage
Class for MSRP messages. See RFC 4975.
Inherited Members
Namespace: SipLib.Msrp
Assembly: SipLib.dll
Syntax
public class MsrpMessage
Constructors
| Edit this page View SourceMsrpMessage()
Constructor
Declaration
public MsrpMessage()
Fields
| Edit this page View SourceBody
Contains the binary byte array containing the message contents. Null indicates that there are no contents for the message.
Declaration
public byte[]? Body
Field Value
Type | Description |
---|---|
byte[] |
TransactionID
Transaction ID for the message;
Declaration
public string TransactionID
Field Value
Type | Description |
---|---|
string |
Properties
| Edit this page View SourceByteRange
Byte-Range header. Initialized to a new ByteRangeHeader object.
Declaration
public ByteRangeHeader ByteRange { get; set; }
Property Value
Type | Description |
---|---|
ByteRangeHeader |
CompletionStatus
Gets or sets the completion status for this MSRP message
Declaration
public MsrpCompletionStatus CompletionStatus { get; set; }
Property Value
Type | Description |
---|---|
MsrpCompletionStatus |
ContentType
Content-Type header value. A value of null indicates that there was no Content-Type header in the message.
Declaration
public string? ContentType { get; set; }
Property Value
Type | Description |
---|---|
string |
FailureReport
Failure-Report header value. A value of null indicates that Failure-Report header was not provided.
Declaration
public string? FailureReport { get; set; }
Property Value
Type | Description |
---|---|
string |
FromPath
From-Path header. Initialized to a new MsrpPathHeadr object.
Declaration
public MsrpPathHeader? FromPath { get; set; }
Property Value
Type | Description |
---|---|
MsrpPathHeader |
MessageID
Message-ID header value.
Declaration
public string? MessageID { get; set; }
Property Value
Type | Description |
---|---|
string |
MessageType
Specifies the type of MSRP message
Declaration
public MsrpMessageType MessageType { get; set; }
Property Value
Type | Description |
---|---|
MsrpMessageType |
RequestLine
Request line for the message. This will be null if the MessageType is not MessageType.Request
Declaration
public string? RequestLine { get; set; }
Property Value
Type | Description |
---|---|
string |
RequestMethod
Contains the request methode type (SEND or REPORT) if MessageType == MsrpMessageType.Request. Set to null otherwise.
Declaration
public string? RequestMethod { get; set; }
Property Value
Type | Description |
---|---|
string |
ResponseCode
Response code for the message. Valid if the MessageType is MessageType.Response
Declaration
public int ResponseCode { get; set; }
Property Value
Type | Description |
---|---|
int |
ResponseText
Text or comment describing the ResponseCode. Optional.
Declaration
public string? ResponseText { get; set; }
Property Value
Type | Description |
---|---|
string |
Status
Status header. A null value indicates that a Status header is not present
Declaration
public MsrpStatusHeader? Status { get; set; }
Property Value
Type | Description |
---|---|
MsrpStatusHeader |
SuccessReport
Success-Report header value. A value of null indicates that a Success-Report header was not provided.
Declaration
public string? SuccessReport { get; set; }
Property Value
Type | Description |
---|---|
string |
ToPath
To-Path header. Initialized to a new MsrpPathHeader object.
Declaration
public MsrpPathHeader? ToPath { get; set; }
Property Value
Type | Description |
---|---|
MsrpPathHeader |
UseNickname
Use-Nickname header value. See RFC 7701. This header value contains a quoted (using double quotation marks) nickname.
Declaration
public string? UseNickname { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
| Edit this page View SourceBuildResponseMessage(int, string)
Builds a MSRP response message to this message. This message must be a MSRP request message.
Declaration
public MsrpMessage BuildResponseMessage(int ResponseCode, string ResponseText)
Parameters
Type | Name | Description |
---|---|---|
int | ResponseCode | Response code. For example: 200 |
string | ResponseText | Response text. Optional. For example: OK |
Returns
Type | Description |
---|---|
MsrpMessage | Returns a MsrpMessage containing a response that can be sent to the remote end point. |
FailureReportRequested()
Returns true if there is a Failure-Report header and its value is "yes"
Declaration
public bool FailureReportRequested()
Returns
Type | Description |
---|---|
bool |
GetContentType()
Gets the value of the Content-Type header value without any parameters
Declaration
public string? GetContentType()
Returns
Type | Description |
---|---|
string | Returns the Content-Type header value after removing any header parameters if there are any. Return null if there is no Content-Type header value. |
NewRandomID()
Creates a random string to use as a Session ID or a Transaction ID for MSRP.
Declaration
public static string NewRandomID()
Returns
Type | Description |
---|---|
string | Returns the random string. |
ParseMsrpMessage(byte[])
Parses a MSRP message that was received over a TCP/TLS network connection.
Declaration
public static MsrpMessage? ParseMsrpMessage(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | bytes | Bytes of the complete MSRP message or a MSRP message chunk. The byte array includes the end-line. |
Returns
Type | Description |
---|---|
MsrpMessage | Returns a new MsrpMessage object or null if a parsing error occurred. |
SuccessReportRequested()
Returns true if there is a Success-Report header and its value is "yes"
Declaration
public bool SuccessReportRequested()
Returns
Type | Description |
---|---|
bool |
ToByteArray()
Converts this object into a byte array so that it can be sent over the TCP/TLS stream. All of the required properties must be set before calling this method.
Declaration
public byte[] ToByteArray()
Returns
Type | Description |
---|---|
byte[] | Returns a byte array. |