diff --git a/src/modules/pv/README b/src/modules/pv/README index 71e4ac3af31..a43c8a2552c 100644 --- a/src/modules/pv/README +++ b/src/modules/pv/README @@ -43,13 +43,15 @@ Daniel-Constantin Mierla 4.5. not_empty(pvar) 4.6. xavp_params_explode(sparams, xname) 4.7. xavp_params_implode(xname, pvname) - 4.8. sbranch_set_ruri() - 4.9. sbranch_append() - 4.10. sbranch_reset() - 4.11. pv_xavp_print() - 4.12. pv_var_to_xavp(varname, xname) - 4.13. pv_xavp_to_var(xname) - 4.14. pv_evalx(dst, fmt) + 4.8. xavp_set_child_ival(rname, cname, ival) + 4.9. xavp_set_child_sval(rname, cname, sval) + 4.10. sbranch_set_ruri() + 4.11. sbranch_append() + 4.12. sbranch_reset() + 4.13. pv_xavp_print() + 4.14. pv_var_to_xavp(varname, xname) + 4.15. pv_xavp_to_var(xname) + 4.16. pv_evalx(dst, fmt) 5. RPC Commands @@ -68,15 +70,17 @@ Daniel-Constantin Mierla 1.8. not_empty() usage 1.9. xavp_params_explode usage 1.10. xavp_params_implode usage - 1.11. sbranch_set_ruri() usage - 1.12. sbranch_append() usage - 1.13. sbranch_append() usage - 1.14. pv_xavp_print() usage - 1.15. pv_var_to_xavp() usage - 1.16. pv_xavp_to_var() usage - 1.17. pv_xavp_to_var() usage - 1.18. pv.shvSet usage - 1.19. pv.shvGet usage + 1.11. xavp_set_child_ival usage + 1.12. xavp_set_child_sval usage + 1.13. sbranch_set_ruri() usage + 1.14. sbranch_append() usage + 1.15. sbranch_append() usage + 1.16. pv_xavp_print() usage + 1.17. pv_var_to_xavp() usage + 1.18. pv_xavp_to_var() usage + 1.19. pv_xavp_to_var() usage + 1.20. pv.shvSet usage + 1.21. pv.shvGet usage Chapter 1. Admin Guide @@ -103,13 +107,15 @@ Chapter 1. Admin Guide 4.5. not_empty(pvar) 4.6. xavp_params_explode(sparams, xname) 4.7. xavp_params_implode(xname, pvname) - 4.8. sbranch_set_ruri() - 4.9. sbranch_append() - 4.10. sbranch_reset() - 4.11. pv_xavp_print() - 4.12. pv_var_to_xavp(varname, xname) - 4.13. pv_xavp_to_var(xname) - 4.14. pv_evalx(dst, fmt) + 4.8. xavp_set_child_ival(rname, cname, ival) + 4.9. xavp_set_child_sval(rname, cname, sval) + 4.10. sbranch_set_ruri() + 4.11. sbranch_append() + 4.12. sbranch_reset() + 4.13. pv_xavp_print() + 4.14. pv_var_to_xavp(varname, xname) + 4.15. pv_xavp_to_var(xname) + 4.16. pv_evalx(dst, fmt) 5. RPC Commands @@ -206,13 +212,15 @@ modparam("pv","avp_aliases","email=s:email_addr;tmp=i:100") 4.5. not_empty(pvar) 4.6. xavp_params_explode(sparams, xname) 4.7. xavp_params_implode(xname, pvname) - 4.8. sbranch_set_ruri() - 4.9. sbranch_append() - 4.10. sbranch_reset() - 4.11. pv_xavp_print() - 4.12. pv_var_to_xavp(varname, xname) - 4.13. pv_xavp_to_var(xname) - 4.14. pv_evalx(dst, fmt) + 4.8. xavp_set_child_ival(rname, cname, ival) + 4.9. xavp_set_child_sval(rname, cname, sval) + 4.10. sbranch_set_ruri() + 4.11. sbranch_append() + 4.12. sbranch_reset() + 4.13. pv_xavp_print() + 4.14. pv_var_to_xavp(varname, xname) + 4.15. pv_xavp_to_var(xname) + 4.16. pv_evalx(dst, fmt) 4.1. pv_isset(pvar) @@ -330,7 +338,41 @@ xavp_params_implode("x", "$var(out)"); # results in: $var(out) is "a=b;c=d;e=f;" ... -4.8. sbranch_set_ruri() +4.8. xavp_set_child_ival(rname, cname, ival) + + Set the value of $xavp(rname=>cname) to integer value ival. + + The first parameter has to be the name of XAVP in the root list. The + second parameter name of child XAVP. The third parameter can be an + integer number or a variable holding an integer. + + Function can be used from ANY ROUTE. + + Example 1.11. xavp_set_child_ival usage +... +$var(n) = 10; +xavp_set_child_ival("x", "y", "$var(n)"); +# results in: $xavp(x=>y) is 10 +... + +4.9. xavp_set_child_sval(rname, cname, sval) + + Set the value of $xavp(rname=>cname) to string value sval. + + The first parameter has to be the name of XAVP in the root list. The + second parameter name of child XAVP. The third parameter can be a + static or dynamic (with variables) string. + + Function can be used from ANY ROUTE. + + Example 1.12. xavp_set_child_sval usage +... +$var(n) = 10; +xavp_set_child_sval("x", "y", "Count: $var(n)"); +# results in: $xavp(x=>y) is "Count: 10" +... + +4.10. sbranch_set_ruri() Use the attributes from static branch ($sbranch(key) variable) to set request URI and the other fields of the branch associated with request @@ -341,7 +383,7 @@ xavp_params_implode("x", "$var(out)"); Function can be used from REQUEST_ROUTE, BRANCH_ROUTE or FAILURE_ROUTE. - Example 1.11. sbranch_set_ruri() usage + Example 1.13. sbranch_set_ruri() usage ... sbranch_reset(); $sbranch(uri) = "sip:127.0.0.1:5080"; @@ -351,7 +393,7 @@ $sbranch(send_socket) = "udp:127.0.0.1:5060"; sbranch_set_ruri(); ... -4.9. sbranch_append() +4.11. sbranch_append() Use the attributes from static branch ($sbranch(key) variable) to append a new branch to destination set. It is an alternative to @@ -363,7 +405,7 @@ sbranch_set_ruri(); Function can be used from REQUEST_ROUTE, BRANCH_ROUTE or FAILURE_ROUTE. - Example 1.12. sbranch_append() usage + Example 1.14. sbranch_append() usage ... sbranch_reset(); $sbranch(uri) = "sip:127.0.0.1:5080"; @@ -372,29 +414,29 @@ $sbranch(send_socket) = "udp:127.0.0.1:5060"; sbranch_append(); ... -4.10. sbranch_reset() +4.12. sbranch_reset() Reset the content of static branch ($sbranch(key) variable. Function can be used from REQUEST_ROUTE, BRANCH_ROUTE or FAILURE_ROUTE. - Example 1.13. sbranch_append() usage + Example 1.15. sbranch_append() usage ... sbranch_reset(); ... -4.11. pv_xavp_print() +4.13. pv_xavp_print() Print all XAVPs to the syslog using INFO log level. Function can be used from ANY_ROUTE. - Example 1.14. pv_xavp_print() usage + Example 1.16. pv_xavp_print() usage ... pv_xavp_print(); ... -4.12. pv_var_to_xavp(varname, xname) +4.14. pv_var_to_xavp(varname, xname) Copy the script variable value into an xavp. @@ -406,7 +448,7 @@ pv_xavp_print(); Function can be used from ANY_ROUTE. - Example 1.15. pv_var_to_xavp() usage + Example 1.17. pv_var_to_xavp() usage ... $var("temp") = 3; $var("foo") = "foo indeed"; @@ -420,7 +462,7 @@ $xavp("ok[0]=>temp") now is 3 $xavp("ok[0]=>foo") now is "foo indeed" ... -4.13. pv_xavp_to_var(xname) +4.15. pv_xavp_to_var(xname) Copy xavp values into vars. Reverse of pv_var_to_xavp(). @@ -428,7 +470,7 @@ $xavp("ok[0]=>foo") now is "foo indeed" Function can be used from ANY_ROUTE. - Example 1.16. pv_xavp_to_var() usage + Example 1.18. pv_xavp_to_var() usage ... $xavp("bar=>temp") = 3; $xavp("bar[0]=>foo") = "foo indeed"; @@ -438,7 +480,7 @@ $var("temp") now is 3 $var("foo") now is "foo indeed" ... -4.14. pv_evalx(dst, fmt) +4.16. pv_evalx(dst, fmt) The fmt string is evaluated twice for exiting variables, the result is stored in dst variable. The dst must be the name of a writable @@ -447,7 +489,7 @@ $var("foo") now is "foo indeed" Function can be used from ANY_ROUTE. - Example 1.17. pv_xavp_to_var() usage + Example 1.19. pv_xavp_to_var() usage ... $var(x) = "test"; $var(y) = "$var(x)" @@ -472,7 +514,7 @@ pv_evalx("$var(z)", "$var(y) one"); + “str”: string value * _value_: value to be set - Example 1.18. pv.shvSet usage + Example 1.20. pv.shvSet usage ... $ kamcmd pv.shvSet debug int 3 ... @@ -486,7 +528,7 @@ $ kamcmd pv.shvSet debug int 3 If no name is given, all shared variables are listed. - Example 1.19. pv.shvGet usage + Example 1.21. pv.shvGet usage ... $ kamcmd pv.shvGet debug ...