Method: OverSIP::SIP::RFC3263::Query#initialize

Defined in:
lib/oversip/sip/rfc3263.rb

#initialize(dns_conf, id, uri_scheme, uri_host, uri_host_type, uri_port = nil, uri_transport = nil) ⇒ Query

Returns a new instance of Query.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oversip/sip/rfc3263.rb', line 121

def initialize dns_conf, id, uri_scheme, uri_host, uri_host_type, uri_port=nil, uri_transport=nil
  @id = id
  @uri_scheme = uri_scheme
  @uri_host = uri_host
  @uri_host_type = uri_host_type
  @uri_port = uri_port
  @uri_transport = uri_transport

  @log_id ||= ("RFC3263" << " " << @id)

  @use_dns = dns_conf[:use_dns]
  @transport_preference = dns_conf[:transport_preference]

  @has_sip_ipv4 = dns_conf[:has_sip_ipv4]
  @has_sip_ipv6 = dns_conf[:has_sip_ipv6]
  @has_sip_udp = dns_conf[:has_sip_udp]
  @has_sip_tcp = dns_conf[:has_sip_tcp]
  @has_sip_tls = dns_conf[:has_sip_tls]

  # Just initialize these attributes if URI host is a domain.
  if uri_host_type == :domain
    @ip_type_preference = dns_conf[:ip_type_preference]
    @force_transport_preference = dns_conf[:force_transport_preference]
    @use_naptr = dns_conf[:use_naptr]
    @use_srv = dns_conf[:use_srv]
  end
end