User Tools

Site Tools


cookbooks:devel:transformations

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cookbooks:devel:transformations [2018/07/12 08:32]
gaaf [{re.subst,expression}]
cookbooks:devel:transformations [2019/01/09 10:11]
ycaner Json : add json.parse transformation.
Line 1: Line 1:
-====== Kamailio SIP Server v5.2.x (devel): Transformations ======+====== Kamailio SIP Server v5.3.x (devel): Transformations ======
  
 <code> <code>
Line 316: Line 316:
 <code c> <code c>
 $(var(x){s.corehash}) $(var(x){s.corehash})
 +</code>
 +
 +==== {s.unquote} ====
 +
 +Return the value without surrounding single (') or double quotes (").
 +
 +<code c>
 +$var(x) = "\"alice\"";
 +$var(alice) = $(var(x){s.unquote});
 +</code>
 +
 +==== {s.unbracket} ====
 +
 +Return the value without surrounding (), [], {} or <>.
 +
 +<code c>
 +$var(x) = "<sip:alice@test.sip>";
 +$var(uri) = $(var(x){s.unbracket});
 </code> </code>
 ===== URI Transformations ===== ===== URI Transformations =====
Line 693: Line 711:
  
 $(hu{url.querystring}) => "this=is&the=querystring" $(hu{url.querystring}) => "this=is&the=querystring"
 +</code>
 +
 +===== JSON Transformations =====
 +
 +<fc #0000ff>This transformation class is exported by **json** module.</fc>
 +
 +
 +==== {json.parse} ====
 +
 +You can use the transformation to extract values from the json structured pseudo-variables
 +
 +<code>
 +
 +$var(Custom-Data) = $(rb{json.parse,Custom-Data});
 +
 </code> </code>
  
cookbooks/devel/transformations.txt ยท Last modified: 2022/04/08 18:08 by miconda