Class SIPMessageBuffer
Represents an incoming message before having determined whether it is a request or a response.
Inheritance
System.Object
SIPMessageBuffer
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()
Assembly: SIPSorcery.dll
Syntax
public class SIPMessageBuffer
Constructors
|
Improve this Doc
View Source
SIPMessageBuffer(Encoding, Encoding)
Declaration
public SIPMessageBuffer(Encoding sipEncoding, Encoding sipBodyEncoding)
Parameters
Type |
Name |
Description |
System.Text.Encoding |
sipEncoding |
|
System.Text.Encoding |
sipBodyEncoding |
|
Fields
|
Improve this Doc
View Source
Body
Declaration
Field Value
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
Created
Declaration
Field Value
Type |
Description |
System.DateTime |
|
|
Improve this Doc
View Source
FirstLine
Declaration
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
LocalSIPEndPoint
Declaration
public SIPEndPoint LocalSIPEndPoint
Field Value
|
Improve this Doc
View Source
RawBuffer
Declaration
Field Value
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
RemoteSIPEndPoint
Declaration
public SIPEndPoint RemoteSIPEndPoint
Field Value
|
Improve this Doc
View Source
SIPBodyEncoding
Declaration
public readonly Encoding SIPBodyEncoding
Field Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
SIPEncoding
Declaration
public readonly Encoding SIPEncoding
Field Value
Type |
Description |
System.Text.Encoding |
|
|
Improve this Doc
View Source
Declaration
public string[] SIPHeaders
Field Value
Type |
Description |
System.String[] |
|
|
Improve this Doc
View Source
SIPMessageType
Declaration
public SIPMessageTypesEnum SIPMessageType
Field Value
Properties
|
Improve this Doc
View Source
RawMessage
Declaration
public string RawMessage { get; }
Property Value
Type |
Description |
System.String |
|
Methods
|
Improve this Doc
View Source
GetContentLength(Byte[], Int32, Int32)
Declaration
public static int GetContentLength(byte[] buffer, int start, int end)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
|
System.Int32 |
start |
|
System.Int32 |
end |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetContentLength(Byte[], Int32, Int32, Encoding)
Attempts to find the Content-Length header is a SIP header and extract it.
Declaration
public static int GetContentLength(byte[] buffer, int start, int end, Encoding sipEncoding)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
The buffer to search in.
|
System.Int32 |
start |
The position in the buffer to start the search from.
|
System.Int32 |
end |
The position in the buffer to stop the search at.
|
System.Text.Encoding |
sipEncoding |
|
Returns
Type |
Description |
System.Int32 |
If the Content-Length header is found the value if contains otherwise 0.
|
|
Improve this Doc
View Source
IsPing(Byte[])
Declaration
public static bool IsPing(byte[] buffer)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ParseSIPMessage(Byte[], SIPEndPoint, SIPEndPoint)
Declaration
public static SIPMessageBuffer ParseSIPMessage(byte[] buffer, SIPEndPoint localSIPEndPoint, SIPEndPoint remoteSIPEndPoint)
Parameters
Returns
|
Improve this Doc
View Source
ParseSIPMessage(Byte[], Encoding, Encoding, SIPEndPoint, SIPEndPoint)
Attempts to parse a SIP message from a single buffer that can only contain a single message.
Declaration
public static SIPMessageBuffer ParseSIPMessage(byte[] buffer, Encoding sipEncoding, Encoding sipBodyEncoding, SIPEndPoint localSIPEndPoint, SIPEndPoint remoteSIPEndPoint)
Parameters
Type |
Name |
Description |
System.Byte[] |
buffer |
The buffer that will be parsed for a SIP message.
|
System.Text.Encoding |
sipEncoding |
SIP protocol encoding, according to RFC should be UTF-8
|
System.Text.Encoding |
sipBodyEncoding |
SIP payload encoding
|
SIPEndPoint |
localSIPEndPoint |
The end point the message was received on.
|
SIPEndPoint |
remoteSIPEndPoint |
The end point the message was received from.
|
Returns
|
Improve this Doc
View Source
ParseSIPMessage(String, SIPEndPoint, SIPEndPoint)
Declaration
public static SIPMessageBuffer ParseSIPMessage(string message, SIPEndPoint localSIPEndPoint, SIPEndPoint remoteSIPEndPoint)
Parameters
Returns
|
Improve this Doc
View Source
ParseSIPMessage(String, Encoding, Encoding, SIPEndPoint, SIPEndPoint)
Attempts to parse a SIP message from a string containing a single SIP request or response.
Declaration
public static SIPMessageBuffer ParseSIPMessage(string message, Encoding sipEncoding, Encoding sipBodyEncoding, SIPEndPoint localSIPEndPoint, SIPEndPoint remoteSIPEndPoint)
Parameters
Type |
Name |
Description |
System.String |
message |
The string to parse.
|
System.Text.Encoding |
sipEncoding |
|
System.Text.Encoding |
sipBodyEncoding |
|
SIPEndPoint |
localSIPEndPoint |
The end point the message was received on.
|
SIPEndPoint |
remoteSIPEndPoint |
The end point the message was received from.
|
Returns
|
Improve this Doc
View Source
ParseSIPMessageFromStream(Byte[], Int32, Int32, out Int32)
Declaration
public static byte[] ParseSIPMessageFromStream(byte[] receiveBuffer, int start, int length, out int bytesSkipped)
Parameters
Type |
Name |
Description |
System.Byte[] |
receiveBuffer |
|
System.Int32 |
start |
|
System.Int32 |
length |
|
System.Int32 |
bytesSkipped |
|
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
ParseSIPMessageFromStream(Byte[], Int32, Int32, Encoding, out Int32)
Processes a buffer from a TCP read operation to extract the first full SIP message. If no full SIP
messages are available it returns null which indicates the next read should be appended to the current
buffer and the process re-attempted.
Declaration
public static byte[] ParseSIPMessageFromStream(byte[] receiveBuffer, int start, int length, Encoding sipEncoding, out int bytesSkipped)
Parameters
Type |
Name |
Description |
System.Byte[] |
receiveBuffer |
The buffer to check for the SIP message in.
|
System.Int32 |
start |
The position in the buffer to start parsing for a SIP message.
|
System.Int32 |
length |
The position in the buffer that indicates the end of the received bytes.
|
System.Text.Encoding |
sipEncoding |
|
System.Int32 |
bytesSkipped |
|
Returns
Type |
Description |
System.Byte[] |
A byte array holding a full SIP message or if no full SIP messages are available null.
|
Extension Methods