Right now we have a problem with old scripts that use things like
if ($v) (where $v could be avp, pseudovar or select).
$v can evaluate to a int, a string or undefined.
Now for string and undefined the if will evaluate to false (string
being an error) and an error will be logged.
If the type of $v can be found prior to runtime (e.g. @select is always
string) you'll even get a parse error.
I plan to add some new operators, to properly deal with these cases:
defined($v)
strempty($v)
strlen($v)
but the question still remains if we should preserve compatibility and
still support things like if (@to.tag), instead of if (!strempty((a)to.tag))
or if (@to.tag!="").
What's trickier is that if we allow strings in int expressions
then we have 2 problems:
- "" evaluates to 1 or 0?
- how to evaluate a string in an integer context: is "abc" 1 or 3
(strlen)? How about "123" ?
- $v is 0 if v is not defined?
Note that if we do this it will work in all types of expressions, e.g.
if string evaluates to strlen(string) in interger context then:
3+"abc" = 6 ; 3+ ""=3 ; 3+"9"=4 3+"0"=4.
Andrei
Module: sip-router
Branch: master
Commit: a13da049257f5c6b9a5da52ac1a55f25e6dadfe5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a13da04…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu Apr 30 18:55:41 2009 +0200
generate README for blst module
---
modules_s/blst/README | 82 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/modules_s/blst/README b/modules_s/blst/README
new file mode 100644
index 0000000..8387e98
--- /dev/null
+++ b/modules_s/blst/README
@@ -0,0 +1,82 @@
+1. Blst Module
+
+Andrei Pelinescu-Onciul
+
+ iptelorg GmbH
+
+ Copyright � 2007 iptelorg GmbH
+ Revision History
+ Revision $Revision$ $Date$
+ __________________________________________________________________
+
+ 1.1. Overview
+ 1.2. Functions
+
+ 1.2.1. blst_add([timeout])
+ 1.2.2. blst_add_retry_after(min, max)
+ 1.2.3. blst_del()
+ 1.2.4. blst_is_blacklisted()
+
+1.1. Overview
+
+ This module exports blacklist related functions to the script.
+
+1.2. Functions
+
+ Revision History
+ Revision $Revision$ $Date$
+
+1.2.1. blst_add([timeout])
+
+ Adds the source of the current message to the blacklist for timeout
+ seconds. If timeout is missing or 0 it uses the default blacklist
+ timeout (dst_blacklist_expire).
+
+ Example 1. blst_add usage
+...
+if (src_ip==10.0.0.0/9)
+ blst_add(30); # 30 s
+else
+ blst_add(); # use default blacklist timeout
+...
+
+1.2.2. blst_add_retry_after(min, max)
+
+ Adds the source of the current message to the blacklist for the time
+ interval specified in the Retry-After header. If the Retry-After header
+ is missing, it will fail (returns false). If the Retry-After value is
+ less then min, then min seconds will be used instead. If the
+ Retry-After value is greater then max, then max seconds will be used
+ instead.
+
+ Example 2. blst_add_retry_after usage
+...
+# on_reply route
+if (msg_status==503){ # blacklist 503 source for Retry-After seconds
+ if (! blst_add_retry_after(30, 3600))
+ blst_add(60); # if no retry_after header add it for 60s
+}
+...
+
+1.2.3. blst_del()
+
+ Removes the source of the current message from the blacklist. If the
+ address is not present in the blacklist at the time of the call it
+ returns false.
+
+ Example 3. blst_del usage
+...
+ blst_del();
+...
+
+1.2.4. blst_is_blacklisted()
+
+ Returns true if the source of the current message is blacklisted.
+
+ Example 4. blst_is_blacklisted usage
+...
+ if (blst_is_blacklisted()){
+ log("message from a blacklisted source");
+ drop;
+ }
+...
Module: sip-router
Branch: master
Commit: 26fa3cf1464b0cddb67be64cd30918b9c2965c13
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=26fa3cf…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Sun May 3 19:23:22 2009 +0200
spelling fix in documentation
---
modules/tm/README | 2 +-
modules/tm/doc/functions.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/tm/README b/modules/tm/README
index 87579b1..7b1ce8f 100644
--- a/modules/tm/README
+++ b/modules/tm/README
@@ -838,7 +838,7 @@ t_reply("404", "Not found");
Checks if a transaction exists. Returns a positive value if so,
negative otherwise. Most likely you will not want to use it, as a
- typical application of a looku-up is to introduce a new transaction if
+ typical application of a look-up is to introduce a new transaction if
none was found. However this is safely (atomically) done using
t_newtran.
diff --git a/modules/tm/doc/functions.xml b/modules/tm/doc/functions.xml
index 6571fd3..1c25aeb 100644
--- a/modules/tm/doc/functions.xml
+++ b/modules/tm/doc/functions.xml
@@ -320,7 +320,7 @@ t_reply("404", "Not found");
<para>
Checks if a transaction exists. Returns a positive value if so,
negative otherwise. Most likely you will not want to use it, as a
- typical application of a looku-up is to introduce a new transaction
+ typical application of a look-up is to introduce a new transaction
if none was found. However this is safely (atomically) done using
<function>t_newtran</function>.
</para>
Module: sip-router
Branch: master
Commit: 247a71839a3112aac26ce0ac27e0507664bfe810
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=247a718…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu Apr 30 19:58:20 2009 +0200
spelling fixes in documentation
---
modules_s/registrar/README | 14 +++++++-------
modules_s/registrar/doc/registrar.xml | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/modules_s/registrar/README b/modules_s/registrar/README
index 102fe58..0bb62ee 100644
--- a/modules_s/registrar/README
+++ b/modules_s/registrar/README
@@ -70,12 +70,12 @@ UA2 ---- NAT2 ----| 5090 |
Registrar and usrloc would store the public IP of NAT with each
registered contact, thus it would know how to reach both user agents.
- In addition to the publi IP and port of the NAT device, registrar would
- also remember the destination IP and port of the REGISTER request (the
- IP and port used in SER). If registrar did not store this information,
- it would not know what outbound socket it should use when sending SIP
- messages to the registered contact. It would use the default port
- number (often 5060) for such outgoing requests.
+ In addition to the public IP and port of the NAT device, registrar
+ would also remember the destination IP and port of the REGISTER request
+ (the IP and port used in SER). If registrar did not store this
+ information, it would not know what outbound socket it should use when
+ sending SIP messages to the registered contact. It would use the
+ default port number (often 5060) for such outgoing requests.
When an INVITE for UA1 comes, everything would work because UA1 used
port 5060 when registering and that is also the destination port in the
@@ -98,7 +98,7 @@ UA1 ---- NAT1 +------ | 5060 | <---------------
UA2 ---- NAT2 X <----+ | 5090 |
+--------+
- That is the reason why registrar and usrloc also need to remmember the
+ That is the reason why registrar and usrloc also need to remember the
IP and port used on the server side, that information would be used
later when forwarding INVITEs:
SER
diff --git a/modules_s/registrar/doc/registrar.xml b/modules_s/registrar/doc/registrar.xml
index da8e93e..b553f0a 100644
--- a/modules_s/registrar/doc/registrar.xml
+++ b/modules_s/registrar/doc/registrar.xml
@@ -72,7 +72,7 @@ UA2 ---- NAT2 ----| 5090 |
agents.
</para>
<para>
- In addition to the publi IP and port of the NAT device, registrar
+ In addition to the public IP and port of the NAT device, registrar
would also remember the destination IP and port of the REGISTER
request (the IP and port used in SER). If registrar did not store
this information, it would not know what outbound socket it should
@@ -111,7 +111,7 @@ UA2 ---- NAT2 X <----+ | 5090 |
]]>
</programlisting>
<para>
- That is the reason why registrar and usrloc also need to remmember
+ That is the reason why registrar and usrloc also need to remember
the IP and port used on the server side, that information would be
used later when forwarding INVITEs:
</para>
Module: sip-router
Branch: master
Commit: a8539942044b15eef743b28380fa25aefaec0721
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a853994…
Author: Henning Westerholt <henning.westerholt(a)1und1.de>
Committer: Henning Westerholt <henning.westerholt(a)1und1.de>
Date: Thu Apr 30 18:58:11 2009 +0200
generate README for the cfg_rpc module
---
modules_s/cfg_rpc/README | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/modules_s/cfg_rpc/README b/modules_s/cfg_rpc/README
new file mode 100644
index 0000000..7e457da
--- /dev/null
+++ b/modules_s/cfg_rpc/README
@@ -0,0 +1,45 @@
+1. cfg_rpc Module
+
+Miklos Tirpak
+
+ <miklos(a)iptel.org>
+
+ Copyright � 2007 iptelorg GmbH
+ __________________________________________________________________
+
+ 1.1. Overview
+ 1.2. RPC Interface
+
+1.1. Overview
+
+ The module implements RPC functions to set and get configuration
+ variables on-the-fly, that are declared by SER core and by the modules.
+ It can be used to fine-tune or debug SER without the need of restart.
+
+1.2. RPC Interface
+
+ The module implements the following RPC interface commands:
+ * cfg_rpc.set_now_int - Set the value of a configuration variable and
+ commit the change immediately. The function accepts three
+ parameters: group name, variable name, integer value.
+ * cfg_rpc.set_now_string - Set the value of a configuration variable
+ and commit the change immediately. The function accepts three
+ parameters: group name, variable name, string value.
+ * cfg_rpc.set_delayed_int - Prepare the change of a configuration
+ variable, but does not commit the new value yet. The function
+ accepts three parameters: group name, variable name, integer value.
+ * cfg_rpc.set_delayed_string - Prepare the change of a configuration
+ variable, but does not commit the new value yet. The function
+ accepts three parameters: group name, variable name, string value.
+ * cfg_rpc.commit - Commit the previously prepared configuration
+ changes. The function does not have any parameters.
+ * cfg_rpc.rollback - Drop the prepared configuration changed. The
+ function does not have any parameters.
+ * cfg_rpc.get - Get the value of a configuration variable. The
+ function accepts two parameters: group name, variable name.
+ * cfg_rpc.help - Print the description of a configuration variable.
+ The function accepts two parameters: group name, variable name.
+ * cfg_rpc.list - List the configuration variables. The function does
+ not have any parameters.
+ * cfg_rpc.diff - List the pending configuration changes that have not
+ been committed yet. The function does not have any parameters.