For reference, this is how my lrn provder replies to a dns query:
; <<>> DiG 9.11.2 <<>> @enum.AnEnumProvider.com -t naptr
3.2.6.4.2.6.5.5.7.7.1.lrn.e164.arpa
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7531
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;3.2.6.4.2.6.5.5.7.7.1.lrn.e164.arpa. IN NAPTR
;; ANSWER SECTION:
3.2.6.4.2.6.5.5.7.7.1.lrn.e164.arpa. 30 IN NAPTR 10 10 "u"
"E2U+pstn:tel" "!^.*$!tel:+17755624623;rn=+17753840044;npdi!" .
;; Query time: 79 msec
;; SERVER: 108.166.172.197#53(108.166.172.197)
;; WHEN: Tue May 22 16:02:15 EDT 2018
;; MSG SIZE rcvd: 130
So he needs to send the naptr query to a specific host, and to grab and
unpack the answer to get the rn.
To the OP, I suspect the only good way to do that with kamailio is to
use one of the Turing complete modules (perl, lua, python or the like)
to write the necessary code.
Or write your own kamailio module.
The answer is likely the same when using a web-based api to do the dips.
-JimC
--
James Cloos <cloos(a)jhcloos.com> OpenPGP: 0x997A9F17ED7DAEA6