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 [2019/11/15 15:07] giavac [$http_req(key)] |
cookbooks:5.3.x:pseudovariables [2020/04/02 21:37] miconda [$xavp(id) - XAVPs] |
||
---|---|---|---|
Line 12: | Line 12: | ||
Pseudo-Variables are implemented by various modules, most of them are provided by **pv** (if there is no special reference to a module, expect that the pseudo-variable is provided by **pv** module). | Pseudo-Variables are implemented by various modules, most of them are provided by **pv** (if there is no special reference to a module, expect that the pseudo-variable is provided by **pv** module). | ||
- | ===== Pseudo-variables usage ===== | ||
+ | |||
+ | ===== Pseudo-variables usage ===== | ||
Pseudo-variables can be used with many modules, among them: | Pseudo-variables can be used with many modules, among them: | ||
Line 447: | Line 448: | ||
**$ru** - reference to request' | **$ru** - reference to request' | ||
+ | |||
+ | INVITE <fc # | ||
<fc # | <fc # | ||
+ | |||
==== $rU - Username in R-URI ==== | ==== $rU - Username in R-URI ==== | ||
**$rU** - reference to username in request' | **$rU** - reference to username in request' | ||
+ | |||
+ | INVITE sip:<fc # | ||
<fc # | <fc # | ||
+ | |||
==== $rv - SIP message version ==== | ==== $rv - SIP message version ==== | ||
Line 575: | Line 582: | ||
**$tn** - reference to display name of ' | **$tn** - reference to display name of ' | ||
+ | |||
+ | To: "< | ||
==== $tt - To tag ==== | ==== $tt - To tag ==== | ||
Line 590: | Line 599: | ||
**$tu** - reference to URI of ' | **$tu** - reference to URI of ' | ||
+ | |||
+ | To: " | ||
==== $tU - To URI Username ==== | ==== $tU - To URI Username ==== | ||
**$tU** - reference to username in URI of ' | **$tU** - reference to username in URI of ' | ||
+ | |||
+ | To: " | ||
==== $Tb - Startup timestamp ==== | ==== $Tb - Startup timestamp ==== | ||
Line 709: | Line 722: | ||
===== $xavp(id) - XAVPs ===== | ===== $xavp(id) - XAVPs ===== | ||
- | xavp - extended AVP' | + | **xavp** - eXtended AVPs - are variables |
+ | |||
+ | They work like a stack, | ||
+ | |||
+ | Each xavp has a string | ||
+ | |||
+ | To assign a single | ||
<code c> | <code c> | ||
- | $xavp(root=> | + | $xavp(root)=" |
+ | $xavp(root)=intnumber; | ||
+ | </code> | ||
+ | |||
+ | To assign a named value use: | ||
+ | |||
+ | <code c> | ||
+ | $xavp(root=> | ||
+ | $xavp(root=> | ||
</ | </ | ||
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]=> |
</ | </ | ||
If you assign a value without an index, a new xavp is allocated and the old one is pushed up the stack, becoming index [1]. Old index [1] becomes [2] etc. | If you assign a value without an index, a new xavp is allocated and the old one is pushed up the stack, becoming index [1]. Old index [1] becomes [2] etc. | ||
+ | |||
<code c> | <code c> | ||
- | $xavp(example=> | + | # new item (example => [(lastname = " |
- | #create | + | $xavp(example=> |
- | $xavp(example=> | + | |
- | #add extra value to "two" | + | # add new item (example => [(lastname = " |
- | $xavp(example[0]=> | + | $xavp(example=> |
- | #add value to first variable - "one" | + | |
- | $xavp(example[1]=> | + | # add another named value to the last example item |
+ | # | ||
+ | $xavp(example[0]=> | ||
+ | |||
+ | # add another named value to first example item | ||
+ | # | ||
+ | xavp(example[1]=> | ||
</ | </ | ||
Line 2132: | Line 2168: | ||
* version - HEP version | * version - HEP version | ||
- | * src_ip - source IP address | ||
- | * dst_ip - destination IP address | ||
* 0x000 - HEP attribute 0x000 | * 0x000 - HEP attribute 0x000 | ||
* 0x999 - HEP attribute 0x999 | * 0x999 - HEP attribute 0x999 |