Show / Hide Table of Contents

Class SIPRequest

Represents a SIP Request.

Inheritance
System.Object
SIPMessageBase
SIPRequest
Inherited Members
SIPMessageBase.logger
SIPMessageBase.m_CRLF
SIPMessageBase.m_sipFullVersion
SIPMessageBase.m_allowedSIPMethods
SIPMessageBase._body
SIPMessageBase.SIPEncoding
SIPMessageBase.SIPBodyEncoding
SIPMessageBase.Header
SIPMessageBase.Body
SIPMessageBase.BodyBuffer
SIPMessageBase.Created
SIPMessageBase.RemoteSIPEndPoint
SIPMessageBase.LocalSIPEndPoint
SIPMessageBase.SendFromHintChannelID
SIPMessageBase.SendFromHintConnectionID
SIPMessageBase.GetBytes(String)
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)
Namespace: SIPSorcery.SIP
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
Type Name Description
SIPMethodsEnum method
SIPURI uri
| 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
Type Name Description
SIPMethodsEnum method
System.String uri

Fields

| Improve this Doc View Source

Method

Declaration
public SIPMethodsEnum Method
Field Value
Type Description
SIPMethodsEnum
| Improve this Doc View Source

ReceivedRoute

Declaration
public SIPRoute ReceivedRoute
Field Value
Type Description
SIPRoute
| Improve this Doc View Source

SIPVersion

Declaration
public string SIPVersion
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

The SIP request's URI.

Declaration
public SIPURI URI
Field Value
Type Description
SIPURI

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
public SIPRequest Copy()
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
public byte[] GetBytes()
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
Type Description
SIPRequest

A SIP request object.

| Improve this Doc View Source

GetRequest(SIPMethodsEnum, SIPURI, SIPToHeader, SIPFromHeader)

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
Type Description
SIPRequest

A SIP request object.

| 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
Type Name Description
SIPValidationFieldsEnum errorField
System.String errorMessage
Returns
Type Description
System.Boolean
| Improve this Doc View Source

ParseSIPRequest(SIPMessageBuffer)

Declaration
public static SIPRequest ParseSIPRequest(SIPMessageBuffer sipMessage)
Parameters
Type Name Description
SIPMessageBuffer sipMessage
Returns
Type Description
SIPRequest
| 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
Type Description
SIPRequest
| Improve this Doc View Source

ParseSIPRequest(String)

Declaration
public static SIPRequest ParseSIPRequest(string sipMessageStr)
Parameters
Type Name Description
System.String sipMessageStr
Returns
Type Description
SIPRequest
| 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
Type Description
SIPRequest
| 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

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