Show / Hide Table of Contents

Class SIPURI

Implements the SIP URI concept from the SIP RFC3261.

Inheritance
System.Object
SIPURI
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: SIPSorcery.SIP
Assembly: SIPSorcery.dll
Syntax
[DataContract]
public class SIPURI

Constructors

| Improve this Doc View Source

SIPURI(SIPSchemesEnum, SIPEndPoint)

Declaration
public SIPURI(SIPSchemesEnum scheme, SIPEndPoint sipEndPoint)
Parameters
Type Name Description
SIPSchemesEnum scheme
SIPEndPoint sipEndPoint
| Improve this Doc View Source

SIPURI(SIPSchemesEnum, IPAddress, Int32)

Declaration
public SIPURI(SIPSchemesEnum scheme, IPAddress address, int port)
Parameters
Type Name Description
SIPSchemesEnum scheme
System.Net.IPAddress address
System.Int32 port
| Improve this Doc View Source

SIPURI(String, String, String)

Declaration
public SIPURI(string user, string host, string paramsAndHeaders)
Parameters
Type Name Description
System.String user
System.String host
System.String paramsAndHeaders
| Improve this Doc View Source

SIPURI(String, String, String, SIPSchemesEnum)

Declaration
public SIPURI(string user, string host, string paramsAndHeaders, SIPSchemesEnum scheme)
Parameters
Type Name Description
System.String user
System.String host
System.String paramsAndHeaders
SIPSchemesEnum scheme
| Improve this Doc View Source

SIPURI(String, String, String, SIPSchemesEnum, SIPProtocolsEnum)

Declaration
public SIPURI(string user, string host, string paramsAndHeaders, SIPSchemesEnum scheme, SIPProtocolsEnum protocol)
Parameters
Type Name Description
System.String user
System.String host
System.String paramsAndHeaders
SIPSchemesEnum scheme
SIPProtocolsEnum protocol

Fields

| Improve this Doc View Source

HEADER_START_DELIMITER

Declaration
public const char HEADER_START_DELIMITER = '?'
Field Value
Type Description
System.Char
| Improve this Doc View Source

Headers

Declaration
[DataMember]
public SIPParameters Headers
Field Value
Type Description
SIPParameters
| Improve this Doc View Source

Host

Declaration
[DataMember]
public string Host
Field Value
Type Description
System.String
| Improve this Doc View Source

None

Declaration
public static SIPURI None
Field Value
Type Description
SIPURI
| Improve this Doc View Source

PARAM_TAG_DELIMITER

Declaration
public const char PARAM_TAG_DELIMITER = ';'
Field Value
Type Description
System.Char
| Improve this Doc View Source

Parameters

Declaration
[DataMember]
public SIPParameters Parameters
Field Value
Type Description
SIPParameters
| Improve this Doc View Source

Scheme

Declaration
[DataMember]
public SIPSchemesEnum Scheme
Field Value
Type Description
SIPSchemesEnum
| Improve this Doc View Source

SCHEME_ADDR_SEPARATOR

Declaration
public const char SCHEME_ADDR_SEPARATOR = ':'
Field Value
Type Description
System.Char
| Improve this Doc View Source

User

Declaration
[DataMember]
public string User
Field Value
Type Description
System.String
| Improve this Doc View Source

USER_HOST_SEPARATOR

Declaration
public const char USER_HOST_SEPARATOR = '@'
Field Value
Type Description
System.Char
| Improve this Doc View Source

UserParameters

contains the user part parameters if there are any

Declaration
[DataMember]
public SIPParameters UserParameters
Field Value
Type Description
SIPParameters
| Improve this Doc View Source

UserWithoutParameters

Contains the User part without parameters in case there are any

Declaration
[DataMember]
public string UserWithoutParameters
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

CanonicalAddress

Returns a string that can be used to compare SIP URI addresses.

Declaration
public string CanonicalAddress { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

HostAddress

Declaration
public string HostAddress { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

HostPort

Declaration
public string HostPort { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

MAddr

Declaration
public string MAddr { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

MAddrOrHost

Declaration
public string MAddrOrHost { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

MAddrOrHostAddress

Declaration
public string MAddrOrHostAddress { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Protocol

The protocol for a SIP URI is dictated by the scheme of the URI and then by the transport parameter and finally by the use of a default protocol. If the URI is a sips one then the protocol must be TLS. After that if there is a transport parameter specified for the URI it dictates the protocol for the URI. Finally if there is no transport parameter for a sip URI then the default UDP transport is used.

Declaration
public SIPProtocolsEnum Protocol { get; set; }
Property Value
Type Description
SIPProtocolsEnum
| Improve this Doc View Source

UnescapedUser

Declaration
public string UnescapedUser { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

AreEqual(SIPURI, SIPURI)

Declaration
public static bool AreEqual(SIPURI uri1, SIPURI uri2)
Parameters
Type Name Description
SIPURI uri1
SIPURI uri2
Returns
Type Description
System.Boolean
| Improve this Doc View Source

CopyOf()

Declaration
public SIPURI CopyOf()
Returns
Type Description
SIPURI
| Improve this Doc View Source

Equals(Object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

IsDefaultPort()

Indicates whether the SIP URI is using the default port for its protocol. Default ports are 5060 for UDP and TCP, 5061 for TLS, 80 for WS and 443 for WSS.

Declaration
public bool IsDefaultPort()
Returns
Type Description
System.Boolean

True if the default port is being used, false if not.

| Improve this Doc View Source

Mangle(SIPURI, IPEndPoint)

Checks whether the specified SIP URI Host field contains a private IPv4 address and if so and the received on IP address is different then "mangles" the host to contain the received on IP end point. The purpose of the mangling is to assist in dealing with IPv4 NAT's. If the SIP URI host is IPv6 or a host name no mangling will be done.

Declaration
public static SIPURI Mangle(SIPURI uri, IPEndPoint receivedOn)
Parameters
Type Name Description
SIPURI uri

The SIP URI to mangle.

System.Net.IPEndPoint receivedOn

The IP end point that the SIP message was received from.

Returns
Type Description
SIPURI

A new SIP URI if mangling took place. Null if no mangling occurred.

| Improve this Doc View Source

ParseSIPURI(String)

Declaration
public static SIPURI ParseSIPURI(string uri)
Parameters
Type Name Description
System.String uri
Returns
Type Description
SIPURI
| Improve this Doc View Source

ParseSIPURIRelaxed(String)

Declaration
public static SIPURI ParseSIPURIRelaxed(string partialURI)
Parameters
Type Name Description
System.String partialURI
Returns
Type Description
SIPURI
| Improve this Doc View Source

ParseUserParameters()

this function checks 'User' for user part paramters and puts them into 'UserParameters' and the part before Parameters into UserNumber The Function is called automatically if user=phone is set.

Declaration
public void ParseUserParameters()
| Improve this Doc View Source

ToAOR()

Returns an address of record for the SIP URI which is a string in the format user@host.

Declaration
public string ToAOR()
Returns
Type Description
System.String

A string representing the address of record for the URI.

| Improve this Doc View Source

ToParameterlessString()

Returns a string representation of the URI with any parameter and headers omitted except for the transport parameter. The string returned by this function is used amongst other things to match Route headers set by this SIP agent.

Declaration
public string ToParameterlessString()
Returns
Type Description
System.String

A string representation of the URI with headers and parameters omitted except for the transport parameter if it is required.

| Improve this Doc View Source

ToSIPEndPoint()

Declaration
public SIPEndPoint ToSIPEndPoint()
Returns
Type Description
SIPEndPoint
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()
| Improve this Doc View Source

TryParse(String, out SIPURI)

Declaration
public static bool TryParse(string uriStr, out SIPURI uri)
Parameters
Type Name Description
System.String uriStr
SIPURI uri
Returns
Type Description
System.Boolean

Operators

| Improve this Doc View Source

Equality(SIPURI, SIPURI)

Declaration
public static bool operator ==(SIPURI uri1, SIPURI uri2)
Parameters
Type Name Description
SIPURI uri1
SIPURI uri2
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Inequality(SIPURI, SIPURI)

Declaration
public static bool operator !=(SIPURI x, SIPURI y)
Parameters
Type Name Description
SIPURI x
SIPURI y
Returns
Type Description
System.Boolean

Extension Methods

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