Added support for SRV records, plus documentation and tests #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've added support for SRV records, as well as basic tests and documentation. The result looks good on my dev instance:
$ dig _sip._tcp.test.example.com -t SRV @localhost
; <<>> DiG 9.9.2-P1 <<>> _sip._tcp.test.example.com -t SRV @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50908
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;_sip._tcp.test.example.com. IN SRV
;; ANSWER SECTION:
_sip._tcp.test.example.com. 600 IN SRV 10 100 5060 sipserver.example.com.
Note: I've used the variable srv_weight to distinguish between the weight that's internal to the SRV record struct vs. the "weight" that other records use. Let me know if this should be changed.