Module: kamailio
Branch: master
Commit: a824e939b589ae595fc735de1337a8bf4470de20
URL:
https://github.com/kamailio/kamailio/commit/a824e939b589ae595fc735de1337a8b…
Author: Xenofon Karamanos <22965395+xkaraman(a)users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkaraman(a)users.noreply.github.com>
Date: 2024-04-09T13:32:46+03:00
ipops: Add ptr_query docs
---
Modified: src/modules/ipops/doc/ipops_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/a824e939b589ae595fc735de1337a8b…
Patch:
https://github.com/kamailio/kamailio/commit/a824e939b589ae595fc735de1337a8b…
---
diff --git a/src/modules/ipops/doc/ipops_admin.xml
b/src/modules/ipops/doc/ipops_admin.xml
index 14dad9f5df6..912d953c9fe 100644
--- a/src/modules/ipops/doc/ipops_admin.xml
+++ b/src/modules/ipops/doc/ipops_admin.xml
@@ -883,6 +883,93 @@ if(dns_query("test.com", "xyz"))
</section>
+ <section id="ipops.f.ptr_query">
+ <title>
+ <function moreinfo="none">ptr_query(ip, pvid)</function>
+ </title>
+
+ <para>
+ Store the hostname that correspond to an IP address (IPv4 or IPv6)
+ in a pseudo-variable variable $ptrquery(pvid=>hostname).
+ </para>
+
+ <para>
+ <emphasis>Note: Results will be in in
$ptrquery(pvid=>key).</emphasis>
+ key can be:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>addr</emphasis> - IP address
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>type</emphasis> - type of IP address
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>ipv4</emphasis> - 1 if IPv4 address
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>ipv6</emphasis> - 1 if IPv6 address
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>count</emphasis> - number of hostnames found
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>hostname</emphasis> - hostname
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>Parameters:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>ip</emphasis> - string or pseudo-variable containing the ip.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>pvid</emphasis> - AVP id for script variable.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+
+ <example>
+ <title>
+ <function>ptr_query</function> usage
+ </title>
+ <programlisting format="linespecific">
+...
+if(ptr_query("8.8.8.8","ip4"))
+{
+ xlog(" number of names: $ptrquery(ip4=>count)\n");
+ $var(j) = 0;
+ while($var(j)<$ptrquery(ip4=>count)) {
+ xlog(" #[$var(j)] name [ $ptrquery(ip4=>hostname) ]\n");
+ $var(j) = $var(j) + 1;
+ }
+}
+...
+ </programlisting>
+ </example>
+
+ </section>
+
<section id="ipops.f.srv_query">
<title>
<function moreinfo="none">srv_query(srvcname,
pvid)</function>