Browse Source

kamailio-kemi-framework: docs for KSR.pv.getvn(...) and KSR.pv.getvs(...)

Daniel-Constantin Mierla 7 years ago
parent
commit
bb3e9b9ed1
2 changed files with 27 additions and 1 deletions
  1. 1 1
      kamailio-kemi-framework/docs/kemi.md
  2. 26 0
      kamailio-kemi-framework/docs/kemimods.md

+ 1 - 1
kamailio-kemi-framework/docs/kemi.md

@@ -473,7 +473,7 @@ The bool return code is expected to be evaluated as `true` or `false` inside the
 
 
 If a function has `void` as return type in the signature, the it doesn't return any value.
 If a function has `void` as return type in the signature, the it doesn't return any value.
 
 
-Few functions may return a string value.
+Few functions may return a string value, for example in the `KSR.pv` submodule to get the value of pseudo-variables.
 
 
 The convention for the parameters in the signature of the functions is to enclose in double quotes if the parameter
 The convention for the parameters in the signature of the functions is to enclose in double quotes if the parameter
 has a string type and no quotes if the parameter has integer type.
 has a string type and no quotes if the parameter has integer type.

+ 26 - 0
kamailio-kemi-framework/docs/kemimods.md

@@ -40,6 +40,32 @@ Example:
 KSR.dbg("avp is: " + KSR.pv.gete("$avp(x)") + "\n");
 KSR.dbg("avp is: " + KSR.pv.gete("$avp(x)") + "\n");
 ```
 ```
 
 
+### KSR.pv.getvn(...) ###
+
+`val KSR.pv.getvn(str "pvname", int vn)`
+
+Return the value of pseudo-variable `pvname` if it is different than `$null` or the parameter `vn`
+if the variable is having the `$null` value.
+
+Example:
+
+```
+KSR.dbg("avp is: " + KSR.pv.getvn("$avp(x)", 0) + "\n");
+```
+
+### KSR.pv.getvs(...) ###
+
+`val KSR.pv.getvs(str "pvname", int vn)`
+
+Return the value of pseudo-variable `pvname` if it is different than `$null` or the parameter `vs`
+if the variable is having the `$null` value.
+
+Example:
+
+```
+KSR.dbg("avp is: " + KSR.pv.getvs("$avp(x)", "foo") + "\n");
+```
+
 ### KSR.pv.getw(...) ###
 ### KSR.pv.getw(...) ###
 
 
 `val KSR.pv.getw("pvname")`
 `val KSR.pv.getw("pvname")`