It seems like opensips when using SRV records does not read and use the 
ADDITIONAL RECORDS, and instead sends another DNS request to get the IP for the 
host, which is inefficient and could be supported just like mentioned in the 
[RFC 2782](https://www.ietf.org/rfc/rfc2782.txt) :

    For each element in the new list

      query the DNS for address records for the Target or
      use any such records found in the Additional Data
      section of the earlier SRV response.

Example, for our `_sip._udp` service using our service discovery tool : 

    ;; ANSWER SECTION:
    _sip._udp.service.consul. 15  IN  SRV 1 1 5063 ourserver.node.us.consul.
    _sip._udp.service.consul. 15  IN  SRV 1 1 5060 ourserver.node.us.consul.
    _sip._udp.service.consul. 15  IN  SRV 1 1 5062 ourserver.node.us.consul.
    _sip._udp.service.consul. 15  IN  SRV 1 1 5061 ourserver.node.us.consul.

    ;; ADDITIONAL SECTION:
    ourserver.node.us.consul. 15 IN A 98.XXX.XXX.XXX

It has all the information it needs but it still does an extra `A` query, which 
is an issue for us as some of our services run on different interfaces. I'm 
looking at `resolve.c` and trying to see how this can be implemented ([See how 
Kamailio is doing it for 
example](https://github.com/kamailio/kamailio/blob/master/resolve.c#L933-L954)) 
but I've ran into issues with the dns_cache. Any thoughts or anyone that would 
like to take on this issue?

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/675
_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

Reply via email to