This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
cookbooks:5.3.x:pseudovariables [2020/04/02 21:28] miconda [$xavp(id) - XAVPs] |
cookbooks:5.3.x:pseudovariables [2020/04/02 21:35] miconda [$xavp(id) - XAVPs] |
||
---|---|---|---|
Line 724: | Line 724: | ||
**xavp** - eXtended AVPs - are variables that can store multiple values, which can also be grouped in a structure-like fashion. Their value can be a string, an integer number or a list of named values. | **xavp** - eXtended AVPs - are variables that can store multiple values, which can also be grouped in a structure-like fashion. Their value can be a string, an integer number or a list of named values. | ||
- | They work like a stack, similar to AVPs, and are attached to SIP transactions. Each xavp has a name and can contain | + | They work like a stack, similar to AVPs, and are attached to SIP transactions |
+ | |||
+ | Each xavp has a string | ||
+ | |||
+ | To assign a single value use: | ||
+ | |||
+ | <code c> | ||
+ | $xavp(root)=" | ||
+ | $xavp(root)=intnumber; | ||
+ | </ | ||
+ | |||
+ | To assign a named value use: | ||
<code c> | <code c> | ||
Line 732: | Line 743: | ||
Like avps, xavp act like a stack. To refer to an existing value, use an index. The newest xavp has index zero [0]. | Like avps, xavp act like a stack. To refer to an existing value, use an index. The newest xavp has index zero [0]. | ||
+ | |||
<code c> | <code c> | ||
$xavp(root[0]=> | $xavp(root[0]=> | ||
Line 739: | Line 751: | ||
<code c> | <code c> | ||
- | # new item (example => (name = " | + | # new item (example => [(name = " |
$xavp(example=> | $xavp(example=> | ||
- | # add new item (example => (name = " | + | |
+ | # add new item (example => [(name = " | ||
$xavp(example=> | $xavp(example=> | ||
+ | |||
# add another named value to the last example item | # add another named value to the last example item | ||
+ | # | ||
$xavp(example[0]=> | $xavp(example[0]=> | ||
+ | |||
# add another named value to first example item | # add another named value to first example item | ||
+ | # | ||
xavp(example[1]=> | xavp(example[1]=> | ||
</ | </ |