DNS Query using SRV Record

The 2020 IMG supports utilizing an A-Record, SRV or Service Record, or both to specify which sip server to route a call to. The determination of which record to use is configured in the DNS Servers object. DNS Queries on SRV records will be described below. SRV Records are defined in RFC 2782 and identifies the server(s) that will support a particular service. In this case the 2020 IMG will be looking for the best way to route a call to a server which employs the sip service. A Channel Group can be configured so that a query is sent to a DNS server and the DNS response would be an SRV record including all the sip servers that match the initial DNS service request. From the SRV Record the 2020 IMG will handle load balancing from the priority/weight of each server using Random number method. The final result will be that the 2020 IMG will send the outbound INVITE message to the server with highest priority/weight and attempt to connect to that SIP server. If however after a few Re-INVITES the initial SIP Server cannot be reached, an outbound INVITE will be sent to the SIP server with the next highest priority/weight. This will continue until all responses in the DNS query have been exhausted and the call will fail. Up to five DNS responses in each SRV Record are supported.

The flexibility of the SRV record is not to have to assign a specific IP address to the INVITE and be able to route calls to different gateways by simply editing the DNS database. Other benefits would include flexibility on port numbers and priority.


Diagram with example

Below is diagram and explanation of how the 2020 IMG would route a call if an SRV record was being utilized. Follow diagram below.




  1. A Call comes into Channel Group SIP_CallerA. Through the use of routing tables and translation tables the call is then routed to Channel Group SIP_SRV_RR.

  2. Internal to the 2020 IMG, the call Iis sent to Channel Group SIP_SRV_RR. Channel Group SIP_SRV_RR is configured with an external IP Network Element as described in the configuration below. That External IP Network Element (Gateway) has a Gateway Host Name in the following format:

    _<service>._<transport type>.domain name = _sip._udp.jsmith.dialogic.com (See Ext. Gateway capture above.)

  3. Once the 2020 IMG sees the Gateway Host Name in this format it knows to send the Gateway Host Name to a DNS Server which handles SRV resource records. In this example _sip._udp.jsmith.dialogic.com was sent to DNS server.

  4. The DNS server looks into its Database for all the A-Records associated with this Gateway Hostname and sends them down to the 2020 IMG in an SRV Record format. Below are all the records that were found in this example:

    _sip._udp.jsmith.dialogic.com: type SRV, class IN, priority 10, weight 5, port 5060, target jsmith.dialogic.com
    _sip._udp.jsmith1.dialogic.com: type SRV, class IN, priority 5, weight 250, port 5060, target jsmith1.dialogic.com

    Additional Records:
    jsmith1.dialogic.com: type A class IN, addr
    jsmith.dialogic.com: type A class IN, addr

  5. Once the 2020 IMG gets the SRV record in the DNS response the weights and priorities are assessed. The 2020 IMG will select the A-Record within the SRV Record that satisfies the Priority/Weight/Random Number Method and return the hostname (target) with the highest priority. (Highest Priority meaning a priority of 1 is higher than a priority of 10, a priority of 500 is higher than a priority of 1000). See information below on how the priority/weight/random number is assessed.

Note: If priorities of the two responses are equal then the weight parameter will be assessed. The 2020 IMG will use load balancing method to determine which result to use.

  1. From the example above, after calculating the Priorities/Weights/Random Number method, the target host jsmith1.dialogic.com has a higher priority than jsmith.dialogic.com. In this instance, the call will first be sent to jsmith1.dialogic.com. If for some reason jsmith1.dialogic.com cannot be reached the 2020 IMG will then try and connect with SIP server that had the second highest priority. This will continue until all SIP Server entries in the DNS SRV Record have been exhausted.

  2. Along with the hostnames jsmith.dialogic.com and jsmith1.dialogic.com the DNS server also sends any IP addresses configured as displayed above. This is done in the case where the hostname is not configured on the far end gateway.

  3. The call is then routed to the gateway as shown in diagram above.




The procedure below explains how to configure the 2020 IMG to querying a DNS server Query using an SRV Record. Before configuring, the 2020 IMG must have an initial configuration created on it. Follow the Basic Configurations procedure before proceeding. Once all initial steps such as spans, interfaces,translations, internal routing, IP and Bearer Profiles, etc the 2020 IMG can be configured to accept SRV records. Follow steps below:

Configure External Gateways

  1. Right Click on Dialogic IMG EMS object and select New External Network Elements.

  2. Right Click on External Network Elements object and select New External Gateways.

  3. Right Click on External Gateways object and select New External Gateway. Below is screen capture on how to configure. Use the screen capture and the field


    Name - Enter a name into the Name field
    Gateway Signaling Protocol - Select SIP from drop down menu in the Gateway Signaling Protocol field.
    Gateway Address Type - Select Gateway host name from drop down menu.
    Gateway IP Address - Enter the IP addess of the gateway.
    Gateway Mask - Leave this field as
    Gateway Host Name - Enter the external gateway name as a service identifier with the (_) in the prefix. See example below. By entering the Gateway Host Name in the format below, it will trigger the 2020 IMG to send the query to the DNS server.


SRV Record = _<service>._<protocol>.<domainname>


Gateway Transport Type - Select the transport type from the drop down menu. Transport type should be the same transport type that is displayed in the Gateway Host Name field.

Gateway Remote Port - Enter the port number that the inbound calls from the remote gateway will be coming from.

Gateway Registration Required (SIP Only) - This field tells the 2020 IMG whether it must register with the gateway. Applies to SIP gateways only.

Registration Expiration Interval (sec) (SIP Only) - Use this field to control the registration refresh interval. Applies to SIP gateways only. Default = 3600 seconds, Range = 10-7200 seconds

SIP Profile - Select which SIP profile from the drop down menu which displays all SIP Profiles created.

Options Keep Alive - Use this field to enable the SIP Options Keep Alive (Busy Out) feature on a gateway. See External Gateway link.

  1. Configure multiple gateways using the _sip._udp.jsmith.dialogic.com format in the Gateway Hostname field. For example: The 1st Gateway Host Name is _sip._udp.jsmith.dialogic.com the second gateway could be _sip._udp.jsmith1.dialogic.com and third gateway could be _sip._udp.jsmith2.dialogic.com and so on.


Configure Channel Groups

  1. Right Click on Dialogic IMG EMS object in object tree and select New Routing Configuration. See Routing Configuration link for more info.

  2. Right Click on Routing Configuration Object just created and select New Channel Groups. See Channel Groups Link for more info.

  3. Right Click on the Channel Groups Object just created and select New Channel Group. See Channel Group Link for more information on how to configure Channel Groups. Verify that Signaling Type is SIP.

  4. Right Click on the Channel Group created and select New IP Network Element and select which gateway will be associated with this Channel Group. See screen capture below.


  5. Create multiple channel groups as needed and select a different IP Network Element for each. As long as the Gateway Host Name field in the External Gateway of the IP Network Element selected is of the format _<service>._<protocol>.<Domainname> this channel group will initiate a DNS lookup with that format.

Note: A DNS Query formatted as _sip._udp.jsmith.dialogic.com would be sent to the DNS server if Channel Group named DNS_Config from above is being used.


Load Balancing:

The 2020 IMG supports Load Balancing responses from a DNS request. The load balancing is built into the 2020 IMG and does not need to be configured. The load balancing technique uses a priority/weight/Random Number technique which follows RFC 2782. Below explains the load balancing technique.

  1. The 2020 IMG receives a call with the hostname _sip._udp_jsmith.dialogic.com. This triggers the 2020 IMG to initiate a DNS request to a DNS Server. The DNS server returns a response to the request. The response is displayed below as an unsorted list

Unsorted List

SRV Record

Hostname: Port: Priority Weight
jsmith1 5100 10 25
jsmith2 5300 10 50
jsmith6 5600 100 50
jsmith3 5200 10 25
jsmith5 5500 100 50


  1.  The 2020 IMG accepts the list and does an initial sort which is done by priority. See table below

Hostname: Port: Priority Weight
jsmith1 5100 10 25
jsmith2 5300 10 50
jsmith3 5600 10 25
jsmith5 5200 100 50
jsmith6 5500 100 50
  1. For entries with same priority, create a separate list with weight 0 first in this list.
Hostname: Port: Priority Weight
jsmith1 5100 10 25
jsmith2 5300 10 50
jsmith3 5600 10 25
  1. The weights are added with the previous weight sum. The first weight does not have a previous record so weight for previous record is 0.
Hostname: Port: Priority Weight Sum
(Weight + Prior weight sum)
Random Number Range
jsmith1 5100 10 25 25 + 0 = 25 0 - 25
jsmith2 5300 10 50 25 + 50 = 75 26 - 75
jsmith3 5600 10 25 75 + 25 = 100 76 - 100
  1. At this point a random number is generated. In this example 45 was selected as the random number. Based on the Random Number Range from the previous table, jsmith2 would be the first SIP server selected. From here, if first SIP server is not reachable, another random number is generated and that would set the priority of the second SIP server. This would continue until all servers have been selected/exhausted.


Additional Information: