Class SIPViaHeader
The Via header only has parameters, no headers. Parameters of from ...;name= value;name2=value2 Specific parameters: ttl, maddr, received, branch.
From page 179 of RFC3261: "Even though this specification mandates that the branch parameter be present in all requests, the BNF for the header field indicates that it is optional."
The branch parameter on a Via therefore appears to be optionally mandatory?!
Any SIP application element that uses transactions depends on the branch parameter for transaction matching. Only the top Via header branch is used for transactions though so if the request has made it to this stack with missing branches then in theory it should be safe to proceed. It will be left up to the SIPTransaction class to reject any SIP requests that are missing the necessary branch.
Inherited Members
Namespace: SipLib.Core
Assembly: SipLib.dll
Syntax
public class SIPViaHeader
Constructors
| Edit this page View SourceSIPViaHeader()
Constructor
Declaration
public SIPViaHeader()
SIPViaHeader(SIPEndPoint, string)
Constructs a SIPViaHeader object from the local SIPEndPoint and a branch parameter
Declaration
public SIPViaHeader(SIPEndPoint localEndPoint, string branch)
Parameters
Type | Name | Description |
---|---|---|
SIPEndPoint | localEndPoint | Local SIPEndPoint |
string | branch | Branch parameter |
SIPViaHeader(IPEndPoint, string, SIPProtocolsEnum)
Constructs a new SIPViaHeader object from an IPEndPoint, a branch parameter and a protocol
Declaration
public SIPViaHeader(IPEndPoint contactEndPoint, string branch, SIPProtocolsEnum protocol)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | contactEndPoint | Contact IPEndPoint |
string | branch | Branch parameter |
SIPProtocolsEnum | protocol | Transport protocol |
SIPViaHeader(string, int, string)
Constructor
Declaration
public SIPViaHeader(string contactIPAddress, int contactPort, string branch)
Parameters
Type | Name | Description |
---|---|---|
string | contactIPAddress | Contact IP address as a string |
int | contactPort | Contact port number |
string | branch | Via branch parameter |
SIPViaHeader(string, int, string, SIPProtocolsEnum)
Constructor
Declaration
public SIPViaHeader(string contactIPAddress, int contactPort, string branch, SIPProtocolsEnum protocol)
Parameters
Type | Name | Description |
---|---|---|
string | contactIPAddress | Contract address for the Via header |
int | contactPort | Contact port number |
string | branch | Via header branch parameter |
SIPProtocolsEnum | protocol | Transport protocol |
Fields
| Edit this page View SourceHost
Host portion of the URI
Declaration
public string? Host
Field Value
Type | Description |
---|---|
string |
Port
Port number
Declaration
public int Port
Field Value
Type | Description |
---|---|
int |
Transport
Transport protocol
Declaration
public SIPProtocolsEnum Transport
Field Value
Type | Description |
---|---|
SIPProtocolsEnum |
Version
Version parameter
Declaration
public string? Version
Field Value
Type | Description |
---|---|
string |
ViaParameters
Contains the Via header parameters
Declaration
public SIPParameters? ViaParameters
Field Value
Type | Description |
---|---|
SIPParameters |
Properties
| Edit this page View SourceBranch
Gets or sets the branch parameter
Declaration
public string? Branch { get; set; }
Property Value
Type | Description |
---|---|
string |
ContactAddress
This the address placed into the Via header by the User Agent.
Declaration
public string ContactAddress { get; }
Property Value
Type | Description |
---|---|
string |
ReceivedFromAddress
This is the socket the request was received on and is a combination of the Host and Received fields.
Declaration
public string? ReceivedFromAddress { get; }
Property Value
Type | Description |
---|---|
string |
ReceivedFromIPAddress
IP Address contained in the recevied parameter.
Declaration
public string? ReceivedFromIPAddress { get; set; }
Property Value
Type | Description |
---|---|
string |
ReceivedFromPort
Port contained in the rport parameter.
Declaration
public int ReceivedFromPort { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceParseSIPViaHeader(string)
Parses a SIP Via header
Declaration
public static SIPViaHeader[] ParseSIPViaHeader(string viaHeaderStr)
Parameters
Type | Name | Description |
---|---|---|
string | viaHeaderStr | Input string |
Returns
Type | Description |
---|---|
SIPViaHeader[] | Returns a new SIPViaHeader |
ToString()
Convers this SIPViaHeader object to a string
Declaration
public string ToString()
Returns
Type | Description |
---|---|
string |