Our team needed a new function to find SIP services using DNS SRV records but we couldn't find a Kamailio module that supported this. After investigation we felt that the new function would fit better as an extension of the ipops module instead of creating a whole new one.
Please consider these changes to the ipops module.
Thank you, Bob You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/119
-- Commit Summary --
* * coding done; need to do documentation * * added srv_query ()
-- File Changes --
M modules/ipops/doc/ipops_admin.xml (85) M modules/ipops/ipops_mod.c (34) M modules/ipops/ipops_pv.c (544) M modules/ipops/ipops_pv.h (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/119.patch https://github.com/kamailio/kamailio/pull/119.diff
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/119
Thank you, this can be useful in some cases.
You know that DNS SRV and NAPTR support is in the core, right?
Sorting by weight is not in RFC 2782. You sort by priority and get a set of entries for each priority. Then you select by weight - but the result should be one entry, not a sorted list by weight. Weight is for load balancing, not sorting and failover. Priority is for failover.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/119#issuecomment-88774954
This is targeting usage in config, in addition to dns_query() from same ipops module and could be useful indeed. Maybe srv_query() can be enhanced to specify (e.g., via a parameter) what to return - the first entry (only one) or all entries. I find all entries useful, as there can be a loop in config to check all of them and see what is supported on the other side.
I think the sorting needs to be fixed according to rfc on priority.
Merging should not be done automatically here -- I can do it manually, because:
* commit messages are not reflecting what is inside the patches * indentation style must match the rest of the code in the module
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/119#issuecomment-88783503
Sorry if my documentation gave the wrong impression. Sorting is fully compliant with RFC 2782. Sorting is by priority, and weight is "arranged" per the algorithm outlined in the RFC using a random number.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/119#issuecomment-88888446
Pushed the patches manually with commit messages and indentation.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/119#issuecomment-89235830
Closed #119.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/119#event-272541949