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:devel:transformations [2018/09/04 19:00] miconda [{s.corehash,n}] |
cookbooks:devel:transformations [2019/10/10 14:54] miconda |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Kamailio SIP Server v5.2.x (devel): Transformations ====== | + | ====== Kamailio SIP Server v5.4.x (devel): Transformations ====== |
< | < | ||
Line 335: | Line 335: | ||
$var(uri) = $(var(x){s.unbracket}); | $var(uri) = $(var(x){s.unbracket}); | ||
</ | </ | ||
+ | |||
+ | ==== {s.count,c} ==== | ||
+ | |||
+ | Count how many times c appears in the pv value. | ||
+ | |||
+ | <code c> | ||
+ | abababa" | ||
+ | # will return 4 | ||
+ | </ | ||
+ | |||
+ | |||
===== URI Transformations ===== | ===== URI Transformations ===== | ||
Line 416: | Line 427: | ||
The name of the transformation starts with ' | The name of the transformation starts with ' | ||
- | Available transformations in this class: | + | Available transformations in this class are presented in the next sections. |
+ | |||
+ | **Important Note:** the delimiter cannot be comma (,), because this trasformation is using SIP header/URI parameters parser and the comma is a delimiter between serialized SIP header/URI bodies. The workaround is to use the subst transformation to replace the comma with another character that is used then as separator. | ||
Line 711: | Line 724: | ||
$(hu{url.querystring}) => " | $(hu{url.querystring}) => " | ||
+ | </ | ||
+ | |||
+ | ===== JSON Transformations ===== | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | |||
+ | ==== {json.parse} ==== | ||
+ | |||
+ | You can use the transformation to extract values from the json structured pseudo-variables | ||
+ | |||
+ | < | ||
+ | |||
+ | $var(Custom-Data) = $(rb{json.parse, | ||
+ | |||
</ | </ | ||