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 [2011/12/19 19:30] – [Broken-down time] 85.178.73.159 | cookbooks:3.2.x:pseudovariables [2012/05/03 11:35] (current) – [AVPs] klaus3000 | ||
---|---|---|---|
Line 259: | Line 259: | ||
**$ml** - reference to SIP message length | **$ml** - reference to SIP message length | ||
+ | |||
+ | ==== SIP Message Type ==== | ||
+ | |||
+ | **$mt** - returns 1 if the sip message is a request, returns 2 if the sip message is a reply | ||
+ | |||
==== Domain in SIP Request' | ==== Domain in SIP Request' | ||
Line 331: | Line 336: | ||
**$rm** - reference to request' | **$rm** - reference to request' | ||
+ | |||
+ | ==== Request Method ID ==== | ||
+ | |||
+ | **$rmid** - returns internal integer representation of SIP method type | ||
+ | |||
==== SIP request' | ==== SIP request' | ||
Line 365: | Line 375: | ||
<fc # | <fc # | ||
+ | |||
+ | ==== URI Scheme of Request URI ==== | ||
+ | |||
+ | **$rz** - returns R-URI scheme, possible values: sip, sips, tel and tels, R-URI scheme parsing error should be reflected by value: none | ||
==== Received IP address ==== | ==== Received IP address ==== | ||
Line 468: | 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 482: | 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 492: | 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 ' | ||
</ | </ | ||
Line 928: | Line 946: | ||
* reply_code - alias to $T_reply_code | * reply_code - alias to $T_reply_code | ||
* branch_index - alias to $T_branch_idx | * branch_index - alias to $T_branch_idx | ||
+ | * reply_type - 1 if it is a local generated reply, 0 - if no reply for transaction or it is a received reply | ||
Note: the pair (id_index, | Note: the pair (id_index, |
cookbooks/3.2.x/pseudovariables.1324323043.txt.gz · Last modified: 2011/12/19 19:30 by 85.178.73.159