Open Esya opened 9 years ago
Hello,
This would be a great feature to implement - though I can't really find such a SRV record ( with additional records ) out in the wild, in order to have something to test against.. Could you please provide such a SRV DNS record that I can test with ?
Best Regards, Vlad
Hi @vladpaiu,
I just pushed a dummy DNS Server on new.esya.me
that serves the right format for you; you can try this :
# dig _sip._udp.example.org @new.esya.me SRV
;; QUESTION SECTION:
;_sip._udp.example.org. IN SRV
;; ANSWER SECTION:
_sip._udp.example.org. 600 IN SRV 1 1 5062 hostA.example.org.
_sip._udp.example.org. 600 IN SRV 1 1 5061 hostB.example.org.
;; AUTHORITY SECTION:
dummy. 600 IN NS ignoreme.
;; ADDITIONAL SECTION:
hostA.example.org. 600 IN A 1.1.1.1
hostA.example.org. 600 IN A 2.2.2.2
You should therefore be able to do a simple redirect on example.org
and opensips will automatically append _sip._udp
. This server will have empty answers for anything other than SRV lookup for _sip._udp.example.org
and is listening on both UDP and TCP. I've included an authority section just to make sure that it is properly skipped by the client.
Best, Tristan
Hello,
Thanks for the help with this - the record looks fine.
Will work on it and update the ticket when it's done.
Regards, Vlad
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 :
Example, for our
_sip._udp
service using our service discovery tool :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 atresolve.c
and trying to see how this can be implemented (See how Kamailio is doing it for example) but I've ran into issues with the dns_cache. Any thoughts or anyone that would like to take on this issue?