Module: kamailio
Branch: master
Commit: 7fce53407c4ca8695b325a92a1574a1f01daf80b
URL: 
https://github.com/kamailio/kamailio/commit/7fce53407c4ca8695b325a92a1574a1f01daf80b

Author: Kamailio Dev <kamailio....@kamailio.org>
Committer: Kamailio Dev <kamailio....@kamailio.org>
Date: 2017-05-29T23:31:20+02:00

modules: readme files regenerated - ipops ... [skip ci]

---

Modified: src/modules/ipops/README

---

Diff:  
https://github.com/kamailio/kamailio/commit/7fce53407c4ca8695b325a92a1574a1f01daf80b.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7fce53407c4ca8695b325a92a1574a1f01daf80b.patch

---

diff --git a/src/modules/ipops/README b/src/modules/ipops/README
index a71cf1e5f3..a8121ccd3b 100644
--- a/src/modules/ipops/README
+++ b/src/modules/ipops/README
@@ -43,6 +43,7 @@ Iñaki Baz Castillo
               4.15. dns_int_match_ip(hostname, ipaddr)
               4.16. dns_query(hostname, pvid)
               4.17. srv_query(srvcname, pvid)
+              4.18. naptr_query(domain, pvid)
 
    List of Examples
 
@@ -63,6 +64,7 @@ Iñaki Baz Castillo
    1.15. dns_int_match_ip usage
    1.16. dns_query usage
    1.17. srv_query usage
+   1.18. naptr_query usage
 
 Chapter 1. Admin Guide
 
@@ -94,6 +96,7 @@ Chapter 1. Admin Guide
         4.15. dns_int_match_ip(hostname, ipaddr)
         4.16. dns_query(hostname, pvid)
         4.17. srv_query(srvcname, pvid)
+        4.18. naptr_query(domain, pvid)
 
 1. Overview
 
@@ -152,6 +155,7 @@ Chapter 1. Admin Guide
    4.15. dns_int_match_ip(hostname, ipaddr)
    4.16. dns_query(hostname, pvid)
    4.17. srv_query(srvcname, pvid)
+   4.18. naptr_query(domain, pvid)
 
 4.1.  is_ip (ip)
 
@@ -563,3 +567,48 @@ if (srv_query ("_sip._udp.example.com", "udp") > 0) {
   }
 }
 ...
+
+4.18.  naptr_query(domain, pvid)
+
+   Queries DNS NAPTR records to resolve a domain name into a list of
+   orders, preferences, flags, services, regex, replaces sorted by orders
+   and preferences as outlined in RFC 2915.
+
+   Parameters:
+     * domain - string or pseudo-variable containing the domain. For
+       example, "example.com".
+     * pvid - container id for script variable.
+
+   Output:
+
+   Returns a positive number indicating success or a negative number when
+   an error is encountered. It can be used from ANY_ROUTE.
+
+   The $naptrquery pseudo-variable (PV) is loaded with the results of the
+   query. Multiple queries can be stored in the PV using the pvid key.
+   Each query contains zero-indexed arrays sorted by order and preference
+   that contain:
+     * count - number of records found
+     * order [index] - order as defined by RFC 2915
+     * pref [index] - preference as defined by RFC 2915
+     * flags [index] - flags
+     * services [index] - services
+     * regex [index] - regular expression
+     * replace [index] - replace
+
+   Example 1.18.  naptr_query usage
+...
+if (naptr_query ("example.com", "res") > 0) {
+  $var(cnt) = $naptrquery(res=>count);
+  $var(i) = 0;
+  while ($var(i) < $var(cnt)) {
+    xlog ("order[$var(i)] $naptrquery(udp=>order[$var(i)])\n");
+    xlog ("pref[$var(i)] $naptrquery(udp=>pref[$var(i)])\n");
+    xlog ("flags[$var(i)] $naptrquery(udp=>flags[$var(i)])\n");
+    xlog ("services[$var(i)] $naptrquery(udp=>services[$var(i)])\n");
+    xlog ("regex[$var(i)] $naptrquery(udp=>regex[$var(i)])\n");
+    xlog ("replace[$var(i)] $naptrquery(udp=>replace[$var(i)])\n");
+    $var(i) = $var(i) + 1;
+  }
+}
+...


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to