-
Notifications
You must be signed in to change notification settings - Fork 909
/
pv_admin.xml
1135 lines (1112 loc) · 31.2 KB
/
pv_admin.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
%docentities;
]>
<!-- Module User's Guide -->
<chapter>
<title>&adminguide;</title>
<section>
<title>Overview</title>
<para>
This module collects the core pseudo-variables that can be used in
configuration file. They are listed in wiki: &kamwikilink;
in Pseudo-Variables section
</para>
</section>
<section>
<title>Dependencies</title>
<section>
<title>&kamailio; Modules</title>
<para>
The following modules must be loaded before this module:
<itemizedlist>
<listitem>
<para>
<emphasis>No dependencies on other &kamailio; modules</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
<section>
<title>External Libraries or Applications</title>
<para>
The following libraries or applications must be installed before running
&kamailio; with this module loaded:
<itemizedlist>
<listitem>
<para>
<emphasis>None</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
<section>
<title>Parameters</title>
<section id="pv.p.shvset">
<title><varname>shvset</varname> (string)</title>
<para>
Set the initial value of a shared variable ($shv(name)). The parameter
can be set many times.
</para>
<para>
The value of the parameter has the format:
_name_ '=' _type_ ':' _value_
</para>
<itemizedlist>
<listitem><para>_name_: shared variable name</para></listitem>
<listitem><para>_type_: type of the value</para>
<itemizedlist>
<listitem><para> <quote>i</quote>: integer value </para></listitem>
<listitem><para> <quote>s</quote>: string value </para></listitem>
</itemizedlist>
</listitem>
<listitem><para>_value_: value to be set</para></listitem>
</itemizedlist>
<para>
Note: this is special useful for usage with KEMI scripts, the $shv(...)
variables must be defined during Kamailio initialization in order to
become available in all worker processes.
</para>
<para>
Default value is <quote>NULL</quote>.
</para>
<example>
<title><varname>shvset</varname> parameter usage</title>
<programlisting format="linespecific">
...
modparam("pv", "shvset", "debug=i:1")
modparam("pv", "shvset", "pstngw=s:sip:10.10.10.10")
...
</programlisting>
</example>
</section>
<section id="pv.p.varset">
<title><varname>varset</varname> (string)</title>
<para>
Set the value of a script variable ($var(name)). The parameter
can be set many times.
</para>
<para>
The value of the parameter has the format:
_name_ '=' _type_ ':' _value_
</para>
<itemizedlist>
<listitem><para>_name_: shared variable name</para></listitem>
<listitem><para>_type_: type of the value</para>
<itemizedlist>
<listitem><para> <quote>i</quote>: integer value </para></listitem>
<listitem><para> <quote>s</quote>: string value </para></listitem>
</itemizedlist>
</listitem>
<listitem><para>_value_: value to be set</para></listitem>
</itemizedlist>
<para>
Default value is <quote>NULL</quote>.
</para>
<example>
<title><varname>varset</varname> parameter usage</title>
<programlisting format="linespecific">
...
modparam("pv", "varset", "init=i:1")
modparam("pv", "varset", "gw=s:sip:11.11.11.11;transport=tcp")
...
</programlisting>
</example>
</section>
<section id="pv.p.avp_aliases">
<title><varname>avp_aliases</varname> (string)</title>
<para>
Define aliases for PV AVP names.
</para>
<para>
<emphasis>
Default value is NULL.
</emphasis>
</para>
<example>
<title><varname>avp_aliases</varname> parameter usage</title>
<programlisting format="linespecific">
...
modparam("pv","avp_aliases","email=s:email_addr;tmp=i:100")
...
</programlisting>
</example>
</section>
</section>
<section>
<title>Functions</title>
<section id="pv.f.pv_isset">
<title><function moreinfo="none">pv_isset(pvar)</function></title>
<para>
Return true if a PV value is different than 'null'.
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>pvar</emphasis> - pvar identifier.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>pv_isset</function> usage</title>
<programlisting format="linespecific">
...
if(pv_isset("$avp(s:x)"))
{
...
}
...
</programlisting>
</example>
</section>
<section id="pv.f.pv_unset">
<title><function moreinfo="none">pv_unset(pvar)</function></title>
<para>
Unset the value of the PV (e.g., delete AVP, set to null).
</para>
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem>
<para>
<emphasis>pvar</emphasis> - pvar identifier.
</para>
</listitem>
</itemizedlist>
<para>
This function can be used from ANY_ROUTE.
</para>
<example>
<title><function>pv_unset</function> usage</title>
<programlisting format="linespecific">
...
pv_unset("$avp(s:x)");
...
</programlisting>
</example>
</section>
<section id="pv.f.is_int">
<title>
<function moreinfo="none">is_int(pvar)</function>
</title>
<para>
Function checks if pvar argument contains integer value
and returns 1 if it does and -1 otherwise.
</para>
<para>
Function can be used from all kinds of routes.
</para>
<example>
<title><function>is_int()</function> usage</title>
<programlisting format="linespecific">
...
if (is_int("$var(foo)")) {
xlog("L_INFO", "variable foo contains integer value\n");
}
...
</programlisting>
</example>
</section>
<section id="pv.f.typeof">
<title>
<function moreinfo="none">typeof(pvar, vtype)</function>
</title>
<para>
Returns true if the type of pseudo-variable matches the second
parameter. The second parameter can be: 'int' - type is integer;
'str' - type is string; 'null' - type is null.
</para>
<para>
Function can be used from ANYROUTE.
</para>
<example>
<title><function>typeof()</function> usage</title>
<programlisting format="linespecific">
...
if (typeof("$var(foo)", "str")) {
xdbg("variable foo is a string\n");
}
...
</programlisting>
</example>
</section>
<section id="pv.f.not_empty">
<title>
<function moreinfo="none">not_empty(pvar)</function>
</title>
<para>
Returns true if the pseudo-variables has the type string and
is not empty value.
</para>
<para>
Function can be used from all kinds of routes.
</para>
<example>
<title><function>not_empty()</function> usage</title>
<programlisting format="linespecific">
...
if (not_empty("$var(foo)")) {
append_hf("X-Foo: $var(foo)\r\n");
}
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_copy">
<title>
<function moreinfo="none">xavp_copy(source_name, source_index, destination_name)</function>
</title>
<para>
Copy and append one XAVP.
</para>
<para>
The parameters can be variables or strings.
First parameter is the source XAVP name.
Second parameter is the source XAVP stack index, use 0 to copy the last assigned XAVP.
Third parameter is the destination XAVP name, if found the XAVP will be appended else it will be created.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_copy</function> usage</title>
<programlisting format="linespecific">
...
# Using xavp_copy to reorder an existing xavp stack in a new one
$xavp(a=>x) = "a-0-x";
$xavp(a[0]=>y) = "a-0-y";
$xavp(a=>x) = "a-1-x";
$xavp(a[0]=>y) = "a-1-y";
$xavp(a=>x) = "a-2-x";
$xavp(a[0]=>y) = "a-2-y";
xinfo("BEFORE $xavp(a[0]=>x) == [a-2-x] == $xavp(a[0]=>y) == [a-2-y]\n");
xinfo("BEFORE $xavp(a[1]=>x) == [a-1-x] == $xavp(a[1]=>y) == [a-1-y]\n");
xinfo("BEFORE $xavp(a[2]=>x) == [a-0-x] == $xavp(a[2]=>y) == [a-0-y]\n");
# reorder
$var(source_index) = 1;
$var(destination_name) = "b";
xavp_copy("a", "2", "b");
xavp_copy("a", "$var(source_index)", "$var(destination_name)");
xavp_copy("a", "0", "$var(destination_name)");
xinfo("AFTER $xavp(b[0]=>x) == [a-0-x] == $xavp(b[0]=>y) == [a-0-y]\n");
xinfo("AFTER $xavp(b[1]=>x) == [a-1-x] == $xavp(b[1]=>y) == [a-1-y]\n");
xinfo("AFTER $xavp(b[2]=>x) == [a-2-x] == $xavp(b[2]=>y) == [a-2-y]\n");
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_copy2">
<title>
<function moreinfo="none">xavp_copy(source_name, source_index, destination_name, destination_index)</function>
</title>
<para>
Copy and replace one XAVP.
</para>
<para>
The parameters can be variables or strings.
First parameter is the source XAVP name.
Second parameter is the source XAVP stack index, use 0 to copy the last assigned XAVP.
Third parameter is the destination XAVP name, if not found xavp_copy will return -1.
Fourth parameter is the destination XAVP index, if not found xavp_copy will return -1.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_copy</function> usage</title>
<programlisting format="linespecific">
...
# Using xavp_copy to reorder an existing xavp stack inplace
$xavp(d=>x) = "d-0-x";
$xavp(d[0]=>y) = "d-0-y";
$xavp(d=>x) = "d-1-x";
$xavp(d[0]=>y) = "d-1-y";
$xavp(d=>x) = "d-2-x";
$xavp(d[0]=>y) = "d-2-y";
xinfo("NEW $xavp(d[0]=>x) == [d-2-x] and $xavp(d[0]=>y) == [d-2-y]\n");
xinfo("NEW $xavp(d[1]=>x) == [d-1-x] and $xavp(d[1]=>y) == [d-1-y]\n");
xinfo("NEW $xavp(d[2]=>x) == [d-0-x] and $xavp(d[2]=>y) == [d-0-y]\n");
xavp_copy("d", "0", "e");
xavp_copy("d", "2", "d", "0");
xavp_copy("e", "0", "d", "2");
xinfo("AFTER $xavp(d[0]=>x) == [d-0-x] $xavp(d[0]=>y) == [d-0-y]\n");
xinfo("AFTER $xavp(d[1]=>x) == [d-1-x] $xavp(d[1]=>y) == [d-1-y]\n");
xinfo("AFTER $xavp(d[2]=>x) == [d-2-x] $xavp(d[2]=>y) == [d-2-y]\n");
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_params_explode">
<title>
<function moreinfo="none">xavp_params_explode(sparams, xname)</function>
</title>
<para>
Convert a parameters string in xavp attributes.
</para>
<para>
The first parameter has to be a string in the format of SIP header
parameters (name1=value1;...;nameN=valueN). The second parameter
is the name of the root xavp to hold the pairs (nameX,valueX).
</para>
<para>
The values are stored as string type.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_params_explode</function> usage</title>
<programlisting format="linespecific">
...
xavp_params_explode("a=b;c=d;e=d", "x");
# results in:
# $xavp(x=>a) = "b";
# $xavp(x=>c) = "d";
# $xavp(x=>e) = "f";
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_params_implode">
<title>
<function moreinfo="none">xavp_params_implode(xname, pvname)</function>
</title>
<para>
Serialize the subfields in an XAVP to a parameters string format.
</para>
<para>
Number values are serialized as unsigned integer string format.
</para>
<para>
The first parameter has to be the name of XAVP (only the string
name, not the in $xavp(name)). The second parameter
is the name of output variable (in full name, like $var(output)).
</para>
<para>
The value is stored as string type.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_params_implode</function> usage</title>
<programlisting format="linespecific">
...
$xavp(x=>e) = "f";
$xavp(x[0]=>c) = "d";
$xavp(x[0]=>a) = "b";
xavp_params_implode("x", "$var(out)");
# results in: $var(out) is "a=b;c=d;e=f;"
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_params_implode_qval">
<title>
<function moreinfo="none">xavp_params_implode_qval(xname, pvname)</function>
</title>
<para>
Serialize the subfields in an XAVP to a parameters string format,
enclosing string values in double quotes.
</para>
<para>
Number values are serialized as unsigned integer string format.
</para>
<para>
The first parameter has to be the name of XAVP (only the string
name, not the in $xavp(name)). The second parameter
is the name of output variable (in full name, like $var(output)).
</para>
<para>
The value is stored as string type.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_params_implode_qval</function> usage</title>
<programlisting format="linespecific">
...
$xavp(x=>e) = "f";
$xavp(x[0]=>c) = 5;
$xavp(x[0]=>a) = "b";
xavp_params_implode("x", "$var(out)");
# results in: $var(out) is: a="b";c=5;e="f";
...
</programlisting>
</example>
</section>
<section id="pv.f.xavu_params_explode">
<title>
<function moreinfo="none">xavu_params_explode(sparams, xname)</function>
</title>
<para>
Convert a parameters string in xavu attributes.
</para>
<para>
The first parameter has to be a string in the format of SIP header
parameters (name1=value1;...;nameN=valueN). The second parameter
is the name of the root xavu to hold the pairs (nameX,valueX).
</para>
<para>
The values are stored as string type.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavu_params_explode</function> usage</title>
<programlisting format="linespecific">
...
xavu_params_explode("a=b;c=d;e=d", "x");
# results in:
# $xavu(x=>a) = "b";
# $xavu(x=>c) = "d";
# $xavu(x=>e) = "f";
...
</programlisting>
</example>
</section>
<section id="pv.f.xavu_params_implode">
<title>
<function moreinfo="none">xavu_params_implode(xname, pvname)</function>
</title>
<para>
Serialize the subfields in an XAUP to a parameters string format.
</para>
<para>
Number values are serialized as unsigned integer string format.
</para>
<para>
The first parameter has to be the name of XAVU (only the string
name, not the in $xavu(name)). The second parameter
is the name of output variable (in full name, like $var(output)).
</para>
<para>
The value is stored as string type.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavu_params_implode</function> usage</title>
<programlisting format="linespecific">
...
$xavu(x=>e) = "f";
$xavu(x=>c) = "d";
$xavu(x=>a) = "b";
xavu_params_implode("x", "$var(out)");
# results in: $var(out) is "a=b;c=d;e=f;"
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_slist_explode">
<title>
<function moreinfo="none">xavp_slist_explode(slist, sep, mode, xname)</function>
</title>
<para>
Breaks a string list in tokens by separators and stores them
in XAVPs. Note that is not storing empty values.
</para>
<para>
The first parameter has to be a string (static or with variables).
</para>
<para>
The second parameter has to contain separator characters (they
can be many).
</para>
<para>
The third parameter is mode, controlling the behaviour of extracting
the tokens, the supported mode right now is 't', which trims
the white spaces around the value.
</para>
<para>
The fourth parameter is the name of the root xavp to hold the tokens
in fields named 'v' and indexed from 0.
</para>
<para>
The values are stored as string type.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_slist_explode</function> usage</title>
<programlisting format="linespecific">
...
xavp_slist_explode("a=b; c=d;", "=;", "t", "x");
# results in:
# $xavp(x[0]=>v[0]) = "a";
# $xavp(x[0]=>v[1]) = "b";
# $xavp(x[0]=>v[2]) = "c";
# $xavp(x[0]=>v[3]) = "d";
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_child_seti">
<title>
<function moreinfo="none">xavp_child_seti(rname, cname, ival)</function>
</title>
<para>
Set the value of $xavp(rname=>cname) to integer value ival.
</para>
<para>
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.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_child_seti</function> usage</title>
<programlisting format="linespecific">
...
$var(n) = 10;
xavp_child_seti("x", "y", "$var(n)");
# results in: $xavp(x=>y) is 10
...
</programlisting>
</example>
</section>
<section id="pv.f.xavi_child_seti">
<title>
<function moreinfo="none">xavi_child_seti(rname, cname, ival)</function>
</title>
<para>
Set the value of $xavi(rname=>cname) to integer value ival.
</para>
<para>
The first parameter has to be the name of XAVI in the root list.
The second parameter name of child XAVI. The third parameter
can be an integer number or a variable holding an integer.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavi_child_seti</function> usage</title>
<programlisting format="linespecific">
...
$var(n) = 10;
xavi_child_seti("WhatEver", "FoO", "$var(n)");
# results in: $xavi(whatever=>foo) is 10
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_child_sets">
<title>
<function moreinfo="none">xavp_child_sets(rname, cname, sval)</function>
</title>
<para>
Set the value of $xavp(rname=>cname) to string value sval.
</para>
<para>
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.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_child_sets</function> usage</title>
<programlisting format="linespecific">
...
$var(n) = 10;
xavp_child_sets("x", "y", "Count: $var(n)");
# results in: $xavp(x=>y) is "Count: 10"
...
</programlisting>
</example>
</section>
<section id="pv.f.xavi_child_sets">
<title>
<function moreinfo="none">xavi_child_sets(rname, cname, sval)</function>
</title>
<para>
Set the value of $xavi(rname=>cname) to string value sval.
</para>
<para>
The first parameter has to be the name of XAVI in the root list.
The second parameter name of child XAVI. The third parameter
can be a static or dynamic (with variables) string.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavi_child_sets</function> usage</title>
<programlisting format="linespecific">
...
$var(n) = 10;
xavi_child_sets("WhatEver", "FoO", "Count: $var(n)");
# results in: $xavi(whatever=>foo) is "Count: 10"
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_rm">
<title>
<function moreinfo="none">xavp_rm(rname)</function>
</title>
<para>
Remove the value of $xavp(rname).
</para>
<para>
The parameter has to be the name of XAVP in the root list.
It can be static or dynamic string (to include variables).
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_rm</function> usage</title>
<programlisting format="linespecific">
...
xavp_rm("x");
# same result as: $xavp(x) = $null;
...
</programlisting>
</example>
</section>
<section id="pv.f.xavi_rm">
<title>
<function moreinfo="none">xavi_rm(rname)</function>
</title>
<para>
Remove the value of $xavi(rname).
</para>
<para>
The parameter has to be the name of XAVI in the root list.
It can be static or dynamic string (to include variables).
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavi_rm</function> usage</title>
<programlisting format="linespecific">
...
xavi_rm("WhatEver");
# same result as: $xavi(whatever) = $null;
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_child_rm">
<title>
<function moreinfo="none">xavp_child_rm(rname, cname)</function>
</title>
<para>
Remove the value of $xavp(rname=>cname).
</para>
<para>
The first parameter has to be the name of XAVP in the root list.
The second parameter name of child XAVP. Both parameters can be
static or dynamic strings (to include variables).
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_child_rm</function> usage</title>
<programlisting format="linespecific">
...
xavp_child_rm("x", "y");
# same result as: $xavp(x=>y) = $null;
...
</programlisting>
</example>
</section>
<section id="pv.f.xavi_child_rm">
<title>
<function moreinfo="none">xavi_child_rm(rname, cname)</function>
</title>
<para>
Remove the value of $xavi(rname=>cname).
</para>
<para>
The first parameter has to be the name of XAVI in the root list.
The second parameter name of child XAVI. Both parameters can be
static or dynamic strings (to include variables).
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavi_child_rm</function> usage</title>
<programlisting format="linespecific">
...
xavi_child_rm("WhatEver", "FoO");
# same result as: $xavi(whatever=>foo) = $null;
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_lshift">
<title>
<function moreinfo="none">xavp_lshift(xname, idx)</function>
</title>
<para>
Left shift with rotation of the xavps with name xname so that
the one at the index idx becomes the first and the ones before
it are at the end of the list.
</para>
<para>
The first parameter has to be the name of XAVP in the root list.
</para>
<para>
The second parameter is the index of the XAVP that becomes the
first one (if it is greater than the number of XAVPs, modulo
operation is done first; if it is negative, it counts from the
end of the list).
</para>
<para>
The parameters can be with variables.
</para>
<para>
Function can be used from ANY ROUTE.
</para>
<example>
<title><function>xavp_lshift</function> usage</title>
<programlisting format="linespecific">
...
$xavp(n) = 10;
$xavp(n) = 20;
$xavp(n) = 30;
xavp_lshift("n", "1");
# results in: $xavp(n) having the list of values 20 30 10
...
</programlisting>
</example>
</section>
<section id="pv.f.xavp_push_dst">
<title>
<function moreinfo="none">xavp_push_dst(xname)</function>
</title>
<para>
Set destination fields from XAVP attributes.
</para>
<para>
The first parameter has to be the name of XAVP in the root list.
</para>
<para>
The parameters can be with variables.
</para>
<para>
The attributes that can be stored in the XAVP fields:
</para>
<itemizedlist>
<listitem>
<para>uri: SIP URI address to set R-URI</para>
</listitem>
<listitem>
<para>dsturi: SIP URI address to set DST-URI</para>
</listitem>
<listitem>
<para>socket: listen address to set outgoing socket</para>
</listitem>
</itemizedlist>
<para>
Function can be used from REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE.
</para>
<example>
<title><function>xavp_push_dst</function> usage</title>
<programlisting format="linespecific">
...
$xavp(dst=>uri) = "sip:alice@server.com";
$xavp(dst[0]=>dsturi) = "sip:proxy.com";
$xavp(dst[0]=>socket) = "udp:1.2.3.4:5060";
xavp_push_dst("dst");
...
</programlisting>
</example>
</section>
<section id="pv.f.sbranch_set_ruri">
<title>
<function moreinfo="none">sbranch_set_ruri()</function>
</title>
<para>
Use the attributes from static branch ($sbranch(key) variable) to
set request URI and the other fields of the branch associated with
request URI (destination URI, path, ...).
</para>
<para>
Content of the static branch is not reset after this function is
executed. It has to be done explicitly with sbranch_reset().
</para>
<para>
Function can be used from REQUEST_ROUTE, BRANCH_ROUTE or FAILURE_ROUTE.
</para>
<example>
<title><function>sbranch_set_ruri()</function> usage</title>
<programlisting format="linespecific">
...
sbranch_reset();
$sbranch(uri) = "sip:127.0.0.1:5080";
$sbranch(dst_uri) = "sip:127.0.0.1:5090";
$sbranch(path) = "sip:127.0.0.1:5090, sip:127.0.0.1:5094";
$sbranch(send_socket) = "udp:127.0.0.1:5060";
sbranch_set_ruri();
...
</programlisting>
</example>
</section>
<section id="pv.f.sbranch_append">
<title>
<function moreinfo="none">sbranch_append()</function>
</title>
<para>
Use the attributes from static branch ($sbranch(key) variable) to
append a new branch to destination set. It is an alternative to
append_branch() that allows setting each attribute specific to
the branch.
</para>
<para>
Content of the static branch is not reset after this function is
executed. It has to be done explicitly with sbranch_reset().
</para>
<para>
Function can be used from REQUEST_ROUTE, BRANCH_ROUTE or FAILURE_ROUTE.
</para>
<example>
<title><function>sbranch_append()</function> usage</title>
<programlisting format="linespecific">
...
sbranch_reset();
$sbranch(uri) = "sip:127.0.0.1:5080";
$sbranch(dst_uri) = "sip:127.0.0.1:5090";
$sbranch(send_socket) = "udp:127.0.0.1:5060";
sbranch_append();
...
</programlisting>
</example>
</section>
<section id="pv.f.sbranch_reset">
<title>
<function moreinfo="none">sbranch_reset()</function>
</title>
<para>
Reset the content of static branch ($sbranch(key) variable.
</para>
<para>
Function can be used from REQUEST_ROUTE, BRANCH_ROUTE or FAILURE_ROUTE.
</para>
<example>
<title><function>sbranch_append()</function> usage</title>
<programlisting format="linespecific">
...
sbranch_reset();
...
</programlisting>
</example>
</section>
<section id="pv.f.pv_xavp_print">
<title>
<function moreinfo="none">pv_xavp_print()</function>
</title>
<para>
Print all XAVPs to the syslog using INFO log level.
</para>
<para>
Function can be used from ANY_ROUTE.
</para>
<example>
<title><function>pv_xavp_print()</function> usage</title>
<programlisting format="linespecific">
...
pv_xavp_print();
...
</programlisting>
</example>
</section>
<section id="pv.f.pv_xavu_print">
<title>
<function moreinfo="none">pv_xavu_print()</function>
</title>
<para>
Print all XAVUs to the syslog using INFO log level.
</para>
<para>
Function can be used from ANY_ROUTE.
</para>
<example>
<title><function>pv_xavu_print()</function> usage</title>
<programlisting format="linespecific">
...
pv_xavu_print();
...
</programlisting>
</example>
</section>
<section id="pv.f.pv_xavi_print">
<title>
<function moreinfo="none">pv_xavi_print()</function>
</title>
<para>
Print all XAVIs to the syslog using INFO log level.
</para>
<para>
Function can be used from ANY_ROUTE.
</para>
<example>
<title><function>pv_xavi_print()</function> usage</title>
<programlisting format="linespecific">
...
pv_xavi_print();
...
</programlisting>
</example>
</section>
<section id="pv.f.pv_var_to_xavp">
<title>
<function moreinfo="none">pv_var_to_xavp(varname, xname)</function>
</title>
<para>
Copy the script variable value into an xavp.
</para>
<para>
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.
</para>