cookbooks:3.2.x:pseudovariables
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cookbooks:3.2.x:pseudovariables [2012/02/02 09:38] – [Username in SIP Request's URI] klaus3000 | cookbooks:3.2.x:pseudovariables [2012/05/03 11:35] (current) – [AVPs] klaus3000 | ||
---|---|---|---|
Line 482: | Line 482: | ||
$(avp(id)[0]) can be written in shorter form as $avp(id) and $avp(s: | $(avp(id)[0]) can be written in shorter form as $avp(id) and $avp(s: | ||
- | AVPs are special variables that are attached to SIP transactions. It is a list of pairs (name, | + | AVPs are special variables that are attached to SIP transactions. It is a list of pairs (name, |
To delete the first AVP with name ' | To delete the first AVP with name ' | ||
Line 496: | Line 496: | ||
To overwrite the value of the AVP with name ' | To overwrite the value of the AVP with name ' | ||
<code c> | <code c> | ||
- | $(avp(id)[*]) = newvalue; | + | $(avp(id)[*]) = newvalue; |
</ | </ | ||
Line 506: | Line 506: | ||
$avp(x) = 1; # assign of integer value | $avp(x) = 1; # assign of integer value | ||
$avp(x) = 2; | $avp(x) = 2; | ||
+ | $avp(x) = 3; | ||
+ | # now: $avp(x) = $(avp(x)[0]) = 3, $(avp(x)[1]) = 2, $(avp(x)[2]) = 1 | ||
$avp(y) = " | $avp(y) = " | ||
- | if($(avp(x)[1])==1) { | + | if($(avp(x)[2])==1) { # TRUE |
... | ... | ||
} | } | ||
- | $(avp(x)[1]) = $null; | + | $(avp(x)[1]) = $null; |
+ | # now: $avp(x) = $(avp(x)[0]) = 2, $(avp(x)[1]) = 1 | ||
+ | $(avp(x)[*]) = $null; # all AVPs ' | ||
</ | </ | ||
cookbooks/3.2.x/pseudovariables.1328175518.txt.gz · Last modified: 2012/02/02 09:38 by klaus3000