[sr-dev] git:3.1: sanity: docs updated with autodrop parameter

Daniel-Constantin Mierla miconda at gmail.com
Wed Nov 24 22:38:32 CET 2010


Module: sip-router
Branch: 3.1
Commit: 505445c01f30b91901de7af7841e21c87e9e10ab
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=505445c01f30b91901de7af7841e21c87e9e10ab

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Oct 29 17:09:39 2010 +0200

sanity: docs updated with autodrop parameter
(cherry picked from commit 8a50fa608edad91782848711c51476af01dd0392)

---

 modules/sanity/README         |   28 ++++++++++++++++++++++++----
 modules/sanity/doc/params.xml |   27 +++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/modules/sanity/README b/modules/sanity/README
index 2510375..a3e4ce1 100644
--- a/modules/sanity/README
+++ b/modules/sanity/README
@@ -16,6 +16,7 @@ Nils Ohlmeier
         1.3.1. default_checks (integer)
         1.3.2. uri_checks (integer)
         1.3.3. proxy_require (string)
+        1.3.4. autodrop (integer)
 
    1.4. Functions
 
@@ -99,6 +100,11 @@ modparam("sanity", "default_checks", "1")
    Default value is 7. This resolves to the following list of parsed URIs:
    Request RUI (1), From URI (2) and To URI (4).
 
+   Example 2. Set uri_checks parameter
+...
+modparam("sanity", "uri_checks", 3)
+...
+
 1.3.3. proxy_require (string)
 
    This parameter set the list of supported extensions for this
@@ -106,11 +112,25 @@ modparam("sanity", "default_checks", "1")
    extensions. This list is separated into single tokens. Each token from
    a proxy require header will be compare to the tokens from this list.
 
-   Example 2. Set proxy_require parameter
+   Example 3. Set proxy_require parameter
 ...
 modparam("sanity", "proxy_require", "foo, bar")
 ...
 
+1.3.4. autodrop (integer)
+
+   This parameter controls whether the module drops automatically or not
+   the SIP message if the sanity checks fail. Default value is 1 (auto
+   drop). If set to 0, sanity_check() function will return -1 (false) to
+   configuration file, allowing to write log messages for example - be
+   sure you exit execution of config without sending a SIP reply because
+   it is sent by module itself.
+
+   Example 4. Set autodrop parameter
+...
+modparam("sanity", "autodrop", 1)
+...
+
 1.4. Functions
 
    Revision History
@@ -123,7 +143,7 @@ modparam("sanity", "proxy_require", "foo, bar")
    checks fails the module sends a precise error reply via sl_send_reply.
    Thus there is no need to reply with a generic error message.
 
-   Example 3. sanity_check usage
+   Example 5. sanity_check usage
 ...
 if (!sanity_check()) {
         exit;
@@ -136,7 +156,7 @@ if (!sanity_check()) {
    checks (like for the module parameter) which should be executed at this
    function call.
 
-   Example 4. sanity_check usage with parameter
+   Example 6. sanity_check usage with parameter
 ...
 if (method=="REGISTER" && !sanity_check("256")) {
         /* the register contains an invalid expires value and is replied with a
@@ -149,7 +169,7 @@ if (method=="REGISTER" && !sanity_check("256")) {
    overwrites the global module parameter uri_checks and thus determines
    which URIs will be checked if the parse uri test will be executed.
 
-   Example 5. sanity_check usage with two parameters
+   Example 7. sanity_check usage with two parameters
 ...
 if (method=="INVITE" && !sanity_check("1024", "6")) {
         /* the INVITE contains an invalid From or To header and is replied with
diff --git a/modules/sanity/doc/params.xml b/modules/sanity/doc/params.xml
index b56affd..f633c8c 100644
--- a/modules/sanity/doc/params.xml
+++ b/modules/sanity/doc/params.xml
@@ -55,6 +55,14 @@ modparam("sanity", "default_checks", "1")
 		Default value is 7. This resolves to the following list of
 		parsed URIs: Request RUI (1), From URI (2) and To URI (4).
 	</para>
+	<example>
+	    <title>Set <varname>uri_checks</varname> parameter</title>
+	    <programlisting>
+...
+modparam("sanity", "uri_checks", 3)
+...
+	    </programlisting>
+	</example>
 	</section>
 
 	<section id="proxy_require">
@@ -76,5 +84,24 @@ modparam("sanity", "proxy_require", "foo, bar")
 	</example>
 	</section>
 
+	<section id="autodrop">
+	<title><varname>autodrop</varname> (integer)</title>
+	<para>
+		This parameter controls whether the module drops automatically
+		or not the SIP message if the sanity checks fail. Default value
+		is 1 (auto drop). If set to 0, sanity_check() function will return
+		-1 (false) to configuration file, allowing to write log messages for
+		example - be sure you exit execution of config without sending a SIP
+		reply because it is sent by module itself.
+	</para>
+	<example>
+	    <title>Set <varname>autodrop</varname> parameter</title>
+	    <programlisting>
+...
+modparam("sanity", "autodrop", 1)
+...
+	    </programlisting>
+	</example>
+	</section>
 
 </section>




More information about the sr-dev mailing list