Show / Hide Table of Contents

Class SIPDns

SIP specific DNS resolution.

Inheritance
System.Object
SIPDns
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()
Namespace: SIPSorcery.SIP
Assembly: SIPSorcery.dll
Syntax
public static class SIPDns
Remarks
  1. If transport parameter is specified it takes precedence,
  2. If no transport parameter and target is an IP address then sip should use udp and sips tcp,
  3. If no transport parameter and target is a host name with an explicit port then sip should use udp and sips tcp and host should be resolved using an A or AAAA record DNS lookup (section 4.2), 4*. If no transport protocol and no explicit port and target is a host name then the client should no an NAPTR lookup and utilise records for services SIP+D2U, SIP+D2T, SIP+D2S, SIPS+D2T and SIPS+D2S,
  4. If NAPTR record(s) are found select the desired transport and lookup the SRV record,
  5. If no NAPT records are found lookup SRV record for desired protocol _sip._udp, _sip._tcp, _sips._tcp, _sip._tls,
  6. If no SRV records found lookup A or AAAA record.
  • NAPTR lookups are currently not implemented as they have been found to be hardly ever used and can increase the DNS query time noticeably.

Observations from the field.

  • A DNS server has been observed to not respond at all to NAPTR or SRV record queries meaning lookups for them will permanently time out.

Fields

| Improve this Doc View Source

CACHE_FAILED_RESULTS_DURATION

Declaration
public const int CACHE_FAILED_RESULTS_DURATION = 10
Field Value
Type Description
System.Int32
| Improve this Doc View Source

DNS_RETRIES_PER_SERVER

Declaration
public const int DNS_RETRIES_PER_SERVER = 1
Field Value
Type Description
System.Int32
| Improve this Doc View Source

DNS_TIMEOUT_SECONDS

Declaration
public const int DNS_TIMEOUT_SECONDS = 1
Field Value
Type Description
System.Int32
| Improve this Doc View Source

MDNS_TLD

Declaration
public const string MDNS_TLD = "local"
Field Value
Type Description
System.String
| Improve this Doc View Source

UseANYLookups

Don't use IN_ANY queries by default. These are useful if a DNS server supports them as they can return IPv4 and IPv6 results in a single query. For DNS servers that don't support them it means an extra delay.

Declaration
public static bool UseANYLookups
Field Value
Type Description
System.Boolean

Properties

| Improve this Doc View Source

LookupClient

The client performing the SIP DNS lookups. In normal circumstances this property does not need to be set manually and care needs to be taken if it is. SIP relies heavily on DNS lookups and most functions will fail if the DNS client is misconfigured.

Declaration
public static ILookupClient LookupClient { get; set; }
Property Value
Type Description
DnsClient.ILookupClient

Methods

| Improve this Doc View Source

ResolveAsync(SIPURI, Boolean, CancellationToken)

Resolve method that performs either an A or AAAA record lookup. If required a SRV record lookup will be performed prior to the A or AAAA lookup.

Declaration
public static Task<SIPEndPoint> ResolveAsync(SIPURI uri, bool preferIPv6, CancellationToken ct)
Parameters
Type Name Description
SIPURI uri

The SIP URI to lookup.

System.Boolean preferIPv6

Whether the address lookup would prefer to have an IPv6 address returned.

System.Threading.CancellationToken ct
Returns
Type Description
System.Threading.Tasks.Task<SIPEndPoint>

A SIPEndPoint or null.

| Improve this Doc View Source

ResolveFromCache(SIPURI, Boolean)

Declaration
public static SIPEndPoint ResolveFromCache(SIPURI uri, bool preferIPv6)
Parameters
Type Name Description
SIPURI uri
System.Boolean preferIPv6
Returns
Type Description
SIPEndPoint
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX