Class SIPRequest
Represents a SIP Request.
Inheritance
System.Object
SIPRequest
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)
Assembly: SIPSorcery.dll
Syntax
public class SIPRequest : SIPMessageBase
Constructors
|
Improve this Doc
View Source
SIPRequest(SIPMethodsEnum, SIPURI)
Declaration
public SIPRequest(SIPMethodsEnum method, SIPURI uri)
Parameters
|
Improve this Doc
View Source
SIPRequest(SIPMethodsEnum, SIPURI, Encoding, Encoding)
Declaration
public SIPRequest(SIPMethodsEnum method, SIPURI uri, Encoding sipEncoding, Encoding sipBodyEncoding)
Parameters
Type |
Name |
Description |
SIPMethodsEnum |
method |
|
SIPURI |
uri |
|
System.Text.Encoding |
sipEncoding |
|
System.Text.Encoding |
sipBodyEncoding |
|
|
Improve this Doc
View Source
SIPRequest(SIPMethodsEnum, String)
Declaration
public SIPRequest(SIPMethodsEnum method, string uri)
Parameters
Fields
|
Improve this Doc
View Source
Method
Declaration
public SIPMethodsEnum Method
Field Value
|
Improve this Doc
View Source
ReceivedRoute
Declaration
public SIPRoute ReceivedRoute
Field Value
|
Improve this Doc
View Source
SIPVersion
Declaration
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
UnknownMethod
Declaration
public string UnknownMethod
Field Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
URI
Declaration
Field Value
Properties
|
Improve this Doc
View Source
StatusLine
The first line of the SIP request.
Declaration
public string StatusLine { get; }
Property Value
Type |
Description |
System.String |
|
Methods
|
Improve this Doc
View Source
Copy()
Creates an identical copy of the SIP Request for the caller.
Declaration
Returns
Type |
Description |
SIPRequest |
New copy of the SIPRequest.
|
|
Improve this Doc
View Source
CreateBranchId()
Declaration
public string CreateBranchId()
Returns
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
DuplicateAndAuthenticate(List<SIPAuthenticationHeader>, String, String)
Duplicates an existing SIP request, typically one that received an unauthorised response, to an
authenticated version. The CSeq and Via branch ID are also incremented so
that the request will not be flagged as a retransmit.
Declaration
public SIPRequest DuplicateAndAuthenticate(List<SIPAuthenticationHeader> authenticationChallenges, string username, string password)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<SIPAuthenticationHeader> |
authenticationChallenges |
The challenges to authenticate the request against. Typically
the challenges come from a SIP response.
|
System.String |
username |
The username to authenticate with.
|
System.String |
password |
The password to authenticate with.
|
Returns
Type |
Description |
SIPRequest |
A SIP request that is a duplicate of the original but with an authentication header added and
the state header values updated so as not to be flagged as a retransmit.
|
|
Improve this Doc
View Source
GetBytes()
Declaration
Returns
Type |
Description |
System.Byte[] |
|
|
Improve this Doc
View Source
GetRequest(SIPMethodsEnum, SIPURI)
Builds a very basic SIP request. In most cases additional headers will need to be added in order for it to be useful.
When this method is called the channel used for sending the request has not been decided. The headers below depend on
the sending channel. By setting them to "0.0.0.0:0" the send request methods will substitute in the appropriate value
at send time:
- Top Via header.
- From header.
- Contact header.
Declaration
public static SIPRequest GetRequest(SIPMethodsEnum method, SIPURI uri)
Parameters
Type |
Name |
Description |
SIPMethodsEnum |
method |
The method for the SIP request.
|
SIPURI |
uri |
The destination URI for the request.
|
Returns
|
Improve this Doc
View Source
Builds a very basic SIP request. In most cases additional headers will need to be added in order for it to be useful.
When this method is called the channel used for sending the request has not been decided. The headers below depend on
the sending channel. By setting them to "0.0.0.0:0" the send request methods will substitute in the appropriate value
at send time:
- Top Via header.
- From header.
- Contact header.
Declaration
public static SIPRequest GetRequest(SIPMethodsEnum method, SIPURI uri, SIPToHeader to, SIPFromHeader from)
Parameters
Type |
Name |
Description |
SIPMethodsEnum |
method |
The method for the SIP request.
|
SIPURI |
uri |
The destination URI for the request.
|
SIPToHeader |
to |
The To header for the request.
|
SIPFromHeader |
from |
The From header for the request.
|
Returns
|
Improve this Doc
View Source
IsLoop(String, Int32, String)
Determines if this SIP header is a looped header. The basis for the decision is the branchid in the Via header. If the branchid for a new
header computes to the same branchid as a Via header already in the SIP header then it is considered a loop.
Declaration
public bool IsLoop(string ipAddress, int port, string currentBranchId)
Parameters
Type |
Name |
Description |
System.String |
ipAddress |
|
System.Int32 |
port |
|
System.String |
currentBranchId |
|
Returns
Type |
Description |
System.Boolean |
True if this header is a loop otherwise false.
|
|
Improve this Doc
View Source
IsValid(out SIPValidationFieldsEnum, out String)
Declaration
public bool IsValid(out SIPValidationFieldsEnum errorField, out string errorMessage)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ParseSIPRequest(SIPMessageBuffer)
Declaration
public static SIPRequest ParseSIPRequest(SIPMessageBuffer sipMessage)
Parameters
Returns
|
Improve this Doc
View Source
ParseSIPRequest(SIPMessageBuffer, Encoding, Encoding)
Declaration
public static SIPRequest ParseSIPRequest(SIPMessageBuffer sipMessage, Encoding sipEncoding, Encoding sipBodyEncoding)
Parameters
Type |
Name |
Description |
SIPMessageBuffer |
sipMessage |
|
System.Text.Encoding |
sipEncoding |
|
System.Text.Encoding |
sipBodyEncoding |
|
Returns
|
Improve this Doc
View Source
ParseSIPRequest(String)
Declaration
public static SIPRequest ParseSIPRequest(string sipMessageStr)
Parameters
Type |
Name |
Description |
System.String |
sipMessageStr |
|
Returns
|
Improve this Doc
View Source
ParseSIPRequest(String, Encoding, Encoding)
Declaration
public static SIPRequest ParseSIPRequest(string sipMessageStr, Encoding sipEncoding, Encoding sipBodyEncoding)
Parameters
Type |
Name |
Description |
System.String |
sipMessageStr |
|
System.Text.Encoding |
sipEncoding |
|
System.Text.Encoding |
sipBodyEncoding |
|
Returns
|
Improve this Doc
View Source
SetSendFromHints(SIPEndPoint)
Sets the send from hints for this request based on a local SIP end point.
The local SIP end point should generally be the one a related request or response was
received on.
Declaration
public void SetSendFromHints(SIPEndPoint localEndPoint)
Parameters
Type |
Name |
Description |
SIPEndPoint |
localEndPoint |
The SIP end point to base the send from hints on.
|
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Extension Methods