DNS Query
Introduction
Similarly to ENUM query, starting with release 3.1, it is possible to issue DNS Query requests to DNS servers from routing scripts. This could be used to skip the ENUM Query part when the called uri is already known but still need to get the matching outgoing NAP, NAP proxy IP and port. To do so, the params[:dns_query] object must be filled with the required DNS Query attributes params[:dns_query][:fqdn] and an exception must be raised with reason :dns_query_required.
When DNS Query completes, the routing script is called again with the result. The params[:dns_query] object will be filled with the DNS Query attributes from the responses. The DNS query responses are available through params[:dns_query][:responses_list] call parameters:
params[:dns_query][:responses_list] [{:nap=>"NAP_UDP", :nap_proxy_ip=>"10.3.14.191", :nap_proxy_port=>"8080", :transport=>"UDP", :order=>"100", :preference=>"1", :priority=>"0", :weight=>"5"}, {:nap=>"NAP_TCP", :nap_proxy_ip=>"10.3.14.192", :nap_proxy_port=>"8081", :transport=>"TCP", :order=>"100", :preference=>"2", :priority=>"1", :weight=>"10"}]
Add dynamic routes
Similarly to ENUM Query, the DNS query could also create dynamic routes base on DNS query responses. This could be requested using the "add_dynamic_routes" call parameter:
params[:dns_query][:add_dynamic_routes] = true
The "base_routing.rb" script version should be greater then 1.37 in order to allow dynamic routes creation base on DNS query responses.
When requesting to add_dynamic_routes, the dns_query responses are used to create routes. Make sure that your configuration include a route with remapped_nap = "Registered or DNS users". A route will be created for each DNS query responses. The routes "remapped_nap" takes NAP value from DNS query responses.
It is required to modify main routing script (i.e. simple_routing_sbc.rb) to forward IP/port values from params[:routes] to params[:call] like we are doing for NAP. See following example:
... # This will select the outgoing NAP for this call according to the "remapped_nap" route parameter route_remap :call_field_name => :nap, :route_field_name => :remapped_nap
# This will select the outgoing NAP proxy ip address for this call according to the "remapped_nap_proxy_ip" route parameter route_remap :call_field_name => :nap_proxy_ip, :route_field_name => :remapped_nap_proxy_ip
# This will select the outgoing NAP proxy port for this call according to the "remapped_nap_proxy_port" route parameter route_remap :call_field_name => :nap_proxy_port, :route_field_name => :remapped_nap_proxy_port ...
Last updated
Was this helpful?