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: 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.