Module: kamailio
Branch: master
Commit: 6a2a1dfb8a6718f7ecb7cc2f28cf471bdcf0fec3
URL:
https://github.com/kamailio/kamailio/commit/6a2a1dfb8a6718f7ecb7cc2f28cf471…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-06-16T12:09:36+02:00
siputils: docs for hdr_date_check()
---
Modified: src/modules/siputils/doc/siputils_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/6a2a1dfb8a6718f7ecb7cc2f28cf471…
Patch:
https://github.com/kamailio/kamailio/commit/6a2a1dfb8a6718f7ecb7cc2f28cf471…
---
diff --git a/src/modules/siputils/doc/siputils_admin.xml
b/src/modules/siputils/doc/siputils_admin.xml
index 8e7140385d..b1dffa1c3e 100644
--- a/src/modules/siputils/doc/siputils_admin.xml
+++ b/src/modules/siputils/doc/siputils_admin.xml
@@ -1354,6 +1354,37 @@ if (is_method("REGISTER") and src_ip == 1.2.3.4) {
contact_param_rm("myparam");
}
...
+</programlisting>
+ </example>
+ </section>
+ <section id="siputils.f.hdr_date_check">
+ <title>
+ <function moreinfo="none">hdr_date_check(tdiff)</function>
+ </title>
+ <para>
+ Returns true if sip message has Date header and its value is lower
+ than 'NOW() - tdiff'.
+ </para>
+ <para>Meaning of the parameters is as follows:</para>
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>tdiff</emphasis> - time difference in seconds,
+ it can be a variable or static integer value.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>hdr_date_check</function> usage</title>
+ <programlisting format="linespecific">
+...
+if (!hdr_date_check("10")) {
+ sl_send_reply("403", "Outdated date");
+ exit;
+}
+...
</programlisting>
</example>
</section>