浏览代码

pv: refresh README

Victor Seva 10 年之前
父节点
当前提交
06f684eb3c
共有 1 个文件被更改,包括 43 次插入15 次删除
  1. 43 15
      modules/pv/README

+ 43 - 15
modules/pv/README

@@ -11,11 +11,11 @@ Daniel-Constantin Mierla
 
    <[email protected]>
 
-   Copyright © 2008-2011 Daniel-Constantin Mierla (asipto.com)
+   Copyright (c) 2008-2011 Daniel-Constantin Mierla (asipto.com)
 
-   Copyright © 2011 Juha Heinanen
+   Copyright (c) 2011 Juha Heinanen
 
-   Copyright © 2013 Olle E. Johansson, Edvina AB
+   Copyright (c) 2013 Olle E. Johansson, Edvina AB
      __________________________________________________________________
 
    Table of Contents
@@ -46,6 +46,7 @@ Daniel-Constantin Mierla
               4.8. sbranch_append()
               4.9. sbranch_reset()
               4.10. pv_xavp_print()
+              4.11. pv_var_to_xavp(varname, xname)
 
         5. MI Commands
 
@@ -72,8 +73,9 @@ Daniel-Constantin Mierla
    1.11. sbranch_append() usage
    1.12. sbranch_append() usage
    1.13. pv_xavp_print() usage
-   1.14. shv_set usage
-   1.15. shv_get usage
+   1.14. pv_var_to_xavp() usage
+   1.15. shv_set usage
+   1.16. shv_get usage
 
 Chapter 1. Admin Guide
 
@@ -103,6 +105,7 @@ Chapter 1. Admin Guide
         4.8. sbranch_append()
         4.9. sbranch_reset()
         4.10. pv_xavp_print()
+        4.11. pv_var_to_xavp(varname, xname)
 
    5. MI Commands
 
@@ -207,6 +210,7 @@ modparam("pv","avp_aliases","email=s:email_addr;tmp=i:100")
    4.8. sbranch_append()
    4.9. sbranch_reset()
    4.10. pv_xavp_print()
+   4.11. pv_var_to_xavp(varname, xname)
 
 4.1. pv_isset(pvar)
 
@@ -239,7 +243,7 @@ if(pv_isset("$avp(s:x)"))
 pv_unset("$avp(s:x)");
 ...
 
-4.3. is_int(pvar)
+4.3.  is_int(pvar)
 
    Function checks if pvar argument contains integer value and returns 1
    if it does and -1 otherwise.
@@ -253,7 +257,7 @@ if (is_int("$var(foo)")) {
 }
 ...
 
-4.4. typeof(pvar, vtype)
+4.4.  typeof(pvar, vtype)
 
    Returns true if the type of pseudo-variable matches the second
    parameter. The second parameter can be: 'int' - type is integer; 'str'
@@ -268,7 +272,7 @@ if (typeof("$var(foo)", "str")) {
 }
 ...
 
-4.5. not_empty(pvar)
+4.5.  not_empty(pvar)
 
    Returns true if the pseudo-variables has the type string and is not
    empty value.
@@ -282,7 +286,7 @@ if (not_empty("$var(foo)")) {
 }
 ...
 
-4.6. xavp_params_explode(sparams, xname)
+4.6.  xavp_params_explode(sparams, xname)
 
    Convert a parameters string in xavp atributes.
 
@@ -303,7 +307,7 @@ xavp_params_explode("a=b;c=d;e=d", "x");
 #    $xavp(x=>e) = "f";
 ...
 
-4.7. sbranch_set_ruri()
+4.7.  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
@@ -324,7 +328,7 @@ $sbranch(send_socket) =  "udp:127.0.0.1:5060";
 sbranch_set_ruri();
 ...
 
-4.8. sbranch_append()
+4.8.  sbranch_append()
 
    Use the attributes from static branch ($sbranch(key) variable) to
    append a new branch to destination set. It is an alternative to
@@ -345,7 +349,7 @@ $sbranch(send_socket) =  "udp:127.0.0.1:5060";
 sbranch_append();
 ...
 
-4.9. sbranch_reset()
+4.9.  sbranch_reset()
 
    Reset the content of static branch ($sbranch(key) variable.
 
@@ -356,7 +360,7 @@ sbranch_append();
 sbranch_reset();
 ...
 
-4.10. pv_xavp_print()
+4.10.  pv_xavp_print()
 
    Print all XAVPs to the syslog using INFO log level.
 
@@ -367,6 +371,30 @@ sbranch_reset();
 pv_xavp_print();
 ...
 
+4.11.  pv_var_to_xavp(varname, xname)
+
+   Copy script variables values to a xavp.
+
+   First parameter can be '*' in order to copy all script variables.
+   Second parameter is the name of the destination xavp. If xavp already
+   exists it will be reset first.
+
+   Function can be used from ANY_ROUTE.
+
+   Example 1.14. pv_var_to_xavp() usage
+...
+$var("temp") = 3;
+$var("foo") = "foo indeed";
+pv_var_to_xavp("temp", "ok");
+...
+$xavp("ok[0]=>temp") now is 3
+...
+pv_var_to_xavp("*", "ok");
+...
+$xavp("ok[0]=>temp") now is 3
+$xavp("ok[0]=>foo") now is "foo indeed"
+...
+
 5. MI Commands
 
    5.1. shv_set
@@ -390,7 +418,7 @@ pv_xavp_print();
                 _value_
                 _empty_line_
 
-   Example 1.14. shv_set usage
+   Example 1.15. shv_set usage
 ...
 $ kamctl fifo shv_set debug int 0
 ...
@@ -408,7 +436,7 @@ $ kamctl fifo shv_set debug int 0
                 _name_
                 _empty_line_
 
-   Example 1.15. shv_get usage
+   Example 1.16. shv_get usage
 ...
 $ kamctl fifo shv_get debug
 $ kamctl fifo shv_get