Module: sip-router
Branch: 3.1
Commit: 8ce822e9cb0860491266344dfeb6865e68f8ecd0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8ce822e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Fri Nov 12 12:22:20 2010 +0100
sanity: note about different behavior based on autodrop
(cherry picked from commit 4a0b559062b70c1c089c1ea9908eaae60679ad04)
---
modules/sanity/README | 15 +++++++++------
modules/sanity/doc/functions.xml | 12 +++++++-----
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/modules/sanity/README b/modules/sanity/README
index a3e4ce1..0442064 100644
--- a/modules/sanity/README
+++ b/modules/sanity/README
@@ -20,7 +20,7 @@ Nils Ohlmeier
1.4. Functions
- 1.4.1. sanity_check()
+ 1.4.1. sanity_check([msg_checks [, uri_checks]])
1.1. Overview
@@ -136,12 +136,15 @@ modparam("sanity", "autodrop", 1)
Revision History
Revision $Revision$ $Date$
-1.4.1. sanity_check()
+1.4.1. sanity_check([msg_checks [, uri_checks]])
- This function makes a row of sanity checks on the given request. The
- function returns false (-1) if one of the checks failed. If one of the
- 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.
+ This function makes a row of sanity checks over the given SIP request.
+ The behavior of the function is also controled by 'autodrop' parameter.
+ If autodrop=0, the function returns false (-1) if one of the checks
+ failed. When autodrop=1, the function stops the execution of
+ configuration file. In both cases, ff one of the 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 5. sanity_check usage
...
diff --git a/modules/sanity/doc/functions.xml b/modules/sanity/doc/functions.xml
index ea9cf1d..f3cfa85 100644
--- a/modules/sanity/doc/functions.xml
+++ b/modules/sanity/doc/functions.xml
@@ -22,13 +22,15 @@
<section id="sanity_check">
<title>
- <function>sanity_check()</function>
+ <function>sanity_check([msg_checks [, uri_checks]])</function>
</title>
<para>
- This function makes a row of sanity checks on the given request.
- The function returns false (-1) if one of the checks failed. If one
- of the checks fails the module sends a precise error reply via
- sl_send_reply. Thus there is no need to reply with a generic
+ This function makes a row of sanity checks over the given SIP request. The
+ behavior of the function is also controled by 'autodrop' parameter.
+ If autodrop=0, the function returns false (-1) if one of the checks failed.
+ When autodrop=1, the function stops the execution of configuration file.
+ In both cases, ff one of the 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.
</para>
<example>
Module: sip-router
Branch: 3.1
Commit: 505445c01f30b91901de7af7841e21c87e9e10ab
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=505445c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#100 - Assignment operators don't work
User who did this - Alex Hermann (axlh)
----------
//> := was used only for avp, //
I know, I submitted the feature :)
//> the option starting with 3.0 for same features is to use [*] index.//
Thanks for the alternative, I'll update the wiki.
//> The rest of the operators like +=, -+ ... were supported by grammar but not really implemented//
I never noticed that += didn't actually work, should have added more logging statement in the script... Luckily I haven't used those in production code yet.
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=100#comment132
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
Daniel-Constantin Mierla has taken ownership of the following task:
FS#100 - Assignment operators don't work
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=100
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#100 - Assignment operators don't work
User who did this - Daniel-Constantin Mierla (miconda)
----------
:= was used only for avp, the option starting with 3.0 for same features is to use [*] index.
So, in 1.x was:
$avp(x) := 123;
Now it has to be:
$(avp(x)[*]) = 123;
You get also same behaviour when assigning $null like it was when doing ':= null'
The rest of the operators like +=, -+ ... were supported by grammar but not really implemented, they were doing simply assignment. Hope they were not documented anywhere, it was in my plans to implement but then the changes in project development line set different priorities.
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=100#comment131
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Alex Hermann (axlh)
Attached to Project - sip-router
Summary - Assignment operators don't work
Task Type - Bug Report
Category - Core
Status - Assigned
Assigned To - Andrei Pelinescu-Onciul
Operating System - All
Severity - Medium
Priority - Normal
Reported Version - 3.1
Due in Version - Undecided
Due Date - Undecided
Details - All assignment operators except plain '=' produce syntax error/bad command
At least the following assignments don't work anymore. Of course, they worked fine in 1.5:
:=
+=
-=
*=
/=
%=
&=
|=
^=
Following config snippet:
8: $var(test) += 6;
9: $avp(s:anon) := 0;
Produces the following output:
0(23685) : <core> [cfg.y:3409]: parse error in config file route_privacy.m4, line 8, column 13-14: syntax error
0(23685) : <core> [cfg.y:3409]: parse error in config file route_privacy.m4, line 8, column 13-14: bad command
0(23685) : <core> [cfg.y:3409]: parse error in config file route_privacy.m4, line 8, column 13-14: bad command
0(23685) : <core> [cfg.y:3412]: parse error in config file route_privacy.m4, line 8, column 16: bad command
0(23685) : <core> [cfg.y:3412]: parse error in config file route_privacy.m4, line 9, column 27: bad command
0(23685) : <core> [cfg.y:3412]: parse error in config file route_privacy.m4, line 9, column 27: bad command
0(23685) : <core> [cfg.y:3412]: parse error in config file route_privacy.m4, line 9, column 28: bad command
0(23685) : <core> [cfg.y:3412]: parse error in config file route_privacy.m4, line 9, column 30: bad command
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=100
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A user has added themself to the list of users assigned to this task.
FS#100 - Assignment operators don't work
User who did this - Alex Hermann (axlh)
http://sip-router.org/tracker/index.php?do=details&task_id=100
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.