Browse code

pv: refresh README

Victor Seva authored on 31/08/2015 09:19:12
Showing 1 changed files
... ...
@@ -11,11 +11,11 @@ Daniel-Constantin Mierla
11 11
 
12 12
    <daniel@asipto.com>
13 13
 
14
-   Copyright � 2008-2011 Daniel-Constantin Mierla (asipto.com)
14
+   Copyright (c) 2008-2011 Daniel-Constantin Mierla (asipto.com)
15 15
 
16
-   Copyright � 2011 Juha Heinanen
16
+   Copyright (c) 2011 Juha Heinanen
17 17
 
18
-   Copyright � 2013 Olle E. Johansson, Edvina AB
18
+   Copyright (c) 2013 Olle E. Johansson, Edvina AB
19 19
      __________________________________________________________________
20 20
 
21 21
    Table of Contents
... ...
@@ -46,6 +46,7 @@ Daniel-Constantin Mierla
46 46
               4.8. sbranch_append()
47 47
               4.9. sbranch_reset()
48 48
               4.10. pv_xavp_print()
49
+              4.11. pv_var_to_xavp(varname, xname)
49 50
 
50 51
         5. MI Commands
51 52
 
... ...
@@ -72,8 +73,9 @@ Daniel-Constantin Mierla
72 73
    1.11. sbranch_append() usage
73 74
    1.12. sbranch_append() usage
74 75
    1.13. pv_xavp_print() usage
75
-   1.14. shv_set usage
76
-   1.15. shv_get usage
76
+   1.14. pv_var_to_xavp() usage
77
+   1.15. shv_set usage
78
+   1.16. shv_get usage
77 79
 
78 80
 Chapter 1. Admin Guide
79 81
 
... ...
@@ -103,6 +105,7 @@ Chapter 1. Admin Guide
103 105
         4.8. sbranch_append()
104 106
         4.9. sbranch_reset()
105 107
         4.10. pv_xavp_print()
108
+        4.11. pv_var_to_xavp(varname, xname)
106 109
 
107 110
    5. MI Commands
108 111
 
... ...
@@ -207,6 +210,7 @@ modparam("pv","avp_aliases","email=s:email_addr;tmp=i:100")
207 210
    4.8. sbranch_append()
208 211
    4.9. sbranch_reset()
209 212
    4.10. pv_xavp_print()
213
+   4.11. pv_var_to_xavp(varname, xname)
210 214
 
211 215
 4.1. pv_isset(pvar)
212 216
 
... ...
@@ -239,7 +243,7 @@ if(pv_isset("$avp(s:x)"))
239 243
 pv_unset("$avp(s:x)");
240 244
 ...
241 245
 
242
-4.3. is_int(pvar)
246
+4.3.  is_int(pvar)
243 247
 
244 248
    Function checks if pvar argument contains integer value and returns 1
245 249
    if it does and -1 otherwise.
... ...
@@ -253,7 +257,7 @@ if (is_int("$var(foo)")) {
253 257
 }
254 258
 ...
255 259
 
256
-4.4. typeof(pvar, vtype)
260
+4.4.  typeof(pvar, vtype)
257 261
 
258 262
    Returns true if the type of pseudo-variable matches the second
259 263
    parameter. The second parameter can be: 'int' - type is integer; 'str'
... ...
@@ -268,7 +272,7 @@ if (typeof("$var(foo)", "str")) {
268 272
 }
269 273
 ...
270 274
 
271
-4.5. not_empty(pvar)
275
+4.5.  not_empty(pvar)
272 276
 
273 277
    Returns true if the pseudo-variables has the type string and is not
274 278
    empty value.
... ...
@@ -282,7 +286,7 @@ if (not_empty("$var(foo)")) {
282 286
 }
283 287
 ...
284 288
 
285
-4.6. xavp_params_explode(sparams, xname)
289
+4.6.  xavp_params_explode(sparams, xname)
286 290
 
287 291
    Convert a parameters string in xavp atributes.
288 292
 
... ...
@@ -303,7 +307,7 @@ xavp_params_explode("a=b;c=d;e=d", "x");
303 307
 #    $xavp(x=>e) = "f";
304 308
 ...
305 309
 
306
-4.7. sbranch_set_ruri()
310
+4.7.  sbranch_set_ruri()
307 311
 
308 312
    Use the attributes from static branch ($sbranch(key) variable) to set
309 313
    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";
324 328
 sbranch_set_ruri();
325 329
 ...
326 330
 
327
-4.8. sbranch_append()
331
+4.8.  sbranch_append()
328 332
 
329 333
    Use the attributes from static branch ($sbranch(key) variable) to
330 334
    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";
345 349
 sbranch_append();
346 350
 ...
347 351
 
348
-4.9. sbranch_reset()
352
+4.9.  sbranch_reset()
349 353
 
350 354
    Reset the content of static branch ($sbranch(key) variable.
351 355
 
... ...
@@ -356,7 +360,7 @@ sbranch_append();
356 360
 sbranch_reset();
357 361
 ...
358 362
 
359
-4.10. pv_xavp_print()
363
+4.10.  pv_xavp_print()
360 364
 
361 365
    Print all XAVPs to the syslog using INFO log level.
362 366
 
... ...
@@ -367,6 +371,30 @@ sbranch_reset();
367 371
 pv_xavp_print();
368 372
 ...
369 373
 
374
+4.11.  pv_var_to_xavp(varname, xname)
375
+
376
+   Copy script variables values to a xavp.
377
+
378
+   First parameter can be '*' in order to copy all script variables.
379
+   Second parameter is the name of the destination xavp. If xavp already
380
+   exists it will be reset first.
381
+
382
+   Function can be used from ANY_ROUTE.
383
+
384
+   Example 1.14. pv_var_to_xavp() usage
385
+...
386
+$var("temp") = 3;
387
+$var("foo") = "foo indeed";
388
+pv_var_to_xavp("temp", "ok");
389
+...
390
+$xavp("ok[0]=>temp") now is 3
391
+...
392
+pv_var_to_xavp("*", "ok");
393
+...
394
+$xavp("ok[0]=>temp") now is 3
395
+$xavp("ok[0]=>foo") now is "foo indeed"
396
+...
397
+
370 398
 5. MI Commands
371 399
 
372 400
    5.1. shv_set
... ...
@@ -390,7 +418,7 @@ pv_xavp_print();
390 418
                 _value_
391 419
                 _empty_line_
392 420
 
393
-   Example 1.14. shv_set usage
421
+   Example 1.15. shv_set usage
394 422
 ...
395 423
 $ kamctl fifo shv_set debug int 0
396 424
 ...
... ...
@@ -408,7 +436,7 @@ $ kamctl fifo shv_set debug int 0
408 436
                 _name_
409 437
                 _empty_line_
410 438
 
411
-   Example 1.15. shv_get usage
439
+   Example 1.16. shv_get usage
412 440
 ...
413 441
 $ kamctl fifo shv_get debug
414 442
 $ kamctl fifo shv_get